$translucent: Difference between revisions
Jump to navigation
Jump to search
Warning:
Note:
TomEdwards (talk | contribs) No edit summary |
TomEdwards (talk | contribs) No edit summary |
||
Line 1: | Line 1: | ||
<div style="float:right;padding:0 1em;background:#FFF;">__TOC__</div> | <div style="float:right;padding:0 1em;background:#FFF;">__TOC__</div> | ||
The [[$translucent]] [[VMT command]] Specifies that the material should use the alpha channel of | The [[$translucent]] [[VMT command]] Specifies that the material should use the alpha channel of [[$basetexture]] to mask parts of the material on a pixel-by-pixel basis. It is available with [[UnlitGeneric]], [[VertexLitGeneric]], [[LightmappedGeneric]] and many more shaders. | ||
{{warning| | {{warning|<code>$translucent</code> can sometimes cause rendering artefacts; consider [[$alphatest]] when this happens.}} | ||
{{note| | {{note|<code>$translucent</code> cannot be used in conjunction with [[$envmap]], and probably other parameters like it. If you have trouble, try stripping everything non-essential from your VMT.}} | ||
==VMT syntax example== | ==VMT syntax example== | ||
[[LightmappedGeneric]] | [[LightmappedGeneric]] | ||
{ | { | ||
Line 16: | Line 17: | ||
} | } | ||
== | ==Related parameters== | ||
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]]). | ;<code>$additive 1</code> | ||
:Renders the texture additively - its colors are add, instead of replacing, what is displayed behind ;<code>$alpha <[[float]]]></code> | |||
:Scales material opacity by the given value. 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]] | ||
[[Category:VMT Transparency]] | [[Category:VMT Transparency]] |
Revision as of 11:05, 20 April 2008
The $translucent VMT command Specifies that the material should use the alpha channel of $basetexture to mask parts of the material on a pixel-by-pixel basis. It is available with UnlitGeneric, VertexLitGeneric, LightmappedGeneric and many more shaders.

$translucent
can sometimes cause rendering artefacts; consider $alphatest when this happens.
$translucent
cannot be used in conjunction with $envmap, and probably other parameters like it. If you have trouble, try stripping everything non-essential from your VMT.VMT syntax example
LightmappedGeneric { $basetexture "decals/mydecal" $decal 1 $decalscale 0.10 $translucent 1 }
Related parameters
$additive 1
- Renders the texture additively - its colors are add, instead of replacing, what is displayed behind ;
$alpha <float]>
- Scales material opacity by the given value. 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).