Files
sourcearena/mp/src/materialsystem/stdshaders/cloud_vs20.fxc
Joe Ludwig 7309a5f13f 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.
2013-12-23 15:00:03 -08:00

38 lines
1.0 KiB
Plaintext

#include "common_vs_fxc.h"
const float4 g_matBaseTexCoordTransform[2] : register( SHADER_SPECIFIC_CONST_0 );
const float4 g_matCloudTexCoordTransform[2] : register( SHADER_SPECIFIC_CONST_2 );
struct VS_INPUT
{
float4 vPos : POSITION;
float4 vTexCoord0 : TEXCOORD0;
float4 vTexCoord1 : TEXCOORD1;
};
struct VS_OUTPUT
{
float4 projPos : POSITION;
float2 baseCoords : TEXCOORD0;
float2 cloudAlphaCoords : TEXCOORD1;
float fogFactor : TEXCOORD2;
};
VS_OUTPUT main( const VS_INPUT v )
{
VS_OUTPUT o;
o.projPos = mul( v.vPos, cModelViewProj );
// Compute fog based on the position
float3 vWorldPos = mul( v.vPos, cModel[0] );
o.fogFactor = CalcFog( vWorldPos, o.projPos, FOGTYPE_RANGE );
// Texture coordinate transforms
o.baseCoords.x = dot( v.vTexCoord0.xyzw, g_matBaseTexCoordTransform[0] );
o.baseCoords.y = dot( v.vTexCoord0.xyzw, g_matBaseTexCoordTransform[1] );
o.cloudAlphaCoords.x = dot( v.vTexCoord1.xyzw, g_matCloudTexCoordTransform[0] );
o.cloudAlphaCoords.y = dot( v.vTexCoord1.xyzw, g_matCloudTexCoordTransform[1] );
return o;
}