$additive: Difference between revisions
TomEdwards (talk | contribs) m (made redir) |
(Replaced the redirect with its own article, will work on it more) Tag: Removed redirect |
||
Line 1: | Line 1: | ||
{{LanguageBar}} | |||
{{this is a|shader parameter|name=$additive}}{{toc-right}} | |||
It specifies that the material should be rendered additively; that is, its colour values will be added to underlying pixels. This means, among other things, that the material will always brighten the world behind it. This is useful for effects like volumetric dust, light sprites, etc. | |||
{{note|$additive is a form of transparency, and [[Solid|solids]] with additive materials on them cannot be used to [[seal]] the map.}} | |||
==VMT Syntax Example== | |||
$additive <[[Boolean|bool]]> | |||
[[LightmappedGeneric]] | |||
{ | |||
[[$basetexture]] glass\window001a | |||
'''$additive 1''' | |||
} | |||
The amount of brightening depends on the brightness of the [[$basetexture]]. A fully black texture will become invisible, however, other texture effects (such as [[$detail]], [[$emissiveblend]], [[$envmap]]) can still be drawn (not implicitly additively). | |||
This does work together with $color and $color2, allowing to control the strength of the additive blending, and change it with Proxies. | |||
$additive is supported by most shaders, and does not require the texture to have an [[alpha]] channel. It also doesn't share the numerous caveats of [[$translucent]] and [[$alphatest]], such as being mutually exclusive with [[$selfillum]], or other shader parameters that make use of the alpha channel, for that matter. | |||
==See also== | |||
*{{ent|$translucent}} | |||
*{{ent|$alpha}}, for texture-wide translucency | |||
*{{ent|$distancealpha}}, for vector-like alpha edges | |||
*{{ent|$vertexalpha}} | |||
*{{ent|$alphatest}}, for binary opacity. | |||
[[Category:Shader parameters|translucent]] |
Revision as of 15:35, 18 January 2025


$additive
is a material shader parameter available in all Source games.
It specifies that the material should be rendered additively; that is, its colour values will be added to underlying pixels. This means, among other things, that the material will always brighten the world behind it. This is useful for effects like volumetric dust, light sprites, etc.

VMT Syntax Example
$additive <bool>
LightmappedGeneric { $basetexture glass\window001a $additive 1 }
The amount of brightening depends on the brightness of the $basetexture. A fully black texture will become invisible, however, other texture effects (such as $detail, $emissiveblend, $envmap) can still be drawn (not implicitly additively).
This does work together with $color and $color2, allowing to control the strength of the additive blending, and change it with Proxies.
$additive is supported by most shaders, and does not require the texture to have an alpha channel. It also doesn't share the numerous caveats of $translucent and $alphatest, such as being mutually exclusive with $selfillum, or other shader parameters that make use of the alpha channel, for that matter.
See also
- $translucent
- $alpha, for texture-wide translucency
- $distancealpha, for vector-like alpha edges
- $vertexalpha
- $alphatest, for binary opacity.