Dissolve(for LOD) in cryengine2

ccanan

Newcomer
Hi, it's from the doc of : Chapter8-Mittring-Finding_NextGen_CryEngine2.pdf
I am pretty puzzled by the following part.
what it wants to say, Z-fade? smooth transition from high LOD to low LOD?

anyone can give some detail explanation?thx.


8.6.2 Dissolve
One of our programmers finally had the idea of a soft LOD transition based on dissolving
the object in the early z pass. As we later on render with z equal comparison we only
had to adjust the early z pass. That was not completely true as surfaces can have
exactly the same z value and then with additive blending those pixels would become
twice as bright. However as the first rendering pass of each object has frame buffer
blending disabled the problem should only occur with subsequent passes. As we can
combine multiple lights in one pass this is a rare case anyway.
The dissolve texture is projected in screen space, and by combining the random value
from the texture with a per object transition value, the pixels are rejected with the texkill
operation or simple alpha-test. With the Alpha2Coverage feature and full scene antialiasing
(FSAA) of modern cards that can be even done on a sub-pixel level. Even
without FSAA the dissolve is not that noticeable if we enable our edge-blurring post
processing effect.
Initially we had the transition state only depend on object distance but objects that are in
transition are slower to render and for quality reasons it’s better to hide it. That’s why we
added code to finish started transitions within a defined small amount of time. We not
only use the dissolve for transitions between 3D objects but also to fade out far away
objects and to hide the transition to impostors.
 
This is similar to how ETQW does it. Basically, to avoid harsh LoD transitions, at specific distances you actually render LoDs but then blend them using alpha2coverage into the final image. The effect is not perfect but it's not dependent on AA (on ETQW's case at least) but it's smoother with it. The coverage mask you use depends on the distance so that more you approach a specific object the more "solid" it appears on screen.

Because the artefact derived from alpha2coverage is manifested as a stipple mask dithering you really only want to use this for distant transitions which is why the paper mentions imposters. In ETQW it was used for imposters and actual geometry LoDs though. You can transition anything really, including shadows.

There's a performance cost associated with the blending of course but even with the artefact it's still an effective way to hide LoD transitions.
 
Back
Top