Pyro vision (shader): Difference between revisions

From Valve Developer Community
Jump to navigation Jump to search
(Formatting)
(Apply general tweaks.)
Line 1: Line 1:
The pyro_vision shader is used in pyro_vision in the game Team Fortress 2. It is used to replace the normal textures of a map with a simulation similar to the fantasy land shown in the animated short "Meet the Pyro".
{{lang|$pyro_vision}}
{{cleanup}}
The {{ent|pyro_vision}} shader is used in Pyro Vision in {{game name|tf2|name=Team Fortress 2}}. It is used to replace the normal textures of a map with a simulation similar to the fantasy land shown in the animated short "Meet the Pyro".


To do so it computes the grayscale value of the diffuse color of the original texture and maps it using a special one dimensional texture. It can also project an overlay texture, usually stripes, uniformly in world space.
{{ent|pyro_vision}} computes the grayscale value of the diffuse color of the original texture and maps it using a special one dimensional texture. It can also project an overlay texture, usually stripes, uniformly in world space.
 
Recommended Reading: [[http://www.teamfortress.com/post.php?id=8502 Dreams of Chronic and Sustained Cruelty]]


The Pyro vision shader has 4 effect modes controlled by $EFFECT
The Pyro vision shader has 4 effect modes controlled by $EFFECT


{| class=standard-table
{| class="standard-table sortable"
| 0 || An R&D stage which is not finished
! Value !! class="unsortable"|Effect
|-
|-
| 1 || Handles most of the world and model rendering in pyro land
| 0 || An R&D stage which is not finished.
|-
|-
| 2 || Depth of Field blending
| 1 || Handles most of the world and model rendering in pyro land.
|-
|-
| 3 || Pyro vignette drawing
| 2 || Depth of Field blending.
|-
| 3 || Pyro vignette drawing.
|}
|}


Line 20: Line 22:
Standard Fields found in other shaders:
Standard Fields found in other shaders:


{| class=standard-table
{| class="standard-table"
| $BASETEXTURE || "" || Your diffuse texture
! Shader !! Default Value !! Description
|-
| {{ent|$BASETEXTURE}} || "" || Your diffuse texture.
|-
|-
| $BASETEXTURE2 || "" || Second diffuse texture - For two way blends
| {{ent|$BASETEXTURE2}} || "" || Second diffuse texture - For two way blends.
|-
|-
| $BLENDMODULATETEXTURE || "" || Optional modulate texture - For two way blends
| {{ent|$BLENDMODULATETEXTURE}} || "" || Optional modulate texture - For two way blends.
|-
|-
| $BLENDMASKTRANSFORM || "center .5 .5 scale 1 1 rotate 0 translate 0 0" || The transform parameters for blending
| {{ent|$BLENDMASKTRANSFORM}} || "center .5 .5 scale 1 1 rotate 0 translate 0 0" || The transform parameters for blending.
|}
|}


General Fields:
General Fields:
{| class=standard-table
{| class="standard-table"
| $EFFECT || 1 || Used to specify the effect type.
| $EFFECT || 1 || Used to specify the effect type.
|-
|-
| $VERTEX_LIT || 0 || 0 if lightmap based, 1 if vertex lit based
| $VERTEX_LIT || 0 || 0 if light-map based, 1 if vertex-lit based.
|}
|}


Effect #1 Fields
Effect #1 Fields
{| class=standard-table
{| class="standard-table"
| $DIFFUSE_BASE || 0.0 || Value from 0.0 to 1.0 to blend the diffuse towards solid white
! Shader !! Default Value !! Effect.
|-
| {{ent|$DIFFUSE_BASE}} || 0.0 || Value from 0.0 to 1.0 to blend the diffuse towards solid white.
|-
|-
| $DIFFUSE_WHITE || 0.0 || Value from 0.0 to 1.0 to blend the lightmap towards solid white
| {{ent|$DIFFUSE_WHITE}} || 0.0 || Value from 0.0 to 1.0 to blend the light-map towards solid white.
|-
|-
| $GRAY_POWER || 1.0 || Raises the gray scale result to this value
| {{ent|$GRAY_POWER}} || 1.0 || Raises the gray scale result to this value.
|-
|-
| $GRAY_STEP || "[ 0.0 1.0 ]" || Peforms a smooth step between the two values supplied.  Think of this as the min/max sliders on a histogram chart.
| {{ent|$GRAY_STEP}} || "[ 0.0 1.0 ]" || Performs a smooth step between the two values supplied.  Think of this as the min/max sliders on a histogram chart.
|-
|-
| $LIGHTMAP_GRADIENTS || 255.0 || Values from 1.0 to 255.0. Downscales the result into this many categories.  May be provide some cartooning effects if you use low values.
| {{ent|$LIGHTMAP_GRADIENTS}} || 255.0 || Downscale the result into this many categories. Value is clamped between 1.0 and 255.0.
{{tip|May provide some cartooning effects if you use low values.}}
|-
|-
| $COLORBAR || "" || Specifies a 1D Texture.  The resultant gray scale is used as a texture coordinate into this image to get the final color.  We generally used the image as a color gradient, but try different patterns or smoothness of gradients for different results.
| {{ent|$COLORBAR}} || "" || Specifies a 1D Texture.  The resultant gray scale is used as a texture coordinate into this image to get the final color.  We generally used the image as a color gradient, but try different patterns or smoothness of gradients for different results.
|-
|-
| $SELFILLUMTINT || "[ 1.0 1.0 1.0 ]" || If self illumination is specified, this is the tint color for the self illumination.
| {{ent|$SELFILLUMTINT}} || "[ 1.0 1.0 1.0 ]" || If self illumination is specified, this is the tint color for the self illumination.
|}
|}


Optional Stripes
Optional Stripes
{| class=standard-table
{| class="standard-table"
| $STRIPETEXTURE || "" || The texture used to specify the stripe or any other pattern.  It uses standard alpha translucency to blend this texture.
! Shader !! Default Value !! Effect
|-
|-
| $STRIPE_SCALE || "[ 0.002 0.002 0.2 ]" || Specifies the x y z world scaling to compute the seamless texture coordinate of the stripe texture.
| {{ent|$STRIPETEXTURE}} || "" || The texture used to specify the stripe or any other pattern.  It uses standard alpha translucency to blend this texture.
|-
|-
| $STRIPE_COLOR || "[ 1.0 1.0 1.0 ]" || The color modulated against the strip texture’s RGB.  If you make your strip texture as gray scale, then you can have greater color control by using this field, as well as only needing one texture to create many colors.
| {{ent|$STRIPE_SCALE}} || "[ 0.002 0.002 0.2 ]" || Specifies the x y z world scaling to compute the seamless texture coordinate of the stripe texture.
|-
|-
| $STRIPE_LM_SCALE || 0.0 || Interpolates between the lighting intensity of the pixel to full bright based upon this value.
| {{ent|$STRIPE_COLOR}} || "[ 1.0 1.0 1.0 ]" || The color modulated against the strip texture’s RGB.  If you make your strip texture as gray scale, then you can have greater color control by using this field, as well as only needing one texture to create many colors.
 
|-
| {{ent|$STRIPE_LM_SCALE}} || 0.0 || Interpolates between the lighting intensity of the pixel to full bright based upon this value.


[[Category:Shaders]]
[[Category:Shaders]]

Revision as of 18:28, 11 November 2021

English (en)Translate (Translate)
Broom icon.png
This article or section needs to be cleaned up to conform to a higher standard of quality.
For help, see the VDC Editing Help and Wikipedia cleanup process. Also, remember to check for any notes left by the tagger at this article's talk page.

The pyro_vision shader is used in Pyro Vision in Template:Game name. It is used to replace the normal textures of a map with a simulation similar to the fantasy land shown in the animated short "Meet the Pyro".

pyro_vision computes the grayscale value of the diffuse color of the original texture and maps it using a special one dimensional texture. It can also project an overlay texture, usually stripes, uniformly in world space.

The Pyro vision shader has 4 effect modes controlled by $EFFECT

Value Effect
0 An R&D stage which is not finished.
1 Handles most of the world and model rendering in pyro land.
2 Depth of Field blending.
3 Pyro vignette drawing.


Standard Fields found in other shaders:

Shader Default Value Description
$BASETEXTURE "" Your diffuse texture.
$BASETEXTURE2 "" Second diffuse texture - For two way blends.
$BLENDMODULATETEXTURE "" Optional modulate texture - For two way blends.
$BLENDMASKTRANSFORM "center .5 .5 scale 1 1 rotate 0 translate 0 0" The transform parameters for blending.

General Fields:

$EFFECT 1 Used to specify the effect type.
$VERTEX_LIT 0 0 if light-map based, 1 if vertex-lit based.

Effect #1 Fields

Shader Default Value Effect.
$DIFFUSE_BASE 0.0 Value from 0.0 to 1.0 to blend the diffuse towards solid white.
$DIFFUSE_WHITE 0.0 Value from 0.0 to 1.0 to blend the light-map towards solid white.
$GRAY_POWER 1.0 Raises the gray scale result to this value.
$GRAY_STEP "[ 0.0 1.0 ]" Performs a smooth step between the two values supplied. Think of this as the min/max sliders on a histogram chart.
$LIGHTMAP_GRADIENTS 255.0 Downscale the result into this many categories. Value is clamped between 1.0 and 255.0.
Tip.pngTip:May provide some cartooning effects if you use low values.
$COLORBAR "" Specifies a 1D Texture. The resultant gray scale is used as a texture coordinate into this image to get the final color. We generally used the image as a color gradient, but try different patterns or smoothness of gradients for different results.
$SELFILLUMTINT "[ 1.0 1.0 1.0 ]" If self illumination is specified, this is the tint color for the self illumination.

Optional Stripes

Shader Default Value Effect
$STRIPETEXTURE "" The texture used to specify the stripe or any other pattern. It uses standard alpha translucency to blend this texture.
$STRIPE_SCALE "[ 0.002 0.002 0.2 ]" Specifies the x y z world scaling to compute the seamless texture coordinate of the stripe texture.
$STRIPE_COLOR "[ 1.0 1.0 1.0 ]" The color modulated against the strip texture’s RGB. If you make your strip texture as gray scale, then you can have greater color control by using this field, as well as only needing one texture to create many colors.
$STRIPE_LM_SCALE 0.0 Interpolates between the lighting intensity of the pixel to full bright based upon this value.