Alpha-fading: Difference between revisions

From The DarkMod Wiki
Jump to navigationJump to search
No edit summary
No edit summary
Line 1: Line 1:
idTech4 (aka Doom3) supports only an alpha threshold. That means the shader for a material sets an arbitrary threshold, and values in the alpha map below that value render opaque, and above that value transparent.
idTech4 (aka Doom3) supports only an alpha threshold. That means the shader for a material sets an arbitrary threshold, and values in the alpha map below that value render opaque, and above that value transparent.


The results in pixels either being transparent, or opaque. The only other way to achive translucency is to set the [[translucent]] keyword in a shader. This however, fixes the translucency to 50%.  [Springheel:  can someone confirm this?  It contradicts my experience with D3 materials.]
The results in pixels either being transparent, or opaque. The only other way to achive translucency is to set the [[translucent]] keyword in a shader. This however, fixes the translucency to 50%.  ''[Springheel:  can someone confirm this?  It contradicts my experience with D3 materials.]''


So there is no way to make models to appear ''fading-in'', or ''fading-out'', except by varying the alpha threshold. Together with a good alpha map with ramps, this can make things appear to burn-away (an effect used by D3 f.i. for the imps "burning" away after you killed them), or to "grow thinner" with distance.
So there is no way to make models to appear ''fading-in'', or ''fading-out'', except by varying the alpha threshold. Together with a good alpha map with ramps, this can make things appear to burn-away (an effect used by D3 f.i. for the imps "burning" away after you killed them), or to "grow thinner" with distance.

Revision as of 02:14, 1 June 2013

idTech4 (aka Doom3) supports only an alpha threshold. That means the shader for a material sets an arbitrary threshold, and values in the alpha map below that value render opaque, and above that value transparent.

The results in pixels either being transparent, or opaque. The only other way to achive translucency is to set the translucent keyword in a shader. This however, fixes the translucency to 50%. [Springheel: can someone confirm this? It contradicts my experience with D3 materials.]

So there is no way to make models to appear fading-in, or fading-out, except by varying the alpha threshold. Together with a good alpha map with ramps, this can make things appear to burn-away (an effect used by D3 f.i. for the imps "burning" away after you killed them), or to "grow thinner" with distance.

Here is a crude example of such an alpha map (the black parts are transparent, white opaque):

Left: Diffuse Center: Normal alpha Right: Alpha with ramp

See also