This article's documentation is for anything that uses the Source engine. Click here for more information.

Modulate: Difference between revisions

From Valve Developer Community
Jump to navigation Jump to search
(→‎Description: useful to know if porting materials)
No edit summary
Line 3: Line 3:
{{this is a|pixel shader|name=Modulate}} It modulates the colors of any pixels behind it.
{{this is a|pixel shader|name=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.}}
A practical application of this shader is to create [[env_tonemap_controller|bloom-boosting]] textures, to create fake eye adaptation inside interiors.
Other uses include faking 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.
   
   
==Description==
==Description==
[[File:Mod2x bloom.jpg|thumb|300px|Demonstration of normal bloom vs bloom boosting using $mod2x 1 with white basetexture]]
[[File:Mod2x_comparison.png|thumb|300px|Picture showing the difference between $mod2x 0 and 1.]]
[[File:Mod2x_comparison.png|thumb|300px|Picture showing the difference between $mod2x 0 and 1.]]
Accepts only the following parameters:
Accepts only the following parameters:

Revision as of 11:08, 6 April 2025

English (en)Translate (Translate)
GIF Animation showing "Modulate" shader in action.

Modulate is a Pixel shader available in all Source Source games. It modulates the colors of any pixels behind it.

A practical application of this shader is to create bloom-boosting textures, to create fake eye adaptation inside interiors. Other uses include faking 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.

Description

Demonstration of normal bloom vs bloom boosting using $mod2x 1 with white basetexture
Picture showing the difference between $mod2x 0 and 1.

Accepts only the following parameters:

$basetexture $mod2x $nocull

Note.pngNote:Does not accept any translucency parameters, including $alpha, $alphatest, $additive and $translucent.

See also