User:SteveL/Transparency

From The DarkMod Wiki
Revision as of 17:40, 4 April 2014 by SteveL (talk | contribs) (Creating draft for article on transparency)
(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, 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 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 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 or window screens and the like.

Using alpha test

Using alpha blend

Blend modes

Parameters

Shaderparms

Sort order

Using translucency

Manipulating transparency in game

Case studies

Glass

Decals

Fake skybox details / LOD models

Layered sky