Modulate: Difference between revisions

From Valve Developer Community
Jump to navigation Jump to search
m (huh, interesting)
(Documented new parameter: $mod2x (boosts the modulation by x2), and added the other parameter that works on this ($nocull))
Line 2: Line 2:
'''<code>Modulate</code>''' is a shader that modulates the colors of any pixels behind it.
'''<code>Modulate</code>''' is a shader that modulates the colors of any pixels behind it.


[[File:Modulate img.gif|thumb|512px|GIF Animation showing "Modulate" shader in action.]]
{{tip|This shader can be effectively used to fake various features that [[Source]] may not support, such as vertex coloring or [[lightmap]]ping on models, by creating a surface above the first one to modulate it.}}
 
[[File:Modulate img.gif|thumb|300px|GIF Animation showing "Modulate" shader in action.]]
[[File:Mod2x_comparison.png|thumb|300px|Picture showing the difference between $mod2x 0 and 1.]]
   
   
==Description==
==Description==
Accepts only a <code>$basetexture</code> and this texture will be used to modulate pixels. Multiplies the color behind it with this surface's texture.
Accepts only the following parameters:
Also accepts {{ent|$no_draw}}.
<pre>
 
$basetexture             "material" //Multiplies the color behind it with this surface's texture.
{{tip|This can be effectively used to fake various features that [[Source]] may not support, such as vertex coloring or [[lightmap]]ping on models, by creating a surface above the first one to modulate it.}}
$mod2x                    "boolean"  //Doubles the modulation, making it appear brighter. 1 enables this, 0 disables. Disabled by default.
$nocull                  "boolean"  //Draws triangles from both sides, not just one. 1 enables this, 0 disables. Disabled by default.
</pre>


{{warning|Expensive if multiple are used together.}}
{{note|Does not accept any translucency parameters, including [[$alpha]], [[$alphatest]], [[$additive]] and [[$translucent]].}}


==See also==
==See also==

Revision as of 06:55, 25 January 2019

Stub

This article or section is a stub. You can help by expanding it.

Modulate is a shader that modulates the colors of any pixels behind it.

Tip.pngTip:This shader can be effectively used to fake various features that Source may not support, such as vertex coloring or lightmapping on models, by creating a surface above the first one to modulate it.
GIF Animation showing "Modulate" shader in action.
Picture showing the difference between $mod2x 0 and 1.

Description

Accepts only the following parameters:

$basetexture              "material" //Multiplies the color behind it with this surface's texture.
$mod2x                    "boolean"  //Doubles the modulation, making it appear brighter. 1 enables this, 0 disables. Disabled by default.
$nocull                   "boolean"  //Draws triangles from both sides, not just one. 1 enables this, 0 disables. Disabled by default.
Note.pngNote:Does not accept any translucency parameters, including $alpha, $alphatest, $additive and $translucent.

See also