User:SteveL/Transparency

From The DarkMod Wiki
Revision as of 18:02, 4 April 2014 by SteveL (talk | contribs) (extra header)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigationJump to search

The three types of transparency

TDM supports three types of transparency: alpha testing, alpha blending, and translucency.

Alpha test

Alpha test gives you a cardboard-cutout effect. All parts of the texture are either completely opaque or completely transparent. Useful for making a square patch look like a different flat shape in decals, particles, skyboxes, and LOD models. The material remains properly lit by nearby light sources.

Alpha blend

Alpha blending is proper transparency. Detail from the transparent texture is seen in front of whatever's behind. Useful for glass windows and rendered skybox layers. Alpha blending gives you the most flexibility and control, but is harder to configure. The material is not lit by nearby light sources, so an appropriate level of lighting has to be configured in the material file or in DR or adjusted in real-time with a script, and the textured surface has to be flattish for any lighting illusion to work.

Translucency

Translucency has a specific meaning in IdTech4 and TDM: a texture that reflects exactly 50% of the light it would normally, and lets through exactly 50% of the light coming from behind. The material will be properly lit by nearby light sources. Useful for 3d objects that share these properties: bottles, sheer cloths, and window screens and the like.

Using alpha test

Using alpha blend

Blend modes

Parameters

Shaderparms

Sort order

Using translucency

Limitations

Manipulating transparency in game

Case studies

Glass

Decals

Fake skybox details / LOD models

Layered sky