$distancealpha: Difference between revisions
Jump to navigation
Jump to search
TomEdwards (talk | contribs) No edit summary |
TomEdwards (talk | contribs) No edit summary |
||
Line 1: | Line 1: | ||
{{stub}} | |||
Another new OB feature: outlining. [http://www.valvesoftware.com/publications/2007/SIGGRAPH2007_AlphaTestedMagnification.pdf See this PDF] for a high-level explanation of what all this stuff does. | Another new OB feature: outlining. [http://www.valvesoftware.com/publications/2007/SIGGRAPH2007_AlphaTestedMagnification.pdf See this PDF] for a high-level explanation of what all this stuff does. | ||
== class_spy_outline == | |||
$softedges 1 | |||
$edgesoftnessstart | [[Image:Class spy outline.png|frame|The material's [[$basetexture]] (100% zoom).]] | ||
$edgesoftnessend | [[Image:Class spy outline ingame.jpg|thumb|256px|The material in-game (50% zoom).]] | ||
This material is displayed by [[Team Fortress 2]] when a spy player gains or loses a disguise. Despite the fact that it fills the entire screen at any resolution, its texture (right) is only 256 pixels square. | |||
It can scale to high resolutions thanks to the Valve's new method of alpha testing, wherein threshold alpha values are used to construct smooth lines on the video card regardless of resolution. | |||
[[UnlitGeneric]] | |||
{ | |||
[[$basetexture]] hud\class_spy_outline | |||
[[$translucent]] 1 | |||
$softedges 1 | |||
$edgesoftnessstart .5 | |||
$edgesoftnessend .46 | |||
$scaleedgesoftnessbasedonscreenres 1 | $scaleedgesoftnessbasedonscreenres 1 | ||
$glow 1 | |||
$glowcolor "[0 0 0]" | |||
$glowalpha .4 | |||
$glowstart .1 | |||
$glowend .5 | |||
[[$distancealpha]] 1 | |||
[[$vertexcolor]] 1 | |||
$ | [[$vertexalpha]] 1 | ||
$ | [[$no_fullbright]] 1 | ||
$ | [[$ignorez]] 1 | ||
$ | } | ||
Note in the above material how <code>$edgesoftnessstart</code> has the same value as <code>$glowend</code>. the glow effect is used for parts of the material above 50% opacity, while soft edges are created for parts below. | |||
== Advantages == | |||
* Cheaper than a vector, presumably? | |||
* Allows cheap per-pixel details | |||
* Takes advantage of 3D acceleration | |||
[[Category:List of Shader Parameters|O]] | [[Category:List of Shader Parameters|O]] |
Revision as of 15:33, 13 July 2008
Another new OB feature: outlining. See this PDF for a high-level explanation of what all this stuff does.
class_spy_outline

The material's $basetexture (100% zoom).
This material is displayed by Team Fortress 2 when a spy player gains or loses a disguise. Despite the fact that it fills the entire screen at any resolution, its texture (right) is only 256 pixels square.
It can scale to high resolutions thanks to the Valve's new method of alpha testing, wherein threshold alpha values are used to construct smooth lines on the video card regardless of resolution.
UnlitGeneric { $basetexture hud\class_spy_outline $translucent 1 $softedges 1 $edgesoftnessstart .5 $edgesoftnessend .46 $scaleedgesoftnessbasedonscreenres 1 $glow 1 $glowcolor "[0 0 0]" $glowalpha .4 $glowstart .1 $glowend .5 $distancealpha 1 $vertexcolor 1 $vertexalpha 1 $no_fullbright 1 $ignorez 1 }
Note in the above material how $edgesoftnessstart
has the same value as $glowend
. the glow effect is used for parts of the material above 50% opacity, while soft edges are created for parts below.
Advantages
- Cheaper than a vector, presumably?
- Allows cheap per-pixel details
- Takes advantage of 3D acceleration