$alphatest: Difference between revisions
Jump to navigation
Jump to search
m (Nescius moved page $alphatest/en to $alphatest without leaving a redirect) |
SirYodaJedi (talk | contribs) |
||
Line 36: | Line 36: | ||
! <code>$translucent</code>||<code>$alphatest</code> | ! <code>$translucent</code>||<code>$alphatest</code> | ||
|- | |- | ||
| [[File:Alphatest_preview_original.png|thumb|50%|center|Original image, rendered with $translucent]] || [[File:Alphatest_preview.gif|thumb|50%|center|Animated preview of the same image, but with $alphatest. The first image shows the effect of $allowalphatocoverage 1 (at 4x MSAA). The rest show $alphatest with $alphatestreference ranging from 0.1 to 0.9]] | | [[File:Alphatest_preview_original.png|thumb|50%|center|Original image, rendered with $translucent]] || [[File:Alphatest_preview.gif|thumb|50%|center|Animated preview of the same image, but with $alphatest. The first image shows the effect of $allowalphatocoverage 1 (at 4x MSAA). The rest show $alphatest with $alphatestreference ranging from 0.1 to 0.9. Click image if not animating.]] | ||
|} | |} | ||
</div> | </div> |
Revision as of 22:00, 9 March 2025
$alphatest
is a material shader parameter available in all Source games. It specifies a mask to use to determine binary opacity. White represents fully opaque, while black represents fully transparent. Any values in-between are rounded to either 0 or 1, unless
$allowalphatocoverage
is also used. This effect is similar to $translucent
, except that it can not be semi-opaque (without banding), is much faster to render, and the engine can always sort it properly when layered (instead of only on non-detail worldspawn).
Syntax
VMT example
Additional parameters
Comparison
$translucent |
$alphatest
|
---|---|
Notice how the $alphatest
right circle hardly changes.