Modulate: Difference between revisions

From Valve Developer Community
Jump to navigation Jump to search
(Removed stub)
m (Changed to use Shader template)
Line 1: Line 1:
'''<code>Modulate</code>''' is a shader that modulates the colors of any pixels behind it.
{{Shader|Modulate}} It modulates the colors of any pixels behind it.


{{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.}}
{{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.}}
Line 9: Line 9:
Accepts only the following parameters:
Accepts only the following parameters:
<pre>
<pre>
$basetexture              "material" //Multiplies the color behind it with this surface's texture.
$basetexture              "texture" //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.
$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.
$nocull                  "boolean"  //Draws triangles from both sides, not just one. 1 enables this, 0 disables. Disabled by default.
Line 19: Line 19:
*{{ent|Refract}}
*{{ent|Refract}}
*<code>[[Water (shader)|Water]]</code>
*<code>[[Water (shader)|Water]]</code>
[[Category:Shaders]]

Revision as of 14:23, 27 June 2019

Shader-ball.png Modulate It 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              "texture" //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