aboutsummaryrefslogtreecommitdiff
path: root/mp/src/materialsystem/stdshaders/sprite_vs20.fxc
diff options
context:
space:
mode:
authorJoe Ludwig <[email protected]>2013-12-23 14:58:45 -0800
committerJoe Ludwig <[email protected]>2013-12-23 15:00:03 -0800
commit7309a5f13f63fdcc7b1e090f6c176113a9d95061 (patch)
treead65c7fbe46a3c70bdc0a1426e88247ce1b0d7f5 /mp/src/materialsystem/stdshaders/sprite_vs20.fxc
parentMerge pull request #182 from ardneran/master (diff)
downloadsource-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/sprite_vs20.fxc')
-rw-r--r--mp/src/materialsystem/stdshaders/sprite_vs20.fxc65
1 files changed, 65 insertions, 0 deletions
diff --git a/mp/src/materialsystem/stdshaders/sprite_vs20.fxc b/mp/src/materialsystem/stdshaders/sprite_vs20.fxc
new file mode 100644
index 00000000..5e427c19
--- /dev/null
+++ b/mp/src/materialsystem/stdshaders/sprite_vs20.fxc
@@ -0,0 +1,65 @@
+// STATIC: "VERTEXCOLOR" "0..1"
+// STATIC: "SRGB" "0..1"
+// DYNAMIC: "DOWATERFOG" "0..1"
+
+#include "common_vs_fxc.h"
+
+static const int g_FogType = DOWATERFOG;
+static const bool g_bVertexColor = VERTEXCOLOR ? true : false;
+
+struct VS_INPUT
+{
+ // This is all of the stuff that we ever use.
+ float4 vPos : POSITION;
+ float4 vColor : COLOR0;
+ // make these float2's and stick the [n n 0 1] in the dot math.
+ float4 vTexCoord0 : TEXCOORD0;
+};
+
+struct VS_OUTPUT
+{
+ float4 projPos : POSITION; // Projection-space position
+#if !defined( _X360 )
+ float fog : FOG;
+#endif
+ HALF2 baseTexCoord : TEXCOORD0; // Base texture coordinate
+ float4 color : TEXCOORD2; // Vertex color (from lighting or unlit)
+
+ float4 worldPos_projPosZ : TEXCOORD7; // Necessary for pixel fog
+};
+
+
+VS_OUTPUT main( const VS_INPUT v )
+{
+ VS_OUTPUT o = ( VS_OUTPUT )0;
+
+ float3 worldPos;
+ worldPos = mul4x3( v.vPos, cModel[0] );
+
+ // Transform into projection space
+ float4 projPos = mul( float4( worldPos, 1 ), cViewProj );
+ o.projPos = projPos;
+ projPos.z = dot( float4( worldPos, 1 ), cViewProjZ );
+
+ o.worldPos_projPosZ = float4( worldPos.xyz, projPos.z );
+
+#if !defined( _X360 )
+ o.fog = CalcFog( worldPos, projPos, g_FogType );
+#endif
+ if ( g_bVertexColor )
+ {
+ // Assume that this is unlitgeneric if you are using vertex color.
+#if SRGB
+ o.color.rgba = GammaToLinear( v.vColor.rgba );
+#else
+ o.color.rgba = v.vColor.rgba;
+#endif
+ }
+
+ // Base texture coordinates
+ o.baseTexCoord.xy = v.vTexCoord0.xy;
+
+ return o;
+}
+
+