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/LightmappedGeneric_Decal.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/LightmappedGeneric_Decal.vsh')
| -rw-r--r-- | mp/src/materialsystem/stdshaders/LightmappedGeneric_Decal.vsh | 56 |
1 files changed, 56 insertions, 0 deletions
diff --git a/mp/src/materialsystem/stdshaders/LightmappedGeneric_Decal.vsh b/mp/src/materialsystem/stdshaders/LightmappedGeneric_Decal.vsh new file mode 100644 index 00000000..a9db9faa --- /dev/null +++ b/mp/src/materialsystem/stdshaders/LightmappedGeneric_Decal.vsh @@ -0,0 +1,56 @@ +vs.1.1 + +# DYNAMIC: "DOWATERFOG" "0..1" + +#include "macros.vsh" + +;------------------------------------------------------------------------------ +; Vertex blending +;------------------------------------------------------------------------------ + +&AllocateRegister( \$projPos ); + +; Transform position from object to projection space +dp4 $projPos.x, $vPos, $cModelViewProj0 +dp4 $projPos.y, $vPos, $cModelViewProj1 +dp4 $projPos.z, $vPos, $cModelViewProj2 +dp4 $projPos.w, $vPos, $cModelViewProj3 + +mov oPos, $projPos + +;------------------------------------------------------------------------------ +; Fog +;------------------------------------------------------------------------------ + +alloc $worldPos +if( $DOWATERFOG == 1 ) +{ + ; Get the worldpos z component only since that's all we need for height fog + dp4 $worldPos.z, $vPos, $cModel2 +} +&CalcFog( $worldPos, $projPos ); +free $worldPos + +&FreeRegister( \$projPos ); + +;------------------------------------------------------------------------------ +; Texture coordinates +;------------------------------------------------------------------------------ + +; Compute the texture coordinates given the offset between +; each bumped lightmap +&AllocateRegister( \$offset ); +mov $offset.x, $vTexCoord2.x +mov $offset.y, $cZero +dp4 oT0.x, $vTexCoord0, $SHADER_SPECIFIC_CONST_0 +dp4 oT0.y, $vTexCoord0, $SHADER_SPECIFIC_CONST_1 +add oT1.xy, $offset, $vTexCoord1 +mad oT2.xy, $offset, $cTwo, $vTexCoord1 +; make a 3 +alloc $three +add $three, $cOne, $cTwo +mad oT3.xy, $offset, $three, $vTexCoord1 +free $three +mov oD0, $vColor + +&FreeRegister( \$offset ); |