$translucent: Difference between revisions

From Valve Developer Community
Jump to navigation Jump to search
mNo edit summary
Line 11: Line 11:


====$alphatest====
====$alphatest====
"$alphatest" 1
Sometimes [[$translucent]] leads to rendering errors in the game: eg where modelA is behind modelB, but modelB gets hidden by modelA. If this happens, using the command <code>"$alphatest" 1</code> instead of <code>"$translucent" 1</code> should fix it.
* VMT syntax example:
      // "[[$translucent]]" 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.  
* This type of shading costs much less than [[$translucent]] shading.


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

Revision as of 16:28, 4 April 2008

Basic VMT syntax

"$translucent" 1

Additional Parameters

$alpha

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

$alphatest

Sometimes $translucent leads to rendering errors in the game: eg where modelA is behind modelB, but modelB gets hidden by modelA. If this happens, using the command "$alphatest" 1 instead of "$translucent" 1 should fix it.

  • VMT syntax example:
      // "$translucent" 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.)
  • 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).