$translucent: Difference between revisions

From Valve Developer Community
Jump to navigation Jump to search
No edit summary
mNo edit summary
Line 2: Line 2:
  "$translucent" 1
  "$translucent" 1
* Used with [[UnlitGeneric]], [[VertexLitGeneric]], [[LightmappedGeneric]] and many more shaders to enable a opacity map according to the alpha channel of the [[$basetexture]].  
* Used with [[UnlitGeneric]], [[VertexLitGeneric]], [[LightmappedGeneric]] and many more shaders to enable a opacity map according to the alpha channel of the [[$basetexture]].  
* '''Warning:''' There are [http://www.chatbear.com/board.plm?a=viewthread&t=697,1113959073,6037&id=839735&b=4986&v=flatold reports] of a Rendering bug which reverses the overlay order of multiple translucent materials; so that the further material occludes the nearer one. The preferred solution appears to be to use [[$alphatest]] instead or [[$translucent]].


=== Additional Parameters===
=== Additional Parameters===
Line 12: Line 13:
  "$alphatest" 1
  "$alphatest" 1
* Every pixel with an alpha value less than 178 will be completely transparent in game. (However, values close to this value will confuse the shader at distances.)  
* Every pixel with an alpha value less than 178 will be completely transparent in game. (However, values close to this value will confuse the shader at distances.)  
* This type of shading costs much less than [[$translucent]] shading [http://www.chatbear.com/board.plm?a=viewthread&t=697,1113959073,6037&id=839735&b=4986&v=flatold].  
* This type of shading costs much less than [[$translucent]] shading.  


====$additive====
====$additive====

Revision as of 20:19, 8 November 2007

Basic VMT syntax

"$translucent" 1

Additional Parameters

$alpha

"$alpha" float
  • Scales material opacity by the 'float' number.

$alphatest

"$alphatest" 1
  • Every pixel with an alpha value less than 178 will be completely transparent in game. (However, values close to this value will confuse the shader at distances.)
  • This type of shading costs much less than $translucent shading.

$additive

"$additive" 1
  • Renders the texture additively (Its colors are added to, instead of replacing, what is displayed behind it).