aboutsummaryrefslogtreecommitdiff
path: root/sp/src/materialsystem/stdshaders/cable_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 /sp/src/materialsystem/stdshaders/cable_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 'sp/src/materialsystem/stdshaders/cable_vs20.fxc')
-rw-r--r--sp/src/materialsystem/stdshaders/cable_vs20.fxc80
1 files changed, 80 insertions, 0 deletions
diff --git a/sp/src/materialsystem/stdshaders/cable_vs20.fxc b/sp/src/materialsystem/stdshaders/cable_vs20.fxc
new file mode 100644
index 00000000..adb3559e
--- /dev/null
+++ b/sp/src/materialsystem/stdshaders/cable_vs20.fxc
@@ -0,0 +1,80 @@
+// DYNAMIC: "DOWATERFOG" "0..1"
+
+#include "common_vs_fxc.h"
+
+static const int g_FogType = DOWATERFOG;
+
+struct VS_INPUT
+{
+ float4 vPos : POSITION;
+ float2 vTexCoord0 : TEXCOORD0;
+ float2 vTexCoord1 : TEXCOORD1;
+
+ float4 directionalLightColor : COLOR0;
+
+ float3 vTangentS : TANGENT;
+ float3 vTangentT : BINORMAL;
+};
+
+struct VS_OUTPUT
+{
+ float4 vProjPos : POSITION;
+ float2 vTexCoord0 : TEXCOORD0;
+ float2 vTexCoord1 : TEXCOORD1;
+
+ float4 worldPos_projPosZ : TEXCOORD7; // Necessary for pixel fog
+
+ float4 directionalLightColor : COLOR0;
+
+ float4 fogFactorW : COLOR1;
+
+#if !defined( _X360 )
+ float fog : FOG;
+#endif
+};
+
+
+VS_OUTPUT main( const VS_INPUT v )
+{
+ VS_OUTPUT o = ( VS_OUTPUT )0;
+
+ float3 worldPos;
+ worldPos = mul( v.vPos, cModel[0] );
+ float4 vProjPos = mul( float4( worldPos, 1 ), cViewProj );
+ o.vProjPos = vProjPos;
+ vProjPos.z = dot( float4( worldPos, 1 ), cViewProjZ );
+
+ o.worldPos_projPosZ = float4( worldPos.xyz, vProjPos.z );
+
+ o.fogFactorW = CalcFog( worldPos, vProjPos, g_FogType );
+#if !defined( _X360 )
+ o.fog = o.fogFactorW;
+#endif
+
+ //------------------------------------------------------------------------------
+ // Setup the tangent space
+ //------------------------------------------------------------------------------
+
+ // Get S crossed with T (call it R)
+ float3 r = cross( v.vTangentS, v.vTangentT );
+
+ // Normalize S (into s)
+ float3 s = normalize( v.vTangentS );
+
+ // Normalize R (into r)
+ r = normalize( r );
+
+ // Regenerate T (into t)
+ float3 t = cross( r, v.vTangentS );
+
+ //------------------------------------------------------------------------------
+ // Copy texcoords for the normal map and base texture
+ //------------------------------------------------------------------------------
+ o.vTexCoord0 = v.vTexCoord0;
+ o.vTexCoord1 = v.vTexCoord1;
+
+ // Pass the dirlight color through
+ o.directionalLightColor = v.directionalLightColor;
+
+ return o;
+} \ No newline at end of file