User:SteveL/Transparency: Difference between revisions

From The DarkMod Wiki
Jump to navigationJump to search
SteveL (talk | contribs)
Creating draft for article on transparency
 
SteveL (talk | contribs)
m extra header
 
Line 2: Line 2:
TDM supports three types of transparency: alpha testing, alpha blending, and translucency.
TDM supports three types of transparency: alpha testing, alpha blending, and translucency.
===Alpha test===
===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 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 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.  
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===
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.
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 test==
==Using alpha blend==
==Using alpha blend==
Line 14: Line 14:
===Sort order===
===Sort order===
==Using translucency==
==Using translucency==
==Limitations==
==Manipulating transparency in game==
==Manipulating transparency in game==
==Case studies==
==Case studies==

Latest revision as of 18:02, 4 April 2014

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