Deus Ex – Alpha Terrain | Simon schreibt.

submited by
Style Pass
2023-05-29 13:00:08

Three years ago, while playing Deus Ex: Mankind Divided, I noticed a nice little trick and tweeted about it – today is the day when I finally release it as an article. Do you guess, what’s this about?

Correct answer: The terrain blends nicely with the stone! Let me explain it in more detail: Usually when objects and terrain intersect with each-other, one can see a harsh intersection. In Deus Ex on the other hand, there’s a nice smooth transition between terrain and object:

What I like about the Deus Ex approach: it’s a simple hack (and you know me, I LOVE tricks like that!). Let’s look at some examples, and maybe you can guess already what’s happening here:

The terrain uses a translucent material! As such, it can make use of a simple depth fade (the closer a pixel is to an opaque surface, the more transparent it gets) it can now blend smoothly with the (opaque) objects.

Instead of doing a simple depth fade, EmilMeiton describes an improved method: “using the depth buffer “raw” to blend my objects works, but the result is heavily dependent on the angle of the camera to the ground. […] I realized we could simply reverse this effect by calculating the tangent of the angle between the terrain normal and the view direction (camera vector) and use this to divide the earlier used distance (between terrain and object beneath). It’s not perfect but it’s way better than the result before,”

Leave a Comment