跳过导航
Everything far away in a game engine can feel small, flat, and washed out.
0:00 / 0:51

Everything far away in a game engine can feel small, flat, and washed out.

Analog Dream Dev

@AnalogDreamDev6812 位关注者

在 X 上查看
2,119 个赞下载原帖

89,437 次观看

Everything far away in a game engine can feel small, flat, and washed out. That is correct perspective, but it can make for some poor scenery sometimes. Two features I've added to my engine try to fight against that: Spatial Recession magnifies the distance. After a vertex is projected I push its screen position outward from center. Near geometry is untouched. It only moves x and y, never depth, so nothing sorts differently and nothing z-fights. The result is a long lens bolted onto the far half of a wide one: the tower and the ridgeline loom instead of receding, while I keep the wide field of view I actually play in (FOV is identical in both of these examples). Dimensional Falloff is four distance ramps on the surface itself. Lighting contrast flattens so distant hills stop having a hard lit side and a hard dark side, which is what haze does in real life. Color then desaturates toward its own brightness to fake more distance. Then that desaturated color is pushed, and that is the one doing most of the visible work here. Last is texture detail, with a custom MIP value based on distances. All of it keys off real radial distance from the camera rather than depth This is so it stays put when you turn your head. Performance cost is next to nothing. The recession is two lines in the vertex shader. The falloff is a few lerps at the end of the pixel shader, which was already computing that distance for the mip bias anyway. Quite happy with the results, what do you think? #gamedev

45 条评论

评论来自 X (Twitter) 上的原帖

  • James Tusha 的头像

    @signalspikedev

    Holy shit. Ive never once thought about, not read about, such an implementation but looking at it, and thinking about it, it's so obvious. What inspired you to do this? The implications are huge.

    46 个赞

  • Analog Dream Dev 的头像

    @AnalogDreamDev

    A lot of things from media in my childhood. Movies used to do a lot of matte paintings for backdrops that would cause this kind of similar effect. Even the way old 2d animation was done, where the world felt 3d but still "layered." I just wanted that kind of "storybook" feeling to it, superimposed and pulling you to the horizon.

    48 个赞

  • James Tusha 的头像

    @signalspikedev

    I've been playing with projection and camera techniques for ~20 years and never once thought of this. This technique is insanely clever and also so very obvious, in hindsight. Thanks for sharing about it.

    8 个赞

  • VibrantBlack 的头像

    @VibrantBlack_

    This really makes me want to play around with architecture in this engine. It's so cool how you can see everywhere you want to go as if it's right there waiting for you, but it still takes time to actually travel there with the world unfolding itself as you move through it.

    14 个赞

  • Analog Dream Dev 的头像

    @AnalogDreamDev

    You've perfectly captured the balancing act there but I think its totally worth it to play with those two aspects together like this!

    8 个赞

  • creep 的头像

    @Creepyounguy

    This is really driving me nuts, I know this is a creative commons song so anyone can use it, but did you use it after hearing it in a particular game? I am trying to remember where I know it from,

    4 个赞

  • Analog Dream Dev 的头像

    @AnalogDreamDev

    No, just found it searching creative Commons. Not familiar with it being used in another game. If you figure it out, let me know.

  • ✟ Grand Moth ✟ 的头像

    @DogParkSandbox

    This is absolutely incredible. Good job on this! So essentially you're emulating the huge scenery advantage lower FOVs give you while keeping the FOV higher from the players perspective? game changing.

    4 个赞

  • Exodus 🇮🇱 的头像

    @ExodusPgame

    That's awesome and clever, and it's great to see a compressions video on my feed that is not DLSS5.

    3 个赞

  • Analog Dream Dev 的头像

    @AnalogDreamDev

    Thanks!

    2 个赞

  • Herr Löblich 的头像

    @herrloeblichDE

    this is actually awesome and i totally get the feling just from looking at the difference. great idea. great job

    2 个赞

  • Analog Dream Dev 的头像

    @AnalogDreamDev

    Thanks Löblich, glad it resonated with you!

  • Gulag Kulak 的头像

    @GulagKulak

    Wow, that is a really clever idea and it looks good!

    2 个赞

  • Judy Hopps 的头像

    @JohnSmi48756715

    That's extremely clever! Out of curiosity, if an object (flying character, projectile, etc) moves in/out of that scaling boundary, does it still look natural, or is there a moment where the movement and vert-scaling visibly counteract each other a bit?

    2 个赞

  • Analog Dream Dev 的头像

    @AnalogDreamDev

    No, its pretty inperceptable during the transition. There is no noticeable "switch" on the tower for for example as i approach it.

    1 个赞

  • Convergence Boy 的头像

    @0x796

    amazing! couldnt stop looking at it! now remember that video of aigen pixel art hill and castle?

    2 个赞

  • Andrew Valley 的头像

    @_AndrewValley

    This is genuine questions, I’m not trying to insult you. But this seems like a programmatic fix for a design problem? Why not just work on your environment design rather than break your perspective camera?

    2 个赞

  • Analog Dream Dev 的头像

    @AnalogDreamDev

    The design "problem" is i want something not "realistic" in a normal camera projection. Making the tower bigger might have a similar effect from far away but also cause different ones up close. I intentionally wanted backdrops to be over the top, playing more into feeling than reality.

    10 个赞

  • Andrew Valley 的头像

    @_AndrewValley

    Fair enough 👍

    2 个赞

  • Femdom-Verse Games 的头像

    @thefemdomverse

    Amazing. Would these techniques work in VR in your opinion? Tempted to try

    1 个赞