Skip navigation
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

@AnalogDreamDev6.8K followers

Visit on X
2,119 likesDownloadOriginal post

89,437 views

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 Comments

Comments from the original post on X (Twitter)

  • James Tusha's profile picture

    @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 likes

  • Analog Dream Dev's profile picture

    @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 likes

  • James Tusha's profile picture

    @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 likes

  • VibrantBlack's profile picture

    @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 likes

  • Analog Dream Dev's profile picture

    @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 likes

  • creep's profile picture

    @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 likes

  • Analog Dream Dev's profile picture

    @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 ✟'s profile picture

    @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 likes

  • Exodus 🇮🇱's profile picture

    @ExodusPgame

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

    3 likes

  • Analog Dream Dev's profile picture

    @AnalogDreamDev

    Thanks!

    2 likes

  • Herr Löblich's profile picture

    @herrloeblichDE

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

    2 likes

  • Analog Dream Dev's profile picture

    @AnalogDreamDev

    Thanks Löblich, glad it resonated with you!

  • Gulag Kulak's profile picture

    @GulagKulak

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

    2 likes

  • Judy Hopps's profile picture

    @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 likes

  • Analog Dream Dev's profile picture

    @AnalogDreamDev

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

    1 like

  • Convergence Boy's profile picture

    @0x796

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

    2 likes

  • Andrew Valley's profile picture

    @_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 likes

  • Analog Dream Dev's profile picture

    @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 likes

  • Andrew Valley's profile picture

    @_AndrewValley

    Fair enough 👍

    2 likes

  • Femdom-Verse Games's profile picture

    @thefemdomverse

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

    1 like