The fade occlusion works on the basis of depth comparison test based on the Depth Buffer, the number of test allows to improve the fade.
The tests are in a circle on several layers around the location of the lensflare on the screen, and spaced from the UV of the screen.
Here is an example of how the occlusion test works, in a 6*4 test, (6 points on the base circle and then 3 additional centers which adds one point per circle, +1 to the center, which gives us, 6*4 + (4-1) + 1 = 28 ).
The fade is determined by the number of points in occlusion, once pass 50% of points in occultation the flare is no longer visible.
Warning :
It is not possible to perform the occlusion test when the lensflare is no longer visible, so if you do not use the "ScreenMask" to hide the flare when it is no longer in the screen and you have put the flare in outscreen, it is possible that the lensflare becomes visible again while it was in occlusion.
It is important to take it into account in the case of a game but also for the cinematic.
In the case of cinematics, it is recommended to drive the "ScreenFade" if you want to have the effect even when it is no longer positioned in the frustrum space.
New Version
Old Version
The light shaft are not hidden by the occlusion
DepthTest_RadialStep : Number of radial tests (number of points per circle)
DepthTest_SubStep : Number of circle with offset
DepthTest_Offset : Size in UV coordinate of the offset between each circle ( Attention, use a relatively basic value, do not forget that the value UV max is 1, so the full screen corresponds to a value of 1, a value of 0.01 is recommended.)
The screen fade allows you to progressively hide the flare depending on whether its relative position on the screen is close to the edges, you can set the activation area in UV coordinate value ( half value , max 0.5 ) .
Occlusion Intnesity, allows to cut in real time the influence of occlusion shader tests, this option has been added for Occlusion Tracer.