$alphatest: Difference between revisions

From Valve Developer Community
Jump to navigation Jump to search
mNo edit summary
No edit summary
Line 1: Line 1:
{{stub}}
[[$translucent]] can sometimes lead to rendering errors, such as a surface behind an object being drawn in front of it. If this happens you may want to consider using '''<code>$alphatest</code>''' instead of <code>$translucent</code>.
The [[$alphatest]] [[VMT command]] is used ...


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.
<code>$alphatest</code> is far cheaper than <code>$translucent</code>, but reduces the bit depth of the transparency - i.e. creates jagged edges and sacrifices fine quality.
* VMT syntax example:
 
       // "[[$translucent]]" 1
== VMT syntax example ==
       "[[$alphatest]]" 1
 
* This type of shading costs much less than [[$translucent]] shading.
       // [[$translucent]] 1
       [[$alphatest]] 1


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

Revision as of 09:47, 20 April 2008

$translucent can sometimes lead to rendering errors, such as a surface behind an object being drawn in front of it. If this happens you may want to consider using $alphatest instead of $translucent.

$alphatest is far cheaper than $translucent, but reduces the bit depth of the transparency - i.e. creates jagged edges and sacrifices fine quality.

VMT syntax example

      // $translucent 1
      $alphatest 1