$translucent: Difference between revisions

From Valve Developer Community
Jump to navigation Jump to search
No edit summary
Line 5: Line 5:


=== Additional Parameters===
=== 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 <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.)
* This type of shading costs much less than [[$translucent]] shading.


====$additive====
====$additive====
  "$additive" 1
  "$additive" 1
* Renders the texture additively (Its colors are added to, instead of replacing, what is displayed behind it).  
* Renders the texture additively (Its colors are added to, instead of replacing, what is displayed behind it).  
====$alpha====
"$alpha" <float>
* Scales material opacity by the 'float' number.
* 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.(see [[$alphatest]])


[[Category:List of Shader Parameters]]
[[Category:List of Shader Parameters]]

Revision as of 16:42, 4 April 2008

Basic VMT syntax

"$translucent" 1

Additional Parameters

$additive

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

$alpha

"$alpha" <float>
  • Scales material opacity by the 'float' number.
  • 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.(see $alphatest)