diff options
| author | Joe Ludwig <[email protected]> | 2013-12-23 14:58:45 -0800 |
|---|---|---|
| committer | Joe Ludwig <[email protected]> | 2013-12-23 15:00:03 -0800 |
| commit | 7309a5f13f63fdcc7b1e090f6c176113a9d95061 (patch) | |
| tree | ad65c7fbe46a3c70bdc0a1426e88247ce1b0d7f5 /mp/src/materialsystem/stdshaders/Teeth.vsh | |
| parent | Merge pull request #182 from ardneran/master (diff) | |
| download | source-sdk-2013-7309a5f13f63fdcc7b1e090f6c176113a9d95061.tar.xz source-sdk-2013-7309a5f13f63fdcc7b1e090f6c176113a9d95061.zip | |
Added many shader source files
This should include the latest version of every shader that was in the
2007 SDK. It also includes a smattering of debug shaders, both VR
distortion shaders, and other assorted shaders that will hopefully be
useful.
None of these new files are included in the game shader DLL project. If
you need to modify one of these shaders for use in your mod you will
need to rename it so that you don't collide with the version of that
shader that lives in stdshader_dx9.dll.
Diffstat (limited to 'mp/src/materialsystem/stdshaders/Teeth.vsh')
| -rw-r--r-- | mp/src/materialsystem/stdshaders/Teeth.vsh | 97 |
1 files changed, 97 insertions, 0 deletions
diff --git a/mp/src/materialsystem/stdshaders/Teeth.vsh b/mp/src/materialsystem/stdshaders/Teeth.vsh new file mode 100644 index 00000000..065f0703 --- /dev/null +++ b/mp/src/materialsystem/stdshaders/Teeth.vsh @@ -0,0 +1,97 @@ +vs.1.1 + +# STATIC: "INTRO" "0..1" +# STATIC: "HALF_LAMBERT" "0..1" +# DYNAMIC: "DOWATERFOG" "0..1" +# DYNAMIC: "LIGHT_COMBO" "0..21" +# DYNAMIC: "SKINNING" "0..1" + +;------------------------------------------------------------------------------ +; $SHADER_SPECIFIC_CONST_0 = xyz = mouth forward direction vector, w = illum factor +;------------------------------------------------------------------------------ + +#include "macros.vsh" + +$WARPPARAM = $SHADER_SPECIFIC_CONST_2; +$ENTITY_ORIGIN = $SHADER_SPECIFIC_CONST_3; + +;------------------------------------------------------------------------------ +; Vertex blending +;------------------------------------------------------------------------------ +alloc $worldPos +alloc $worldNormal +&SkinPositionAndNormal( $worldPos, $worldNormal ); + +;------------------------------------------------------------------------------ +; Optional intro warping +;------------------------------------------------------------------------------ +if ( $INTRO == 1 ) +{ + alloc $tmp + sub $tmp.xyz, $worldPos, $ENTITY_ORIGIN + mul $tmp.xy, $tmp, $WARPPARAM + add $worldPos.xyz, $tmp, $ENTITY_ORIGIN + free $tmp +} + +;------------------------------------------------------------------------------ +; Transform the position from world to view space +;------------------------------------------------------------------------------ + +alloc $projPos + +dp4 $projPos.x, $worldPos, $cViewProj0 +dp4 $projPos.y, $worldPos, $cViewProj1 +dp4 $projPos.z, $worldPos, $cViewProj2 +dp4 $projPos.w, $worldPos, $cViewProj3 +mov oPos, $projPos + +;------------------------------------------------------------------------------ +; Fog +;------------------------------------------------------------------------------ + +&CalcFog( $worldPos, $projPos ); + +free $projPos + +;------------------------------------------------------------------------------ +; Lighting +;------------------------------------------------------------------------------ +alloc $linearColor +&DoDynamicLightingToLinear( $worldPos, $worldNormal, $linearColor ); + +;------------------------------------------------------------------------------ +; Factor in teeth darkening factors +;------------------------------------------------------------------------------ + +alloc $tmp + +mul $linearColor.xyz, $SHADER_SPECIFIC_CONST_0.w, $linearColor ; FIXME Color darkened by illumination factor +dp3 $tmp, $worldNormal, $SHADER_SPECIFIC_CONST_0 ; Figure out mouth forward dot normal +max $tmp, $cZero, $tmp ; clamp from 0 to 1 +mul $linearColor.xyz, $tmp, $linearColor ; Darken by forward dot normal too + +;------------------------------------------------------------------------------ +; Output color (gamma correction) +;------------------------------------------------------------------------------ + +alloc $gammaColor +&LinearToGamma( $linearColor, $gammaColor ); +free $linearColor +mul oD0.xyz, $gammaColor.xyz, $cOverbrightFactor +mov oD0.w, $cOne ; make sure all components are defined + + +free $gammaColor +free $worldPos +free $worldNormal +free $tmp + +;------------------------------------------------------------------------------ +; Texture coordinates +;------------------------------------------------------------------------------ + +mov oT0, $vTexCoord0 + + + |