Teeth: Difference between revisions

From Valve Developer Community
Jump to navigation Jump to search
(Documentation of the Teeth shader)
 
(Changed to use shader and MatParam templates)
Line 1: Line 1:
<code>'''Teeth'''</code> is a special shader used specifically for the teeth in {{hl2}}[[Half-Life 2]]. It is used to dynamically adjust the brightness of the teeth based on how open the mouth is.
{{Shader|Teeth}} It is a shader for teeth that is used to dynamically adjust the brightness of the teeth based on how open the mouth is.
:{{Note|This shader is likey obsolete, as Valve hasn't used it for any of their recent games. Instead, they include teeth on their facemaps, using the shader <code>[[VertexLitGeneric]].</code>}}
:{{Note|This shader is likely obsolete, as Valve hasn't used it for any of their recent games. Instead, they include teeth on their facemaps, using the shader <code>[[VertexLitGeneric]].</code>}}
:{{Todo|Add an image showing the teeth.}}
:{{Todo|Add an image showing the teeth.}}


==Parameters==
==Parameters==
;<code>$basetexture <[[texture]]></code>
{{MatParam|[[$basetexture]]|texture|Texture for the teeth.}}
: Texture for the teeth.
{{MatParam|[[$halflambert]]|bool|Enables half-lambertian lighting. Default <code>1.</code>}}
;<code>[[$halflambert]] <[[bool]]></code>
: Enables half-lambertian lighting. Default <code>1.</code>
;<code>$clientshader "MouthShader"</code>
;<code>$clientshader "MouthShader"</code>
: {{Todo|What does this actually do?}}
: {{Todo|What does this actually do?}}
;<code>$illumfactor <[[float]]></code>
{{MatParam|$illumfactor|float|Modifies the amount the teeth are brightened or darkened by. Default <code>1</code>.}}
: Modifies the amount the teeth are brightened or darkened by. Default <code>1</code>.
{{MatParam|$forward|vector|Forward direction vector for teeth lighting. Default <code>"[1 0 0]"</code>.}}
;<code>$forward <[[vector]]></code>
{{MatParam|[[$bumpmap]]|texture|Bumpmap for the teeth. Enables phong specular, and uses the alpha channel of the bumpmap as a mask if present.|dx9=1}}
: Forward direction vector for teeth lighting. Default <code>"[1 0 0]"</code>.
{{MatParam|[[$phong|$phongexponent]]|float|Exponent for the specular. Overrides the bumpmap's alpha mask if one is present. Default <code>100</code>.|dx9=1}}
;<code>[[$bumpmap]] <texture></code> {{dx9}}
: Bumpmap for the teeth. Enables phong specular, and uses the alpha channel of the bumpmap as a mask if present.
;<code>[[$phong|$phongexponent]] <[[float]]></code> {{dx9}}
: Exponent for the specular. Overrides the bumpmap's alpha mask if one is present. Default <code>100</code>.
==Other parameters==
==Other parameters==
;<code>$intro <bool></code>
{{MatParam|$intro|bool|Teeth are used on a model in Episode 1's intro cutscene. Adds another shader pass.}}
: Teeth are used on a model in Episode 1's intro cutscene. Adds another shader pass.
{{MatParam|$warpparam|float|Requires <code>$intro 1</code>. How far into the warp animation we are.}}
;<code>$warpparam <float></code>
{{MatParam|$entityorigin|vector|Requires <code>$intro 1</code>. World-space location of the entity, required to correctly animate the warp.}}
: Requires <code>$intro 1</code>. How far into the warp animation we are.
;<code>$entityorigin <vector3></code>
: Requires <code>$intro 1</code>. World-space location of the entity, required to correctly animate the warp.
 
[[Category:Shaders|T]]

Revision as of 17:16, 6 June 2019

Shader-ball.png Teeth It is a shader for teeth that is used to dynamically adjust the brightness of the teeth based on how open the mouth is.

Note.pngNote:This shader is likely obsolete, as Valve hasn't used it for any of their recent games. Instead, they include teeth on their facemaps, using the shader VertexLitGeneric.
Todo: Add an image showing the teeth.

Parameters

[[$basetexture|$basetexture]] [[$halflambert|$halflambert]]

$clientshader "MouthShader"
Todo: What does this actually do?

$illumfactor $forward [[$bumpmap|$bumpmap]] [[$phongexponent|$phongexponent]]

Other parameters

$intro $warpparam $entityorigin