summaryrefslogtreecommitdiff
path: root/src/d3d/shaders
diff options
context:
space:
mode:
Diffstat (limited to 'src/d3d/shaders')
-rw-r--r--src/d3d/shaders/default_PS.h72
-rw-r--r--src/d3d/shaders/default_PS.hlsl19
-rw-r--r--src/d3d/shaders/default_VS.hlsl51
-rw-r--r--src/d3d/shaders/default_all_VS.h491
-rw-r--r--src/d3d/shaders/default_amb_VS.h156
-rw-r--r--src/d3d/shaders/default_amb_dir_VS.h272
-rw-r--r--src/d3d/shaders/default_tex_PS.h89
-rw-r--r--src/d3d/shaders/im2d_PS.h72
-rw-r--r--src/d3d/shaders/im2d_PS.hlsl19
-rw-r--r--src/d3d/shaders/im2d_VS.h107
-rw-r--r--src/d3d/shaders/im2d_VS.hlsl30
-rw-r--r--src/d3d/shaders/im2d_tex_PS.h89
-rw-r--r--src/d3d/shaders/lighting.h44
-rw-r--r--src/d3d/shaders/make_default.cmd11
-rw-r--r--src/d3d/shaders/make_matfx.cmd7
-rw-r--r--src/d3d/shaders/make_skin.cmd4
-rw-r--r--src/d3d/shaders/matfx_env_PS.h124
-rw-r--r--src/d3d/shaders/matfx_env_PS.hlsl42
-rw-r--r--src/d3d/shaders/matfx_env_VS.hlsl59
-rw-r--r--src/d3d/shaders/matfx_env_all_VS.h535
-rw-r--r--src/d3d/shaders/matfx_env_amb_VS.h225
-rw-r--r--src/d3d/shaders/matfx_env_amb_dir_VS.h316
-rw-r--r--src/d3d/shaders/matfx_env_tex_PS.h141
-rw-r--r--src/d3d/shaders/skin_VS.hlsl63
-rw-r--r--src/d3d/shaders/skin_all_VS.h664
-rw-r--r--src/d3d/shaders/skin_amb_VS.h253
-rw-r--r--src/d3d/shaders/skin_amb_dir_VS.h503
-rw-r--r--src/d3d/shaders/standardConstants.h28
28 files changed, 4486 insertions, 0 deletions
diff --git a/src/d3d/shaders/default_PS.h b/src/d3d/shaders/default_PS.h
new file mode 100644
index 0000000..9f2cb31
--- /dev/null
+++ b/src/d3d/shaders/default_PS.h
@@ -0,0 +1,72 @@
+#if 0
+//
+// Generated by Microsoft (R) HLSL Shader Compiler 9.29.952.3111
+//
+// fxc /nologo /T ps_2_0 /Fh default_PS.h default_PS.hlsl
+//
+//
+// Parameters:
+//
+// float4 fogColor;
+//
+//
+// Registers:
+//
+// Name Reg Size
+// ------------ ----- ----
+// fogColor c0 1
+//
+
+ ps_2_0
+ dcl t0.xyz
+ dcl v0
+ add r0.xyz, v0, -c0
+ mad r0.xyz, t0.z, r0, c0
+ mov r0.w, v0.w
+ mov oC0, r0
+
+// approximately 4 instruction slots used
+#endif
+
+const BYTE g_ps20_main[] =
+{
+ 0, 2, 255, 255, 254, 255,
+ 34, 0, 67, 84, 65, 66,
+ 28, 0, 0, 0, 83, 0,
+ 0, 0, 0, 2, 255, 255,
+ 1, 0, 0, 0, 28, 0,
+ 0, 0, 0, 1, 0, 0,
+ 76, 0, 0, 0, 48, 0,
+ 0, 0, 2, 0, 0, 0,
+ 1, 0, 2, 0, 60, 0,
+ 0, 0, 0, 0, 0, 0,
+ 102, 111, 103, 67, 111, 108,
+ 111, 114, 0, 171, 171, 171,
+ 1, 0, 3, 0, 1, 0,
+ 4, 0, 1, 0, 0, 0,
+ 0, 0, 0, 0, 112, 115,
+ 95, 50, 95, 48, 0, 77,
+ 105, 99, 114, 111, 115, 111,
+ 102, 116, 32, 40, 82, 41,
+ 32, 72, 76, 83, 76, 32,
+ 83, 104, 97, 100, 101, 114,
+ 32, 67, 111, 109, 112, 105,
+ 108, 101, 114, 32, 57, 46,
+ 50, 57, 46, 57, 53, 50,
+ 46, 51, 49, 49, 49, 0,
+ 31, 0, 0, 2, 0, 0,
+ 0, 128, 0, 0, 7, 176,
+ 31, 0, 0, 2, 0, 0,
+ 0, 128, 0, 0, 15, 144,
+ 2, 0, 0, 3, 0, 0,
+ 7, 128, 0, 0, 228, 144,
+ 0, 0, 228, 161, 4, 0,
+ 0, 4, 0, 0, 7, 128,
+ 0, 0, 170, 176, 0, 0,
+ 228, 128, 0, 0, 228, 160,
+ 1, 0, 0, 2, 0, 0,
+ 8, 128, 0, 0, 255, 144,
+ 1, 0, 0, 2, 0, 8,
+ 15, 128, 0, 0, 228, 128,
+ 255, 255, 0, 0
+};
diff --git a/src/d3d/shaders/default_PS.hlsl b/src/d3d/shaders/default_PS.hlsl
new file mode 100644
index 0000000..eaf279d
--- /dev/null
+++ b/src/d3d/shaders/default_PS.hlsl
@@ -0,0 +1,19 @@
+struct VS_out {
+ float4 Position : POSITION;
+ float3 TexCoord0 : TEXCOORD0;
+ float4 Color : COLOR0;
+};
+
+sampler2D tex0 : register(s0);
+
+float4 fogColor : register(c0);
+
+float4 main(VS_out input) : COLOR
+{
+ float4 color = input.Color;
+#ifdef TEX
+ color *= tex2D(tex0, input.TexCoord0.xy);
+#endif
+ color.rgb = lerp(fogColor.rgb, color.rgb, input.TexCoord0.z);
+ return color;
+}
diff --git a/src/d3d/shaders/default_VS.hlsl b/src/d3d/shaders/default_VS.hlsl
new file mode 100644
index 0000000..d2f5452
--- /dev/null
+++ b/src/d3d/shaders/default_VS.hlsl
@@ -0,0 +1,51 @@
+#include "standardConstants.h"
+
+struct VS_in
+{
+ float4 Position : POSITION;
+ float3 Normal : NORMAL;
+ float2 TexCoord : TEXCOORD0;
+ float4 Prelight : COLOR0;
+};
+
+struct VS_out {
+ float4 Position : POSITION;
+ float3 TexCoord0 : TEXCOORD0; // also fog
+ float4 Color : COLOR0;
+};
+
+
+VS_out main(in VS_in input)
+{
+ VS_out output;
+
+ output.Position = mul(combinedMat, input.Position);
+ float3 Vertex = mul(worldMat, input.Position).xyz;
+ float3 Normal = mul(normalMat, input.Normal);
+
+ output.TexCoord0.xy = input.TexCoord;
+
+ output.Color = input.Prelight;
+ output.Color.rgb += ambientLight.rgb * surfAmbient;
+
+ int i;
+#ifdef DIRECTIONALS
+ for(i = 0; i < numDirLights; i++)
+ output.Color.xyz += DoDirLight(lights[i+firstDirLight], Normal)*surfDiffuse;
+#endif
+#ifdef POINTLIGHTS
+ for(i = 0; i < numPointLights; i++)
+ output.Color.xyz += DoPointLight(lights[i+firstPointLight], Vertex.xyz, Normal)*surfDiffuse;
+#endif
+#ifdef SPOTLIGHTS
+ for(i = 0; i < numSpotLights; i++)
+ output.Color.xyz += DoSpotLight(lights[i+firstSpotLight], Vertex.xyz, Normal)*surfDiffuse;
+#endif
+ // PS2 clamps before material color
+ output.Color = clamp(output.Color, 0.0, 1.0);
+ output.Color *= matCol;
+
+ output.TexCoord0.z = clamp((output.Position.w - fogEnd)*fogRange, fogDisable, 1.0);
+
+ return output;
+}
diff --git a/src/d3d/shaders/default_all_VS.h b/src/d3d/shaders/default_all_VS.h
new file mode 100644
index 0000000..e6afa5d
--- /dev/null
+++ b/src/d3d/shaders/default_all_VS.h
@@ -0,0 +1,491 @@
+#if 0
+//
+// Generated by Microsoft (R) HLSL Shader Compiler 9.29.952.3111
+//
+// fxc /nologo /T vs_2_0 /DDIRECTIONALS /DPOINTLIGHTS /DSPOTLIGHTS /Fh
+// default_all_VS.h default_VS.hlsl
+//
+//
+// Parameters:
+//
+// float4 ambientLight;
+// float4x4 combinedMat;
+// int4 firstLight;
+// float4 fogData;
+//
+// struct
+// {
+// float4 color;
+// float4 position;
+// float4 direction;
+//
+// } lights[8];
+//
+// float4 matCol;
+// float3x3 normalMat;
+// int numDirLights;
+// int numPointLights;
+// int numSpotLights;
+// float4 surfProps;
+// float4x4 worldMat;
+//
+//
+// Registers:
+//
+// Name Reg Size
+// -------------- ----- ----
+// numDirLights i0 1
+// numPointLights i1 1
+// numSpotLights i2 1
+// combinedMat c0 4
+// worldMat c4 4
+// normalMat c8 3
+// matCol c12 1
+// surfProps c13 1
+// fogData c14 1
+// ambientLight c15 1
+// firstLight c16 1
+// lights c17 24
+//
+
+ vs_2_0
+ def c11, 0, 3, 1, 0
+ dcl_position v0
+ dcl_normal v1
+ dcl_texcoord v2
+ dcl_color v3
+ mul r0, v0.y, c1
+ mad r0, c0, v0.x, r0
+ mad r0, c2, v0.z, r0
+ mad r0, c3, v0.w, r0
+ mov oPos, r0
+ mul r0.xyz, v0.y, c5
+ mad r0.xyz, c4, v0.x, r0
+ mad r0.xyz, c6, v0.z, r0
+ mad r0.xyz, c7, v0.w, r0
+ mul r1.xyz, v1.y, c9
+ mad r1.xyz, c8, v1.x, r1
+ mad r1.xyz, c10, v1.z, r1
+ mov r2.x, c13.x
+ mad r2.xyz, c15, r2.x, v3
+ mov r3.xyz, r2
+ mov r1.w, c11.x
+ rep i0
+ add r2.w, r1.w, c16.x
+ mul r2.w, r2.w, c11.y
+ mova a0.x, r2.w
+ dp3 r2.w, r1, -c19[a0.x]
+ max r2.w, r2.w, c11.x
+ mul r4.xyz, r2.w, c17[a0.x]
+ mad r3.xyz, r4, c13.z, r3
+ add r1.w, r1.w, c11.z
+ endrep
+ mov r2.xyz, r3
+ mov r1.w, c11.x
+ rep i1
+ add r2.w, r1.w, c16.y
+ mul r2.w, r2.w, c11.y
+ mova a0.x, r2.w
+ add r4.xyz, r0, -c18[a0.x]
+ dp3 r2.w, r4, r4
+ rsq r2.w, r2.w
+ mul r4.xyz, r2.w, r4
+ dp3 r3.w, r1, -r4
+ max r3.w, r3.w, c11.x
+ mul r4.xyz, r3.w, c17[a0.x]
+ rcp r2.w, r2.w
+ rcp r3.w, c17[a0.x].w
+ mad r2.w, r2.w, -r3.w, c11.z
+ max r2.w, r2.w, c11.x
+ mul r4.xyz, r2.w, r4
+ mad r2.xyz, r4, c13.z, r2
+ add r1.w, r1.w, c11.z
+ endrep
+ mov r3.xyz, r2
+ mov r1.w, c11.x
+ rep i2
+ add r2.w, r1.w, c16.z
+ mul r2.w, r2.w, c11.y
+ mova a0.x, r2.w
+ add r4.xyz, r0, -c18[a0.x]
+ dp3 r2.w, r4, r4
+ rsq r2.w, r2.w
+ mul r4.xyz, r2.w, r4
+ dp3 r4.w, r1, -r4
+ dp3 r4.x, r4, c19[a0.x]
+ max r4.y, r4.w, c11.x
+ mov r4.z, c11.z
+ add r4.xz, r4, c18[a0.x].w
+ rcp r4.z, r4.z
+ mul r4.x, r4.z, r4.x
+ slt r4.z, r4.x, c11.x
+ mad r4.y, r4.z, -r4.y, r4.y
+ max r4.x, r4.x, c19[a0.x].w
+ mul r4.x, r4.x, r4.y
+ mul r4.xyz, r4.x, c17[a0.x]
+ rcp r2.w, r2.w
+ rcp r4.w, c17[a0.x].w
+ mad r2.w, r2.w, -r4.w, c11.z
+ max r2.w, r2.w, c11.x
+ mul r4.xyz, r2.w, r4
+ mad r3.xyz, r4, c13.z, r3
+ add r1.w, r1.w, c11.z
+ endrep
+ mov r3.w, v3.w
+ max r1, r3, c11.x
+ min r1, r1, c11.z
+ mul oD0, r1, c12
+ add r0.x, r0.w, -c14.y
+ mul r0.x, r0.x, c14.z
+ max r0.x, r0.x, c14.w
+ min oT0.z, r0.x, c11.z
+ mov oT0.xy, v2
+
+// approximately 95 instruction slots used
+#endif
+
+const BYTE g_vs20_main[] =
+{
+ 0, 2, 254, 255, 254, 255,
+ 158, 0, 67, 84, 65, 66,
+ 28, 0, 0, 0, 67, 2,
+ 0, 0, 0, 2, 254, 255,
+ 12, 0, 0, 0, 28, 0,
+ 0, 0, 0, 1, 0, 0,
+ 60, 2, 0, 0, 12, 1,
+ 0, 0, 2, 0, 15, 0,
+ 1, 0, 62, 0, 28, 1,
+ 0, 0, 0, 0, 0, 0,
+ 44, 1, 0, 0, 2, 0,
+ 0, 0, 4, 0, 2, 0,
+ 56, 1, 0, 0, 0, 0,
+ 0, 0, 72, 1, 0, 0,
+ 2, 0, 16, 0, 1, 0,
+ 66, 0, 84, 1, 0, 0,
+ 0, 0, 0, 0, 100, 1,
+ 0, 0, 2, 0, 14, 0,
+ 1, 0, 58, 0, 28, 1,
+ 0, 0, 0, 0, 0, 0,
+ 108, 1, 0, 0, 2, 0,
+ 17, 0, 24, 0, 70, 0,
+ 184, 1, 0, 0, 0, 0,
+ 0, 0, 200, 1, 0, 0,
+ 2, 0, 12, 0, 1, 0,
+ 50, 0, 28, 1, 0, 0,
+ 0, 0, 0, 0, 207, 1,
+ 0, 0, 2, 0, 8, 0,
+ 3, 0, 34, 0, 220, 1,
+ 0, 0, 0, 0, 0, 0,
+ 236, 1, 0, 0, 1, 0,
+ 0, 0, 1, 0, 2, 0,
+ 252, 1, 0, 0, 0, 0,
+ 0, 0, 12, 2, 0, 0,
+ 1, 0, 1, 0, 1, 0,
+ 6, 0, 252, 1, 0, 0,
+ 0, 0, 0, 0, 27, 2,
+ 0, 0, 1, 0, 2, 0,
+ 1, 0, 10, 0, 252, 1,
+ 0, 0, 0, 0, 0, 0,
+ 41, 2, 0, 0, 2, 0,
+ 13, 0, 1, 0, 54, 0,
+ 28, 1, 0, 0, 0, 0,
+ 0, 0, 51, 2, 0, 0,
+ 2, 0, 4, 0, 4, 0,
+ 18, 0, 56, 1, 0, 0,
+ 0, 0, 0, 0, 97, 109,
+ 98, 105, 101, 110, 116, 76,
+ 105, 103, 104, 116, 0, 171,
+ 171, 171, 1, 0, 3, 0,
+ 1, 0, 4, 0, 1, 0,
+ 0, 0, 0, 0, 0, 0,
+ 99, 111, 109, 98, 105, 110,
+ 101, 100, 77, 97, 116, 0,
+ 3, 0, 3, 0, 4, 0,
+ 4, 0, 1, 0, 0, 0,
+ 0, 0, 0, 0, 102, 105,
+ 114, 115, 116, 76, 105, 103,
+ 104, 116, 0, 171, 1, 0,
+ 2, 0, 1, 0, 4, 0,
+ 1, 0, 0, 0, 0, 0,
+ 0, 0, 102, 111, 103, 68,
+ 97, 116, 97, 0, 108, 105,
+ 103, 104, 116, 115, 0, 99,
+ 111, 108, 111, 114, 0, 171,
+ 171, 171, 1, 0, 3, 0,
+ 1, 0, 4, 0, 1, 0,
+ 0, 0, 0, 0, 0, 0,
+ 112, 111, 115, 105, 116, 105,
+ 111, 110, 0, 100, 105, 114,
+ 101, 99, 116, 105, 111, 110,
+ 0, 171, 115, 1, 0, 0,
+ 124, 1, 0, 0, 140, 1,
+ 0, 0, 124, 1, 0, 0,
+ 149, 1, 0, 0, 124, 1,
+ 0, 0, 5, 0, 0, 0,
+ 1, 0, 12, 0, 8, 0,
+ 3, 0, 160, 1, 0, 0,
+ 109, 97, 116, 67, 111, 108,
+ 0, 110, 111, 114, 109, 97,
+ 108, 77, 97, 116, 0, 171,
+ 171, 171, 3, 0, 3, 0,
+ 3, 0, 3, 0, 1, 0,
+ 0, 0, 0, 0, 0, 0,
+ 110, 117, 109, 68, 105, 114,
+ 76, 105, 103, 104, 116, 115,
+ 0, 171, 171, 171, 0, 0,
+ 2, 0, 1, 0, 1, 0,
+ 1, 0, 0, 0, 0, 0,
+ 0, 0, 110, 117, 109, 80,
+ 111, 105, 110, 116, 76, 105,
+ 103, 104, 116, 115, 0, 110,
+ 117, 109, 83, 112, 111, 116,
+ 76, 105, 103, 104, 116, 115,
+ 0, 115, 117, 114, 102, 80,
+ 114, 111, 112, 115, 0, 119,
+ 111, 114, 108, 100, 77, 97,
+ 116, 0, 118, 115, 95, 50,
+ 95, 48, 0, 77, 105, 99,
+ 114, 111, 115, 111, 102, 116,
+ 32, 40, 82, 41, 32, 72,
+ 76, 83, 76, 32, 83, 104,
+ 97, 100, 101, 114, 32, 67,
+ 111, 109, 112, 105, 108, 101,
+ 114, 32, 57, 46, 50, 57,
+ 46, 57, 53, 50, 46, 51,
+ 49, 49, 49, 0, 81, 0,
+ 0, 5, 11, 0, 15, 160,
+ 0, 0, 0, 0, 0, 0,
+ 64, 64, 0, 0, 128, 63,
+ 0, 0, 0, 0, 31, 0,
+ 0, 2, 0, 0, 0, 128,
+ 0, 0, 15, 144, 31, 0,
+ 0, 2, 3, 0, 0, 128,
+ 1, 0, 15, 144, 31, 0,
+ 0, 2, 5, 0, 0, 128,
+ 2, 0, 15, 144, 31, 0,
+ 0, 2, 10, 0, 0, 128,
+ 3, 0, 15, 144, 5, 0,
+ 0, 3, 0, 0, 15, 128,
+ 0, 0, 85, 144, 1, 0,
+ 228, 160, 4, 0, 0, 4,
+ 0, 0, 15, 128, 0, 0,
+ 228, 160, 0, 0, 0, 144,
+ 0, 0, 228, 128, 4, 0,
+ 0, 4, 0, 0, 15, 128,
+ 2, 0, 228, 160, 0, 0,
+ 170, 144, 0, 0, 228, 128,
+ 4, 0, 0, 4, 0, 0,
+ 15, 128, 3, 0, 228, 160,
+ 0, 0, 255, 144, 0, 0,
+ 228, 128, 1, 0, 0, 2,
+ 0, 0, 15, 192, 0, 0,
+ 228, 128, 5, 0, 0, 3,
+ 0, 0, 7, 128, 0, 0,
+ 85, 144, 5, 0, 228, 160,
+ 4, 0, 0, 4, 0, 0,
+ 7, 128, 4, 0, 228, 160,
+ 0, 0, 0, 144, 0, 0,
+ 228, 128, 4, 0, 0, 4,
+ 0, 0, 7, 128, 6, 0,
+ 228, 160, 0, 0, 170, 144,
+ 0, 0, 228, 128, 4, 0,
+ 0, 4, 0, 0, 7, 128,
+ 7, 0, 228, 160, 0, 0,
+ 255, 144, 0, 0, 228, 128,
+ 5, 0, 0, 3, 1, 0,
+ 7, 128, 1, 0, 85, 144,
+ 9, 0, 228, 160, 4, 0,
+ 0, 4, 1, 0, 7, 128,
+ 8, 0, 228, 160, 1, 0,
+ 0, 144, 1, 0, 228, 128,
+ 4, 0, 0, 4, 1, 0,
+ 7, 128, 10, 0, 228, 160,
+ 1, 0, 170, 144, 1, 0,
+ 228, 128, 1, 0, 0, 2,
+ 2, 0, 1, 128, 13, 0,
+ 0, 160, 4, 0, 0, 4,
+ 2, 0, 7, 128, 15, 0,
+ 228, 160, 2, 0, 0, 128,
+ 3, 0, 228, 144, 1, 0,
+ 0, 2, 3, 0, 7, 128,
+ 2, 0, 228, 128, 1, 0,
+ 0, 2, 1, 0, 8, 128,
+ 11, 0, 0, 160, 38, 0,
+ 0, 1, 0, 0, 228, 240,
+ 2, 0, 0, 3, 2, 0,
+ 8, 128, 1, 0, 255, 128,
+ 16, 0, 0, 160, 5, 0,
+ 0, 3, 2, 0, 8, 128,
+ 2, 0, 255, 128, 11, 0,
+ 85, 160, 46, 0, 0, 2,
+ 0, 0, 1, 176, 2, 0,
+ 255, 128, 8, 0, 0, 4,
+ 2, 0, 8, 128, 1, 0,
+ 228, 128, 19, 32, 228, 161,
+ 0, 0, 0, 176, 11, 0,
+ 0, 3, 2, 0, 8, 128,
+ 2, 0, 255, 128, 11, 0,
+ 0, 160, 5, 0, 0, 4,
+ 4, 0, 7, 128, 2, 0,
+ 255, 128, 17, 32, 228, 160,
+ 0, 0, 0, 176, 4, 0,
+ 0, 4, 3, 0, 7, 128,
+ 4, 0, 228, 128, 13, 0,
+ 170, 160, 3, 0, 228, 128,
+ 2, 0, 0, 3, 1, 0,
+ 8, 128, 1, 0, 255, 128,
+ 11, 0, 170, 160, 39, 0,
+ 0, 0, 1, 0, 0, 2,
+ 2, 0, 7, 128, 3, 0,
+ 228, 128, 1, 0, 0, 2,
+ 1, 0, 8, 128, 11, 0,
+ 0, 160, 38, 0, 0, 1,
+ 1, 0, 228, 240, 2, 0,
+ 0, 3, 2, 0, 8, 128,
+ 1, 0, 255, 128, 16, 0,
+ 85, 160, 5, 0, 0, 3,
+ 2, 0, 8, 128, 2, 0,
+ 255, 128, 11, 0, 85, 160,
+ 46, 0, 0, 2, 0, 0,
+ 1, 176, 2, 0, 255, 128,
+ 2, 0, 0, 4, 4, 0,
+ 7, 128, 0, 0, 228, 128,
+ 18, 32, 228, 161, 0, 0,
+ 0, 176, 8, 0, 0, 3,
+ 2, 0, 8, 128, 4, 0,
+ 228, 128, 4, 0, 228, 128,
+ 7, 0, 0, 2, 2, 0,
+ 8, 128, 2, 0, 255, 128,
+ 5, 0, 0, 3, 4, 0,
+ 7, 128, 2, 0, 255, 128,
+ 4, 0, 228, 128, 8, 0,
+ 0, 3, 3, 0, 8, 128,
+ 1, 0, 228, 128, 4, 0,
+ 228, 129, 11, 0, 0, 3,
+ 3, 0, 8, 128, 3, 0,
+ 255, 128, 11, 0, 0, 160,
+ 5, 0, 0, 4, 4, 0,
+ 7, 128, 3, 0, 255, 128,
+ 17, 32, 228, 160, 0, 0,
+ 0, 176, 6, 0, 0, 2,
+ 2, 0, 8, 128, 2, 0,
+ 255, 128, 6, 0, 0, 3,
+ 3, 0, 8, 128, 17, 32,
+ 255, 160, 0, 0, 0, 176,
+ 4, 0, 0, 4, 2, 0,
+ 8, 128, 2, 0, 255, 128,
+ 3, 0, 255, 129, 11, 0,
+ 170, 160, 11, 0, 0, 3,
+ 2, 0, 8, 128, 2, 0,
+ 255, 128, 11, 0, 0, 160,
+ 5, 0, 0, 3, 4, 0,
+ 7, 128, 2, 0, 255, 128,
+ 4, 0, 228, 128, 4, 0,
+ 0, 4, 2, 0, 7, 128,
+ 4, 0, 228, 128, 13, 0,
+ 170, 160, 2, 0, 228, 128,
+ 2, 0, 0, 3, 1, 0,
+ 8, 128, 1, 0, 255, 128,
+ 11, 0, 170, 160, 39, 0,
+ 0, 0, 1, 0, 0, 2,
+ 3, 0, 7, 128, 2, 0,
+ 228, 128, 1, 0, 0, 2,
+ 1, 0, 8, 128, 11, 0,
+ 0, 160, 38, 0, 0, 1,
+ 2, 0, 228, 240, 2, 0,
+ 0, 3, 2, 0, 8, 128,
+ 1, 0, 255, 128, 16, 0,
+ 170, 160, 5, 0, 0, 3,
+ 2, 0, 8, 128, 2, 0,
+ 255, 128, 11, 0, 85, 160,
+ 46, 0, 0, 2, 0, 0,
+ 1, 176, 2, 0, 255, 128,
+ 2, 0, 0, 4, 4, 0,
+ 7, 128, 0, 0, 228, 128,
+ 18, 32, 228, 161, 0, 0,
+ 0, 176, 8, 0, 0, 3,
+ 2, 0, 8, 128, 4, 0,
+ 228, 128, 4, 0, 228, 128,
+ 7, 0, 0, 2, 2, 0,
+ 8, 128, 2, 0, 255, 128,
+ 5, 0, 0, 3, 4, 0,
+ 7, 128, 2, 0, 255, 128,
+ 4, 0, 228, 128, 8, 0,
+ 0, 3, 4, 0, 8, 128,
+ 1, 0, 228, 128, 4, 0,
+ 228, 129, 8, 0, 0, 4,
+ 4, 0, 1, 128, 4, 0,
+ 228, 128, 19, 32, 228, 160,
+ 0, 0, 0, 176, 11, 0,
+ 0, 3, 4, 0, 2, 128,
+ 4, 0, 255, 128, 11, 0,
+ 0, 160, 1, 0, 0, 2,
+ 4, 0, 4, 128, 11, 0,
+ 170, 160, 2, 0, 0, 4,
+ 4, 0, 5, 128, 4, 0,
+ 228, 128, 18, 32, 255, 160,
+ 0, 0, 0, 176, 6, 0,
+ 0, 2, 4, 0, 4, 128,
+ 4, 0, 170, 128, 5, 0,
+ 0, 3, 4, 0, 1, 128,
+ 4, 0, 170, 128, 4, 0,
+ 0, 128, 12, 0, 0, 3,
+ 4, 0, 4, 128, 4, 0,
+ 0, 128, 11, 0, 0, 160,
+ 4, 0, 0, 4, 4, 0,
+ 2, 128, 4, 0, 170, 128,
+ 4, 0, 85, 129, 4, 0,
+ 85, 128, 11, 0, 0, 4,
+ 4, 0, 1, 128, 4, 0,
+ 0, 128, 19, 32, 255, 160,
+ 0, 0, 0, 176, 5, 0,
+ 0, 3, 4, 0, 1, 128,
+ 4, 0, 0, 128, 4, 0,
+ 85, 128, 5, 0, 0, 4,
+ 4, 0, 7, 128, 4, 0,
+ 0, 128, 17, 32, 228, 160,
+ 0, 0, 0, 176, 6, 0,
+ 0, 2, 2, 0, 8, 128,
+ 2, 0, 255, 128, 6, 0,
+ 0, 3, 4, 0, 8, 128,
+ 17, 32, 255, 160, 0, 0,
+ 0, 176, 4, 0, 0, 4,
+ 2, 0, 8, 128, 2, 0,
+ 255, 128, 4, 0, 255, 129,
+ 11, 0, 170, 160, 11, 0,
+ 0, 3, 2, 0, 8, 128,
+ 2, 0, 255, 128, 11, 0,
+ 0, 160, 5, 0, 0, 3,
+ 4, 0, 7, 128, 2, 0,
+ 255, 128, 4, 0, 228, 128,
+ 4, 0, 0, 4, 3, 0,
+ 7, 128, 4, 0, 228, 128,
+ 13, 0, 170, 160, 3, 0,
+ 228, 128, 2, 0, 0, 3,
+ 1, 0, 8, 128, 1, 0,
+ 255, 128, 11, 0, 170, 160,
+ 39, 0, 0, 0, 1, 0,
+ 0, 2, 3, 0, 8, 128,
+ 3, 0, 255, 144, 11, 0,
+ 0, 3, 1, 0, 15, 128,
+ 3, 0, 228, 128, 11, 0,
+ 0, 160, 10, 0, 0, 3,
+ 1, 0, 15, 128, 1, 0,
+ 228, 128, 11, 0, 170, 160,
+ 5, 0, 0, 3, 0, 0,
+ 15, 208, 1, 0, 228, 128,
+ 12, 0, 228, 160, 2, 0,
+ 0, 3, 0, 0, 1, 128,
+ 0, 0, 255, 128, 14, 0,
+ 85, 161, 5, 0, 0, 3,
+ 0, 0, 1, 128, 0, 0,
+ 0, 128, 14, 0, 170, 160,
+ 11, 0, 0, 3, 0, 0,
+ 1, 128, 0, 0, 0, 128,
+ 14, 0, 255, 160, 10, 0,
+ 0, 3, 0, 0, 4, 224,
+ 0, 0, 0, 128, 11, 0,
+ 170, 160, 1, 0, 0, 2,
+ 0, 0, 3, 224, 2, 0,
+ 228, 144, 255, 255, 0, 0
+};
diff --git a/src/d3d/shaders/default_amb_VS.h b/src/d3d/shaders/default_amb_VS.h
new file mode 100644
index 0000000..6c22e23
--- /dev/null
+++ b/src/d3d/shaders/default_amb_VS.h
@@ -0,0 +1,156 @@
+#if 0
+//
+// Generated by Microsoft (R) HLSL Shader Compiler 9.29.952.3111
+//
+// fxc /nologo /T vs_2_0 /Fh default_amb_VS.h default_VS.hlsl
+//
+//
+// Parameters:
+//
+// float4 ambientLight;
+// float4x4 combinedMat;
+// float4 fogData;
+// float4 matCol;
+// float4 surfProps;
+//
+//
+// Registers:
+//
+// Name Reg Size
+// ------------ ----- ----
+// combinedMat c0 4
+// matCol c12 1
+// surfProps c13 1
+// fogData c14 1
+// ambientLight c15 1
+//
+
+ vs_2_0
+ def c4, 0, 1, 0, 0
+ dcl_position v0
+ dcl_texcoord v1
+ dcl_color v2
+ mov r0.xyz, c15
+ mad r0.xyz, r0, c13.x, v2
+ mov r0.w, v2.w
+ max r0, r0, c4.x
+ min r0, r0, c4.y
+ mul oD0, r0, c12
+ mul r0, v0.y, c1
+ mad r0, c0, v0.x, r0
+ mad r0, c2, v0.z, r0
+ mad r0, c3, v0.w, r0
+ add r1.x, r0.w, -c14.y
+ mov oPos, r0
+ mul r0.x, r1.x, c14.z
+ max r0.x, r0.x, c14.w
+ min oT0.z, r0.x, c4.y
+ mov oT0.xy, v1
+
+// approximately 16 instruction slots used
+#endif
+
+const BYTE g_vs20_main[] =
+{
+ 0, 2, 254, 255, 254, 255,
+ 69, 0, 67, 84, 65, 66,
+ 28, 0, 0, 0, 220, 0,
+ 0, 0, 0, 2, 254, 255,
+ 5, 0, 0, 0, 28, 0,
+ 0, 0, 0, 1, 0, 0,
+ 213, 0, 0, 0, 128, 0,
+ 0, 0, 2, 0, 15, 0,
+ 1, 0, 62, 0, 144, 0,
+ 0, 0, 0, 0, 0, 0,
+ 160, 0, 0, 0, 2, 0,
+ 0, 0, 4, 0, 2, 0,
+ 172, 0, 0, 0, 0, 0,
+ 0, 0, 188, 0, 0, 0,
+ 2, 0, 14, 0, 1, 0,
+ 58, 0, 144, 0, 0, 0,
+ 0, 0, 0, 0, 196, 0,
+ 0, 0, 2, 0, 12, 0,
+ 1, 0, 50, 0, 144, 0,
+ 0, 0, 0, 0, 0, 0,
+ 203, 0, 0, 0, 2, 0,
+ 13, 0, 1, 0, 54, 0,
+ 144, 0, 0, 0, 0, 0,
+ 0, 0, 97, 109, 98, 105,
+ 101, 110, 116, 76, 105, 103,
+ 104, 116, 0, 171, 171, 171,
+ 1, 0, 3, 0, 1, 0,
+ 4, 0, 1, 0, 0, 0,
+ 0, 0, 0, 0, 99, 111,
+ 109, 98, 105, 110, 101, 100,
+ 77, 97, 116, 0, 3, 0,
+ 3, 0, 4, 0, 4, 0,
+ 1, 0, 0, 0, 0, 0,
+ 0, 0, 102, 111, 103, 68,
+ 97, 116, 97, 0, 109, 97,
+ 116, 67, 111, 108, 0, 115,
+ 117, 114, 102, 80, 114, 111,
+ 112, 115, 0, 118, 115, 95,
+ 50, 95, 48, 0, 77, 105,
+ 99, 114, 111, 115, 111, 102,
+ 116, 32, 40, 82, 41, 32,
+ 72, 76, 83, 76, 32, 83,
+ 104, 97, 100, 101, 114, 32,
+ 67, 111, 109, 112, 105, 108,
+ 101, 114, 32, 57, 46, 50,
+ 57, 46, 57, 53, 50, 46,
+ 51, 49, 49, 49, 0, 171,
+ 171, 171, 81, 0, 0, 5,
+ 4, 0, 15, 160, 0, 0,
+ 0, 0, 0, 0, 128, 63,
+ 0, 0, 0, 0, 0, 0,
+ 0, 0, 31, 0, 0, 2,
+ 0, 0, 0, 128, 0, 0,
+ 15, 144, 31, 0, 0, 2,
+ 5, 0, 0, 128, 1, 0,
+ 15, 144, 31, 0, 0, 2,
+ 10, 0, 0, 128, 2, 0,
+ 15, 144, 1, 0, 0, 2,
+ 0, 0, 7, 128, 15, 0,
+ 228, 160, 4, 0, 0, 4,
+ 0, 0, 7, 128, 0, 0,
+ 228, 128, 13, 0, 0, 160,
+ 2, 0, 228, 144, 1, 0,
+ 0, 2, 0, 0, 8, 128,
+ 2, 0, 255, 144, 11, 0,
+ 0, 3, 0, 0, 15, 128,
+ 0, 0, 228, 128, 4, 0,
+ 0, 160, 10, 0, 0, 3,
+ 0, 0, 15, 128, 0, 0,
+ 228, 128, 4, 0, 85, 160,
+ 5, 0, 0, 3, 0, 0,
+ 15, 208, 0, 0, 228, 128,
+ 12, 0, 228, 160, 5, 0,
+ 0, 3, 0, 0, 15, 128,
+ 0, 0, 85, 144, 1, 0,
+ 228, 160, 4, 0, 0, 4,
+ 0, 0, 15, 128, 0, 0,
+ 228, 160, 0, 0, 0, 144,
+ 0, 0, 228, 128, 4, 0,
+ 0, 4, 0, 0, 15, 128,
+ 2, 0, 228, 160, 0, 0,
+ 170, 144, 0, 0, 228, 128,
+ 4, 0, 0, 4, 0, 0,
+ 15, 128, 3, 0, 228, 160,
+ 0, 0, 255, 144, 0, 0,
+ 228, 128, 2, 0, 0, 3,
+ 1, 0, 1, 128, 0, 0,
+ 255, 128, 14, 0, 85, 161,
+ 1, 0, 0, 2, 0, 0,
+ 15, 192, 0, 0, 228, 128,
+ 5, 0, 0, 3, 0, 0,
+ 1, 128, 1, 0, 0, 128,
+ 14, 0, 170, 160, 11, 0,
+ 0, 3, 0, 0, 1, 128,
+ 0, 0, 0, 128, 14, 0,
+ 255, 160, 10, 0, 0, 3,
+ 0, 0, 4, 224, 0, 0,
+ 0, 128, 4, 0, 85, 160,
+ 1, 0, 0, 2, 0, 0,
+ 3, 224, 1, 0, 228, 144,
+ 255, 255, 0, 0
+};
diff --git a/src/d3d/shaders/default_amb_dir_VS.h b/src/d3d/shaders/default_amb_dir_VS.h
new file mode 100644
index 0000000..768042f
--- /dev/null
+++ b/src/d3d/shaders/default_amb_dir_VS.h
@@ -0,0 +1,272 @@
+#if 0
+//
+// Generated by Microsoft (R) HLSL Shader Compiler 9.29.952.3111
+//
+// fxc /nologo /T vs_2_0 /DDIRECTIONALS /Fh default_amb_dir_VS.h
+// default_VS.hlsl
+//
+//
+// Parameters:
+//
+// float4 ambientLight;
+// float4x4 combinedMat;
+// int4 firstLight;
+// float4 fogData;
+//
+// struct
+// {
+// float4 color;
+// float4 position;
+// float4 direction;
+//
+// } lights[8];
+//
+// float4 matCol;
+// float3x3 normalMat;
+// int numDirLights;
+// float4 surfProps;
+//
+//
+// Registers:
+//
+// Name Reg Size
+// ------------ ----- ----
+// numDirLights i0 1
+// combinedMat c0 4
+// normalMat c8 3
+// matCol c12 1
+// surfProps c13 1
+// fogData c14 1
+// ambientLight c15 1
+// firstLight c16 1
+// lights c17 24
+//
+
+ vs_2_0
+ def c4, 0, 3, 1, 0
+ dcl_position v0
+ dcl_normal v1
+ dcl_texcoord v2
+ dcl_color v3
+ mul r0, v0.y, c1
+ mad r0, c0, v0.x, r0
+ mad r0, c2, v0.z, r0
+ mad r0, c3, v0.w, r0
+ mov oPos, r0
+ mul r0.xyz, v1.y, c9
+ mad r0.xyz, c8, v1.x, r0
+ mad r0.xyz, c10, v1.z, r0
+ mov r1.x, c13.x
+ mad r1.xyz, c15, r1.x, v3
+ mov r2.xyz, r1
+ mov r1.w, c4.x
+ rep i0
+ add r3.x, r1.w, c16.x
+ mul r3.x, r3.x, c4.y
+ mova a0.x, r3.x
+ dp3 r3.x, r0, -c19[a0.x]
+ max r3.x, r3.x, c4.x
+ mul r3.xyz, r3.x, c17[a0.x]
+ mad r2.xyz, r3, c13.z, r2
+ add r1.w, r1.w, c4.z
+ endrep
+ mov r2.w, v3.w
+ max r1, r2, c4.x
+ min r1, r1, c4.z
+ mul oD0, r1, c12
+ add r0.x, r0.w, -c14.y
+ mul r0.x, r0.x, c14.z
+ max r0.x, r0.x, c14.w
+ min oT0.z, r0.x, c4.z
+ mov oT0.xy, v2
+
+// approximately 34 instruction slots used
+#endif
+
+const BYTE g_vs20_main[] =
+{
+ 0, 2, 254, 255, 254, 255,
+ 134, 0, 67, 84, 65, 66,
+ 28, 0, 0, 0, 225, 1,
+ 0, 0, 0, 2, 254, 255,
+ 9, 0, 0, 0, 28, 0,
+ 0, 0, 0, 1, 0, 0,
+ 218, 1, 0, 0, 208, 0,
+ 0, 0, 2, 0, 15, 0,
+ 1, 0, 62, 0, 224, 0,
+ 0, 0, 0, 0, 0, 0,
+ 240, 0, 0, 0, 2, 0,
+ 0, 0, 4, 0, 2, 0,
+ 252, 0, 0, 0, 0, 0,
+ 0, 0, 12, 1, 0, 0,
+ 2, 0, 16, 0, 1, 0,
+ 66, 0, 24, 1, 0, 0,
+ 0, 0, 0, 0, 40, 1,
+ 0, 0, 2, 0, 14, 0,
+ 1, 0, 58, 0, 224, 0,
+ 0, 0, 0, 0, 0, 0,
+ 48, 1, 0, 0, 2, 0,
+ 17, 0, 24, 0, 70, 0,
+ 124, 1, 0, 0, 0, 0,
+ 0, 0, 140, 1, 0, 0,
+ 2, 0, 12, 0, 1, 0,
+ 50, 0, 224, 0, 0, 0,
+ 0, 0, 0, 0, 147, 1,
+ 0, 0, 2, 0, 8, 0,
+ 3, 0, 34, 0, 160, 1,
+ 0, 0, 0, 0, 0, 0,
+ 176, 1, 0, 0, 1, 0,
+ 0, 0, 1, 0, 2, 0,
+ 192, 1, 0, 0, 0, 0,
+ 0, 0, 208, 1, 0, 0,
+ 2, 0, 13, 0, 1, 0,
+ 54, 0, 224, 0, 0, 0,
+ 0, 0, 0, 0, 97, 109,
+ 98, 105, 101, 110, 116, 76,
+ 105, 103, 104, 116, 0, 171,
+ 171, 171, 1, 0, 3, 0,
+ 1, 0, 4, 0, 1, 0,
+ 0, 0, 0, 0, 0, 0,
+ 99, 111, 109, 98, 105, 110,
+ 101, 100, 77, 97, 116, 0,
+ 3, 0, 3, 0, 4, 0,
+ 4, 0, 1, 0, 0, 0,
+ 0, 0, 0, 0, 102, 105,
+ 114, 115, 116, 76, 105, 103,
+ 104, 116, 0, 171, 1, 0,
+ 2, 0, 1, 0, 4, 0,
+ 1, 0, 0, 0, 0, 0,
+ 0, 0, 102, 111, 103, 68,
+ 97, 116, 97, 0, 108, 105,
+ 103, 104, 116, 115, 0, 99,
+ 111, 108, 111, 114, 0, 171,
+ 171, 171, 1, 0, 3, 0,
+ 1, 0, 4, 0, 1, 0,
+ 0, 0, 0, 0, 0, 0,
+ 112, 111, 115, 105, 116, 105,
+ 111, 110, 0, 100, 105, 114,
+ 101, 99, 116, 105, 111, 110,
+ 0, 171, 55, 1, 0, 0,
+ 64, 1, 0, 0, 80, 1,
+ 0, 0, 64, 1, 0, 0,
+ 89, 1, 0, 0, 64, 1,
+ 0, 0, 5, 0, 0, 0,
+ 1, 0, 12, 0, 8, 0,
+ 3, 0, 100, 1, 0, 0,
+ 109, 97, 116, 67, 111, 108,
+ 0, 110, 111, 114, 109, 97,
+ 108, 77, 97, 116, 0, 171,
+ 171, 171, 3, 0, 3, 0,
+ 3, 0, 3, 0, 1, 0,
+ 0, 0, 0, 0, 0, 0,
+ 110, 117, 109, 68, 105, 114,
+ 76, 105, 103, 104, 116, 115,
+ 0, 171, 171, 171, 0, 0,
+ 2, 0, 1, 0, 1, 0,
+ 1, 0, 0, 0, 0, 0,
+ 0, 0, 115, 117, 114, 102,
+ 80, 114, 111, 112, 115, 0,
+ 118, 115, 95, 50, 95, 48,
+ 0, 77, 105, 99, 114, 111,
+ 115, 111, 102, 116, 32, 40,
+ 82, 41, 32, 72, 76, 83,
+ 76, 32, 83, 104, 97, 100,
+ 101, 114, 32, 67, 111, 109,
+ 112, 105, 108, 101, 114, 32,
+ 57, 46, 50, 57, 46, 57,
+ 53, 50, 46, 51, 49, 49,
+ 49, 0, 171, 171, 81, 0,
+ 0, 5, 4, 0, 15, 160,
+ 0, 0, 0, 0, 0, 0,
+ 64, 64, 0, 0, 128, 63,
+ 0, 0, 0, 0, 31, 0,
+ 0, 2, 0, 0, 0, 128,
+ 0, 0, 15, 144, 31, 0,
+ 0, 2, 3, 0, 0, 128,
+ 1, 0, 15, 144, 31, 0,
+ 0, 2, 5, 0, 0, 128,
+ 2, 0, 15, 144, 31, 0,
+ 0, 2, 10, 0, 0, 128,
+ 3, 0, 15, 144, 5, 0,
+ 0, 3, 0, 0, 15, 128,
+ 0, 0, 85, 144, 1, 0,
+ 228, 160, 4, 0, 0, 4,
+ 0, 0, 15, 128, 0, 0,
+ 228, 160, 0, 0, 0, 144,
+ 0, 0, 228, 128, 4, 0,
+ 0, 4, 0, 0, 15, 128,
+ 2, 0, 228, 160, 0, 0,
+ 170, 144, 0, 0, 228, 128,
+ 4, 0, 0, 4, 0, 0,
+ 15, 128, 3, 0, 228, 160,
+ 0, 0, 255, 144, 0, 0,
+ 228, 128, 1, 0, 0, 2,
+ 0, 0, 15, 192, 0, 0,
+ 228, 128, 5, 0, 0, 3,
+ 0, 0, 7, 128, 1, 0,
+ 85, 144, 9, 0, 228, 160,
+ 4, 0, 0, 4, 0, 0,
+ 7, 128, 8, 0, 228, 160,
+ 1, 0, 0, 144, 0, 0,
+ 228, 128, 4, 0, 0, 4,
+ 0, 0, 7, 128, 10, 0,
+ 228, 160, 1, 0, 170, 144,
+ 0, 0, 228, 128, 1, 0,
+ 0, 2, 1, 0, 1, 128,
+ 13, 0, 0, 160, 4, 0,
+ 0, 4, 1, 0, 7, 128,
+ 15, 0, 228, 160, 1, 0,
+ 0, 128, 3, 0, 228, 144,
+ 1, 0, 0, 2, 2, 0,
+ 7, 128, 1, 0, 228, 128,
+ 1, 0, 0, 2, 1, 0,
+ 8, 128, 4, 0, 0, 160,
+ 38, 0, 0, 1, 0, 0,
+ 228, 240, 2, 0, 0, 3,
+ 3, 0, 1, 128, 1, 0,
+ 255, 128, 16, 0, 0, 160,
+ 5, 0, 0, 3, 3, 0,
+ 1, 128, 3, 0, 0, 128,
+ 4, 0, 85, 160, 46, 0,
+ 0, 2, 0, 0, 1, 176,
+ 3, 0, 0, 128, 8, 0,
+ 0, 4, 3, 0, 1, 128,
+ 0, 0, 228, 128, 19, 32,
+ 228, 161, 0, 0, 0, 176,
+ 11, 0, 0, 3, 3, 0,
+ 1, 128, 3, 0, 0, 128,
+ 4, 0, 0, 160, 5, 0,
+ 0, 4, 3, 0, 7, 128,
+ 3, 0, 0, 128, 17, 32,
+ 228, 160, 0, 0, 0, 176,
+ 4, 0, 0, 4, 2, 0,
+ 7, 128, 3, 0, 228, 128,
+ 13, 0, 170, 160, 2, 0,
+ 228, 128, 2, 0, 0, 3,
+ 1, 0, 8, 128, 1, 0,
+ 255, 128, 4, 0, 170, 160,
+ 39, 0, 0, 0, 1, 0,
+ 0, 2, 2, 0, 8, 128,
+ 3, 0, 255, 144, 11, 0,
+ 0, 3, 1, 0, 15, 128,
+ 2, 0, 228, 128, 4, 0,
+ 0, 160, 10, 0, 0, 3,
+ 1, 0, 15, 128, 1, 0,
+ 228, 128, 4, 0, 170, 160,
+ 5, 0, 0, 3, 0, 0,
+ 15, 208, 1, 0, 228, 128,
+ 12, 0, 228, 160, 2, 0,
+ 0, 3, 0, 0, 1, 128,
+ 0, 0, 255, 128, 14, 0,
+ 85, 161, 5, 0, 0, 3,
+ 0, 0, 1, 128, 0, 0,
+ 0, 128, 14, 0, 170, 160,
+ 11, 0, 0, 3, 0, 0,
+ 1, 128, 0, 0, 0, 128,
+ 14, 0, 255, 160, 10, 0,
+ 0, 3, 0, 0, 4, 224,
+ 0, 0, 0, 128, 4, 0,
+ 170, 160, 1, 0, 0, 2,
+ 0, 0, 3, 224, 2, 0,
+ 228, 144, 255, 255, 0, 0
+};
diff --git a/src/d3d/shaders/default_tex_PS.h b/src/d3d/shaders/default_tex_PS.h
new file mode 100644
index 0000000..a25f918
--- /dev/null
+++ b/src/d3d/shaders/default_tex_PS.h
@@ -0,0 +1,89 @@
+#if 0
+//
+// Generated by Microsoft (R) HLSL Shader Compiler 9.29.952.3111
+//
+// fxc /nologo /T ps_2_0 /DTEX /Fh default_tex_PS.h default_PS.hlsl
+//
+//
+// Parameters:
+//
+// float4 fogColor;
+// sampler2D tex0;
+//
+//
+// Registers:
+//
+// Name Reg Size
+// ------------ ----- ----
+// fogColor c0 1
+// tex0 s0 1
+//
+
+ ps_2_0
+ dcl t0.xyz
+ dcl v0
+ dcl_2d s0
+ texld r0, t0, s0
+ mad r0.xyz, v0, r0, -c0
+ mul r1.w, r0.w, v0.w
+ mad r1.xyz, t0.z, r0, c0
+ mov oC0, r1
+
+// approximately 5 instruction slots used (1 texture, 4 arithmetic)
+#endif
+
+const BYTE g_ps20_main[] =
+{
+ 0, 2, 255, 255, 254, 255,
+ 45, 0, 67, 84, 65, 66,
+ 28, 0, 0, 0, 127, 0,
+ 0, 0, 0, 2, 255, 255,
+ 2, 0, 0, 0, 28, 0,
+ 0, 0, 0, 1, 0, 0,
+ 120, 0, 0, 0, 68, 0,
+ 0, 0, 2, 0, 0, 0,
+ 1, 0, 2, 0, 80, 0,
+ 0, 0, 0, 0, 0, 0,
+ 96, 0, 0, 0, 3, 0,
+ 0, 0, 1, 0, 2, 0,
+ 104, 0, 0, 0, 0, 0,
+ 0, 0, 102, 111, 103, 67,
+ 111, 108, 111, 114, 0, 171,
+ 171, 171, 1, 0, 3, 0,
+ 1, 0, 4, 0, 1, 0,
+ 0, 0, 0, 0, 0, 0,
+ 116, 101, 120, 48, 0, 171,
+ 171, 171, 4, 0, 12, 0,
+ 1, 0, 1, 0, 1, 0,
+ 0, 0, 0, 0, 0, 0,
+ 112, 115, 95, 50, 95, 48,
+ 0, 77, 105, 99, 114, 111,
+ 115, 111, 102, 116, 32, 40,
+ 82, 41, 32, 72, 76, 83,
+ 76, 32, 83, 104, 97, 100,
+ 101, 114, 32, 67, 111, 109,
+ 112, 105, 108, 101, 114, 32,
+ 57, 46, 50, 57, 46, 57,
+ 53, 50, 46, 51, 49, 49,
+ 49, 0, 31, 0, 0, 2,
+ 0, 0, 0, 128, 0, 0,
+ 7, 176, 31, 0, 0, 2,
+ 0, 0, 0, 128, 0, 0,
+ 15, 144, 31, 0, 0, 2,
+ 0, 0, 0, 144, 0, 8,
+ 15, 160, 66, 0, 0, 3,
+ 0, 0, 15, 128, 0, 0,
+ 228, 176, 0, 8, 228, 160,
+ 4, 0, 0, 4, 0, 0,
+ 7, 128, 0, 0, 228, 144,
+ 0, 0, 228, 128, 0, 0,
+ 228, 161, 5, 0, 0, 3,
+ 1, 0, 8, 128, 0, 0,
+ 255, 128, 0, 0, 255, 144,
+ 4, 0, 0, 4, 1, 0,
+ 7, 128, 0, 0, 170, 176,
+ 0, 0, 228, 128, 0, 0,
+ 228, 160, 1, 0, 0, 2,
+ 0, 8, 15, 128, 1, 0,
+ 228, 128, 255, 255, 0, 0
+};
diff --git a/src/d3d/shaders/im2d_PS.h b/src/d3d/shaders/im2d_PS.h
new file mode 100644
index 0000000..71f8b28
--- /dev/null
+++ b/src/d3d/shaders/im2d_PS.h
@@ -0,0 +1,72 @@
+#if 0
+//
+// Generated by Microsoft (R) HLSL Shader Compiler 9.29.952.3111
+//
+// fxc /nologo /T ps_2_0 /Fh im2d_PS.h im2d_PS.hlsl
+//
+//
+// Parameters:
+//
+// float4 fogColor;
+//
+//
+// Registers:
+//
+// Name Reg Size
+// ------------ ----- ----
+// fogColor c0 1
+//
+
+ ps_2_0
+ dcl t0.xyz
+ dcl v0
+ add r0.xyz, v0, -c0
+ mad r0.xyz, t0.z, r0, c0
+ mov r0.w, v0.w
+ mov oC0, r0
+
+// approximately 4 instruction slots used
+#endif
+
+const BYTE g_ps20_main[] =
+{
+ 0, 2, 255, 255, 254, 255,
+ 34, 0, 67, 84, 65, 66,
+ 28, 0, 0, 0, 83, 0,
+ 0, 0, 0, 2, 255, 255,
+ 1, 0, 0, 0, 28, 0,
+ 0, 0, 0, 1, 0, 0,
+ 76, 0, 0, 0, 48, 0,
+ 0, 0, 2, 0, 0, 0,
+ 1, 0, 2, 0, 60, 0,
+ 0, 0, 0, 0, 0, 0,
+ 102, 111, 103, 67, 111, 108,
+ 111, 114, 0, 171, 171, 171,
+ 1, 0, 3, 0, 1, 0,
+ 4, 0, 1, 0, 0, 0,
+ 0, 0, 0, 0, 112, 115,
+ 95, 50, 95, 48, 0, 77,
+ 105, 99, 114, 111, 115, 111,
+ 102, 116, 32, 40, 82, 41,
+ 32, 72, 76, 83, 76, 32,
+ 83, 104, 97, 100, 101, 114,
+ 32, 67, 111, 109, 112, 105,
+ 108, 101, 114, 32, 57, 46,
+ 50, 57, 46, 57, 53, 50,
+ 46, 51, 49, 49, 49, 0,
+ 31, 0, 0, 2, 0, 0,
+ 0, 128, 0, 0, 7, 176,
+ 31, 0, 0, 2, 0, 0,
+ 0, 128, 0, 0, 15, 144,
+ 2, 0, 0, 3, 0, 0,
+ 7, 128, 0, 0, 228, 144,
+ 0, 0, 228, 161, 4, 0,
+ 0, 4, 0, 0, 7, 128,
+ 0, 0, 170, 176, 0, 0,
+ 228, 128, 0, 0, 228, 160,
+ 1, 0, 0, 2, 0, 0,
+ 8, 128, 0, 0, 255, 144,
+ 1, 0, 0, 2, 0, 8,
+ 15, 128, 0, 0, 228, 128,
+ 255, 255, 0, 0
+};
diff --git a/src/d3d/shaders/im2d_PS.hlsl b/src/d3d/shaders/im2d_PS.hlsl
new file mode 100644
index 0000000..eaf279d
--- /dev/null
+++ b/src/d3d/shaders/im2d_PS.hlsl
@@ -0,0 +1,19 @@
+struct VS_out {
+ float4 Position : POSITION;
+ float3 TexCoord0 : TEXCOORD0;
+ float4 Color : COLOR0;
+};
+
+sampler2D tex0 : register(s0);
+
+float4 fogColor : register(c0);
+
+float4 main(VS_out input) : COLOR
+{
+ float4 color = input.Color;
+#ifdef TEX
+ color *= tex2D(tex0, input.TexCoord0.xy);
+#endif
+ color.rgb = lerp(fogColor.rgb, color.rgb, input.TexCoord0.z);
+ return color;
+}
diff --git a/src/d3d/shaders/im2d_VS.h b/src/d3d/shaders/im2d_VS.h
new file mode 100644
index 0000000..bc36b1f
--- /dev/null
+++ b/src/d3d/shaders/im2d_VS.h
@@ -0,0 +1,107 @@
+#if 0
+//
+// Generated by Microsoft (R) HLSL Shader Compiler 9.29.952.3111
+//
+// fxc /nologo /T vs_2_0 /Fh im2d_VS.h im2d_VS.hlsl
+//
+//
+// Parameters:
+//
+// float4 fogData;
+// float4 xform;
+//
+//
+// Registers:
+//
+// Name Reg Size
+// ------------ ----- ----
+// fogData c14 1
+// xform c41 1
+//
+
+ vs_2_0
+ def c0, 1, 0, 0, 0
+ dcl_position v0
+ dcl_texcoord v1
+ dcl_color v2
+ add r0.x, v0.w, -c14.y
+ mul r0.x, r0.x, c14.z
+ max r0.x, r0.x, c14.w
+ min oT0.z, r0.x, c0.x
+ mad r0.xy, v0, c41, c41.zwzw
+ mov r0.z, v0.z
+ mul oPos.xyz, r0, v0.w
+ mov oPos.w, v0.w
+ mov oT0.xy, v1
+ mov oD0, v2
+
+// approximately 10 instruction slots used
+#endif
+
+const BYTE g_vs20_main[] =
+{
+ 0, 2, 254, 255, 254, 255,
+ 40, 0, 67, 84, 65, 66,
+ 28, 0, 0, 0, 105, 0,
+ 0, 0, 0, 2, 254, 255,
+ 2, 0, 0, 0, 28, 0,
+ 0, 0, 0, 1, 0, 0,
+ 98, 0, 0, 0, 68, 0,
+ 0, 0, 2, 0, 14, 0,
+ 1, 0, 58, 0, 76, 0,
+ 0, 0, 0, 0, 0, 0,
+ 92, 0, 0, 0, 2, 0,
+ 41, 0, 1, 0, 166, 0,
+ 76, 0, 0, 0, 0, 0,
+ 0, 0, 102, 111, 103, 68,
+ 97, 116, 97, 0, 1, 0,
+ 3, 0, 1, 0, 4, 0,
+ 1, 0, 0, 0, 0, 0,
+ 0, 0, 120, 102, 111, 114,
+ 109, 0, 118, 115, 95, 50,
+ 95, 48, 0, 77, 105, 99,
+ 114, 111, 115, 111, 102, 116,
+ 32, 40, 82, 41, 32, 72,
+ 76, 83, 76, 32, 83, 104,
+ 97, 100, 101, 114, 32, 67,
+ 111, 109, 112, 105, 108, 101,
+ 114, 32, 57, 46, 50, 57,
+ 46, 57, 53, 50, 46, 51,
+ 49, 49, 49, 0, 171, 171,
+ 81, 0, 0, 5, 0, 0,
+ 15, 160, 0, 0, 128, 63,
+ 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0,
+ 31, 0, 0, 2, 0, 0,
+ 0, 128, 0, 0, 15, 144,
+ 31, 0, 0, 2, 5, 0,
+ 0, 128, 1, 0, 15, 144,
+ 31, 0, 0, 2, 10, 0,
+ 0, 128, 2, 0, 15, 144,
+ 2, 0, 0, 3, 0, 0,
+ 1, 128, 0, 0, 255, 144,
+ 14, 0, 85, 161, 5, 0,
+ 0, 3, 0, 0, 1, 128,
+ 0, 0, 0, 128, 14, 0,
+ 170, 160, 11, 0, 0, 3,
+ 0, 0, 1, 128, 0, 0,
+ 0, 128, 14, 0, 255, 160,
+ 10, 0, 0, 3, 0, 0,
+ 4, 224, 0, 0, 0, 128,
+ 0, 0, 0, 160, 4, 0,
+ 0, 4, 0, 0, 3, 128,
+ 0, 0, 228, 144, 41, 0,
+ 228, 160, 41, 0, 238, 160,
+ 1, 0, 0, 2, 0, 0,
+ 4, 128, 0, 0, 170, 144,
+ 5, 0, 0, 3, 0, 0,
+ 7, 192, 0, 0, 228, 128,
+ 0, 0, 255, 144, 1, 0,
+ 0, 2, 0, 0, 8, 192,
+ 0, 0, 255, 144, 1, 0,
+ 0, 2, 0, 0, 3, 224,
+ 1, 0, 228, 144, 1, 0,
+ 0, 2, 0, 0, 15, 208,
+ 2, 0, 228, 144, 255, 255,
+ 0, 0
+};
diff --git a/src/d3d/shaders/im2d_VS.hlsl b/src/d3d/shaders/im2d_VS.hlsl
new file mode 100644
index 0000000..20cf3ce
--- /dev/null
+++ b/src/d3d/shaders/im2d_VS.hlsl
@@ -0,0 +1,30 @@
+#include "standardConstants.h"
+
+struct VS_in
+{
+ float4 Position : POSITION;
+ float2 TexCoord : TEXCOORD0;
+ float4 Color : COLOR0;
+};
+
+struct VS_out {
+ float4 Position : POSITION;
+ float3 TexCoord0 : TEXCOORD0;
+ float4 Color : COLOR0;
+};
+
+float4 xform : register(c41);
+
+VS_out main(in VS_in input)
+{
+ VS_out output;
+
+ output.Position = input.Position;
+ output.Position.xy = output.Position.xy * xform.xy + xform.zw;
+ output.TexCoord0.z = clamp((output.Position.w - fogEnd)*fogRange, fogDisable, 1.0);
+ output.Position.xyz *= output.Position.w;
+ output.Color = input.Color;
+ output.TexCoord0.xy = input.TexCoord;
+
+ return output;
+}
diff --git a/src/d3d/shaders/im2d_tex_PS.h b/src/d3d/shaders/im2d_tex_PS.h
new file mode 100644
index 0000000..a91888b
--- /dev/null
+++ b/src/d3d/shaders/im2d_tex_PS.h
@@ -0,0 +1,89 @@
+#if 0
+//
+// Generated by Microsoft (R) HLSL Shader Compiler 9.29.952.3111
+//
+// fxc /nologo /T ps_2_0 /DTEX /Fh im2d_tex_PS.h im2d_PS.hlsl
+//
+//
+// Parameters:
+//
+// float4 fogColor;
+// sampler2D tex0;
+//
+//
+// Registers:
+//
+// Name Reg Size
+// ------------ ----- ----
+// fogColor c0 1
+// tex0 s0 1
+//
+
+ ps_2_0
+ dcl t0.xyz
+ dcl v0
+ dcl_2d s0
+ texld r0, t0, s0
+ mad r0.xyz, v0, r0, -c0
+ mul r1.w, r0.w, v0.w
+ mad r1.xyz, t0.z, r0, c0
+ mov oC0, r1
+
+// approximately 5 instruction slots used (1 texture, 4 arithmetic)
+#endif
+
+const BYTE g_ps20_main[] =
+{
+ 0, 2, 255, 255, 254, 255,
+ 45, 0, 67, 84, 65, 66,
+ 28, 0, 0, 0, 127, 0,
+ 0, 0, 0, 2, 255, 255,
+ 2, 0, 0, 0, 28, 0,
+ 0, 0, 0, 1, 0, 0,
+ 120, 0, 0, 0, 68, 0,
+ 0, 0, 2, 0, 0, 0,
+ 1, 0, 2, 0, 80, 0,
+ 0, 0, 0, 0, 0, 0,
+ 96, 0, 0, 0, 3, 0,
+ 0, 0, 1, 0, 2, 0,
+ 104, 0, 0, 0, 0, 0,
+ 0, 0, 102, 111, 103, 67,
+ 111, 108, 111, 114, 0, 171,
+ 171, 171, 1, 0, 3, 0,
+ 1, 0, 4, 0, 1, 0,
+ 0, 0, 0, 0, 0, 0,
+ 116, 101, 120, 48, 0, 171,
+ 171, 171, 4, 0, 12, 0,
+ 1, 0, 1, 0, 1, 0,
+ 0, 0, 0, 0, 0, 0,
+ 112, 115, 95, 50, 95, 48,
+ 0, 77, 105, 99, 114, 111,
+ 115, 111, 102, 116, 32, 40,
+ 82, 41, 32, 72, 76, 83,
+ 76, 32, 83, 104, 97, 100,
+ 101, 114, 32, 67, 111, 109,
+ 112, 105, 108, 101, 114, 32,
+ 57, 46, 50, 57, 46, 57,
+ 53, 50, 46, 51, 49, 49,
+ 49, 0, 31, 0, 0, 2,
+ 0, 0, 0, 128, 0, 0,
+ 7, 176, 31, 0, 0, 2,
+ 0, 0, 0, 128, 0, 0,
+ 15, 144, 31, 0, 0, 2,
+ 0, 0, 0, 144, 0, 8,
+ 15, 160, 66, 0, 0, 3,
+ 0, 0, 15, 128, 0, 0,
+ 228, 176, 0, 8, 228, 160,
+ 4, 0, 0, 4, 0, 0,
+ 7, 128, 0, 0, 228, 144,
+ 0, 0, 228, 128, 0, 0,
+ 228, 161, 5, 0, 0, 3,
+ 1, 0, 8, 128, 0, 0,
+ 255, 128, 0, 0, 255, 144,
+ 4, 0, 0, 4, 1, 0,
+ 7, 128, 0, 0, 170, 176,
+ 0, 0, 228, 128, 0, 0,
+ 228, 160, 1, 0, 0, 2,
+ 0, 8, 15, 128, 1, 0,
+ 228, 128, 255, 255, 0, 0
+};
diff --git a/src/d3d/shaders/lighting.h b/src/d3d/shaders/lighting.h
new file mode 100644
index 0000000..4b08196
--- /dev/null
+++ b/src/d3d/shaders/lighting.h
@@ -0,0 +1,44 @@
+struct Light
+{
+ float4 color; // and radius
+ float4 position; // and -cos(angle)
+ float4 direction; // and falloff clamp
+};
+
+float3 DoDirLight(Light L, float3 N)
+{
+ float l = max(0.0, dot(N, -L.direction.xyz));
+ return l*L.color.xyz;
+}
+
+float3 DoDirLightSpec(Light L, float3 N, float3 V, float power)
+{
+ return pow(saturate(dot(N, normalize(V + -L.direction.xyz))), power)*L.color.xyz;
+}
+
+float3 DoPointLight(Light L, float3 V, float3 N)
+{
+ // As on PS2
+ float3 dir = V - L.position.xyz;
+ float dist = length(dir);
+ float atten = max(0.0, (1.0 - dist/L.color.w));
+ float l = max(0.0, dot(N, -normalize(dir)));
+ return l*L.color.xyz*atten;
+}
+
+float3 DoSpotLight(Light L, float3 V, float3 N)
+{
+ // As on PS2
+ float3 dir = V - L.position.xyz;
+ float dist = length(dir);
+ float atten = max(0.0, (1.0 - dist/L.color.w));
+ dir /= dist;
+ float l = max(0.0, dot(N, -dir));
+ float pcos = dot(dir, L.direction.xyz); // cos to point
+ float ccos = -L.position.w; // cos of cone
+ float falloff = (pcos-ccos)/(1.0-ccos);
+ if(falloff < 0) // outside of cone
+ l = 0;
+ l *= max(falloff, L.direction.w); // falloff clamp
+ return l*L.color.xyz*atten;
+}
diff --git a/src/d3d/shaders/make_default.cmd b/src/d3d/shaders/make_default.cmd
new file mode 100644
index 0000000..bc44429
--- /dev/null
+++ b/src/d3d/shaders/make_default.cmd
@@ -0,0 +1,11 @@
+@echo off
+"%DXSDK_DIR%\utilities\bin\x86\fxc.exe" /nologo /T vs_2_0 /Fh default_amb_VS.h default_VS.hlsl
+"%DXSDK_DIR%\utilities\bin\x86\fxc.exe" /nologo /T vs_2_0 /DDIRECTIONALS /Fh default_amb_dir_VS.h default_VS.hlsl
+"%DXSDK_DIR%\utilities\bin\x86\fxc.exe" /nologo /T vs_2_0 /DDIRECTIONALS /DPOINTLIGHTS /DSPOTLIGHTS /Fh default_all_VS.h default_VS.hlsl
+
+"%DXSDK_DIR%\utilities\bin\x86\fxc.exe" /nologo /T ps_2_0 /Fh default_PS.h default_PS.hlsl
+"%DXSDK_DIR%\utilities\bin\x86\fxc.exe" /nologo /T ps_2_0 /DTEX /Fh default_tex_PS.h default_PS.hlsl
+
+"%DXSDK_DIR%\utilities\bin\x86\fxc.exe" /nologo /T vs_2_0 /Fh im2d_VS.h im2d_VS.hlsl
+"%DXSDK_DIR%\utilities\bin\x86\fxc.exe" /nologo /T ps_2_0 /Fh im2d_PS.h im2d_PS.hlsl
+"%DXSDK_DIR%\utilities\bin\x86\fxc.exe" /nologo /T ps_2_0 /DTEX /Fh im2d_tex_PS.h im2d_PS.hlsl
diff --git a/src/d3d/shaders/make_matfx.cmd b/src/d3d/shaders/make_matfx.cmd
new file mode 100644
index 0000000..d0bc4fa
--- /dev/null
+++ b/src/d3d/shaders/make_matfx.cmd
@@ -0,0 +1,7 @@
+@echo off
+"%DXSDK_DIR%\utilities\bin\x86\fxc.exe" /nologo /T vs_2_0 /Fh matfx_env_amb_VS.h matfx_env_VS.hlsl
+"%DXSDK_DIR%\utilities\bin\x86\fxc.exe" /nologo /T vs_2_0 /DDIRECTIONALS /Fh matfx_env_amb_dir_VS.h matfx_env_VS.hlsl
+"%DXSDK_DIR%\utilities\bin\x86\fxc.exe" /nologo /T vs_2_0 /DDIRECTIONALS /DPOINTLIGHTS /DSPOTLIGHTS /Fh matfx_env_all_VS.h matfx_env_VS.hlsl
+
+"%DXSDK_DIR%\utilities\bin\x86\fxc.exe" /nologo /T ps_2_0 /Fh matfx_env_PS.h matfx_env_PS.hlsl
+"%DXSDK_DIR%\utilities\bin\x86\fxc.exe" /nologo /T ps_2_0 /DTEX /Fh matfx_env_tex_PS.h matfx_env_PS.hlsl
diff --git a/src/d3d/shaders/make_skin.cmd b/src/d3d/shaders/make_skin.cmd
new file mode 100644
index 0000000..b7822ca
--- /dev/null
+++ b/src/d3d/shaders/make_skin.cmd
@@ -0,0 +1,4 @@
+@echo off
+"%DXSDK_DIR%\utilities\bin\x86\fxc.exe" /nologo /T vs_2_0 /Fh skin_amb_VS.h skin_VS.hlsl
+"%DXSDK_DIR%\utilities\bin\x86\fxc.exe" /nologo /T vs_2_0 /DDIRECTIONALS /Fh skin_amb_dir_VS.h skin_VS.hlsl
+"%DXSDK_DIR%\utilities\bin\x86\fxc.exe" /nologo /T vs_2_0 /DDIRECTIONALS /DPOINTLIGHTS /DSPOTLIGHTS /Fh skin_all_VS.h skin_VS.hlsl
diff --git a/src/d3d/shaders/matfx_env_PS.h b/src/d3d/shaders/matfx_env_PS.h
new file mode 100644
index 0000000..e39a1f5
--- /dev/null
+++ b/src/d3d/shaders/matfx_env_PS.h
@@ -0,0 +1,124 @@
+#if 0
+//
+// Generated by Microsoft (R) HLSL Shader Compiler 9.29.952.3111
+//
+// fxc /nologo /T ps_2_0 /Fh matfx_env_PS.h matfx_env_PS.hlsl
+//
+//
+// Parameters:
+//
+// sampler2D envTex;
+// float4 fogColor;
+// float4 fxparams;
+//
+//
+// Registers:
+//
+// Name Reg Size
+// ------------ ----- ----
+// fogColor c0 1
+// fxparams c1 1
+// envTex s1 1
+//
+
+ ps_2_0
+ dcl t0.xyz
+ dcl t1.xy
+ dcl v0
+ dcl v1.xyz
+ dcl_2d s1
+ texld r0, t1, s1
+ mul r1.xyz, v1, c1.x
+ mul r0.xyz, r0, r1
+ mul r0.xyz, r0, t0.z
+ max r0.w, v0.w, c1.y
+ mul r0.xyz, r0.w, r0
+ add r1.xyz, v0, -c0
+ mad r1.xyz, t0.z, r1, c0
+ mad r0.xyz, r1, v0.w, r0
+ mov r0.w, v0.w
+ mov oC0, r0
+
+// approximately 11 instruction slots used (1 texture, 10 arithmetic)
+#endif
+
+const BYTE g_ps20_main[] =
+{
+ 0, 2, 255, 255, 254, 255,
+ 53, 0, 67, 84, 65, 66,
+ 28, 0, 0, 0, 156, 0,
+ 0, 0, 0, 2, 255, 255,
+ 3, 0, 0, 0, 28, 0,
+ 0, 0, 0, 1, 0, 0,
+ 149, 0, 0, 0, 88, 0,
+ 0, 0, 3, 0, 1, 0,
+ 1, 0, 6, 0, 96, 0,
+ 0, 0, 0, 0, 0, 0,
+ 112, 0, 0, 0, 2, 0,
+ 0, 0, 1, 0, 2, 0,
+ 124, 0, 0, 0, 0, 0,
+ 0, 0, 140, 0, 0, 0,
+ 2, 0, 1, 0, 1, 0,
+ 6, 0, 124, 0, 0, 0,
+ 0, 0, 0, 0, 101, 110,
+ 118, 84, 101, 120, 0, 171,
+ 4, 0, 12, 0, 1, 0,
+ 1, 0, 1, 0, 0, 0,
+ 0, 0, 0, 0, 102, 111,
+ 103, 67, 111, 108, 111, 114,
+ 0, 171, 171, 171, 1, 0,
+ 3, 0, 1, 0, 4, 0,
+ 1, 0, 0, 0, 0, 0,
+ 0, 0, 102, 120, 112, 97,
+ 114, 97, 109, 115, 0, 112,
+ 115, 95, 50, 95, 48, 0,
+ 77, 105, 99, 114, 111, 115,
+ 111, 102, 116, 32, 40, 82,
+ 41, 32, 72, 76, 83, 76,
+ 32, 83, 104, 97, 100, 101,
+ 114, 32, 67, 111, 109, 112,
+ 105, 108, 101, 114, 32, 57,
+ 46, 50, 57, 46, 57, 53,
+ 50, 46, 51, 49, 49, 49,
+ 0, 171, 171, 171, 31, 0,
+ 0, 2, 0, 0, 0, 128,
+ 0, 0, 7, 176, 31, 0,
+ 0, 2, 0, 0, 0, 128,
+ 1, 0, 3, 176, 31, 0,
+ 0, 2, 0, 0, 0, 128,
+ 0, 0, 15, 144, 31, 0,
+ 0, 2, 0, 0, 0, 128,
+ 1, 0, 7, 144, 31, 0,
+ 0, 2, 0, 0, 0, 144,
+ 1, 8, 15, 160, 66, 0,
+ 0, 3, 0, 0, 15, 128,
+ 1, 0, 228, 176, 1, 8,
+ 228, 160, 5, 0, 0, 3,
+ 1, 0, 7, 128, 1, 0,
+ 228, 144, 1, 0, 0, 160,
+ 5, 0, 0, 3, 0, 0,
+ 7, 128, 0, 0, 228, 128,
+ 1, 0, 228, 128, 5, 0,
+ 0, 3, 0, 0, 7, 128,
+ 0, 0, 228, 128, 0, 0,
+ 170, 176, 11, 0, 0, 3,
+ 0, 0, 8, 128, 0, 0,
+ 255, 144, 1, 0, 85, 160,
+ 5, 0, 0, 3, 0, 0,
+ 7, 128, 0, 0, 255, 128,
+ 0, 0, 228, 128, 2, 0,
+ 0, 3, 1, 0, 7, 128,
+ 0, 0, 228, 144, 0, 0,
+ 228, 161, 4, 0, 0, 4,
+ 1, 0, 7, 128, 0, 0,
+ 170, 176, 1, 0, 228, 128,
+ 0, 0, 228, 160, 4, 0,
+ 0, 4, 0, 0, 7, 128,
+ 1, 0, 228, 128, 0, 0,
+ 255, 144, 0, 0, 228, 128,
+ 1, 0, 0, 2, 0, 0,
+ 8, 128, 0, 0, 255, 144,
+ 1, 0, 0, 2, 0, 8,
+ 15, 128, 0, 0, 228, 128,
+ 255, 255, 0, 0
+};
diff --git a/src/d3d/shaders/matfx_env_PS.hlsl b/src/d3d/shaders/matfx_env_PS.hlsl
new file mode 100644
index 0000000..eb5187d
--- /dev/null
+++ b/src/d3d/shaders/matfx_env_PS.hlsl
@@ -0,0 +1,42 @@
+struct VS_out {
+ float4 Position : POSITION;
+ float3 TexCoord0 : TEXCOORD0;
+ float2 TexCoord1 : TEXCOORD1;
+ float4 Color : COLOR0;
+ float4 EnvColor : COLOR1;
+};
+
+sampler2D diffTex : register(s0);
+sampler2D envTex : register(s1);
+
+float4 fogColor : register(c0);
+
+float4 fxparams : register(c1);
+
+#define shininess (fxparams.x)
+#define disableFBA (fxparams.y)
+
+float4 main(VS_out input) : COLOR
+{
+ float4 pass1 = input.Color;
+#ifdef TEX
+ pass1 *= tex2D(diffTex, input.TexCoord0.xy);
+#endif
+
+ float4 pass2 = input.EnvColor*shininess*tex2D(envTex, input.TexCoord1.xy);
+
+ pass1.rgb = lerp(fogColor.rgb, pass1.rgb, input.TexCoord0.z);
+ pass2.rgb = lerp(float3(0.0, 0.0, 0.0), pass2.rgb, input.TexCoord0.z);
+
+ // We simulate drawing this in two passes.
+ // First pass with standard blending, second with addition
+ // We premultiply alpha so render state should be one.
+ // For FB alpha rendering assume that diffuse alpha (pass1.a) was
+ // written to framebuffer, so just multiply pass2 by it as well then.
+ float fba = max(pass1.a, disableFBA);
+ float4 color;
+ color.rgb = pass1.rgb*pass1.a + pass2.rgb*fba;
+ color.a = pass1.a;
+
+ return color;
+}
diff --git a/src/d3d/shaders/matfx_env_VS.hlsl b/src/d3d/shaders/matfx_env_VS.hlsl
new file mode 100644
index 0000000..31b674c
--- /dev/null
+++ b/src/d3d/shaders/matfx_env_VS.hlsl
@@ -0,0 +1,59 @@
+#include "standardConstants.h"
+
+float4x4 texMat : register(c41);
+float4 colorClamp : register(c45);
+float4 envColor : register(c46);
+
+struct VS_in
+{
+ float4 Position : POSITION;
+ float3 Normal : NORMAL;
+ float2 TexCoord : TEXCOORD0;
+ float4 Prelight : COLOR0;
+};
+
+struct VS_out {
+ float4 Position : POSITION;
+ float3 TexCoord0 : TEXCOORD0; // also fog
+ float2 TexCoord1 : TEXCOORD1;
+ float4 Color : COLOR0;
+ float4 EnvColor : COLOR1;
+};
+
+
+VS_out main(in VS_in input)
+{
+ VS_out output;
+
+ output.Position = mul(combinedMat, input.Position);
+ float3 V = mul(worldMat, input.Position).xyz;
+ float3 N = mul(normalMat, input.Normal);
+
+ output.TexCoord0.xy = input.TexCoord;
+ output.TexCoord1 = mul(texMat, float4(N, 1.0)).xy;
+
+ output.Color = input.Prelight;
+ output.Color.rgb += ambientLight.rgb * surfAmbient;
+
+ int i;
+#ifdef DIRECTIONALS
+ for(i = 0; i < numDirLights; i++)
+ output.Color.xyz += DoDirLight(lights[i+firstDirLight], N)*surfDiffuse;
+#endif
+#ifdef POINTLIGHTS
+ for(i = 0; i < numPointLights; i++)
+ output.Color.xyz += DoPointLight(lights[i+firstPointLight], V, N)*surfDiffuse;
+#endif
+#ifdef SPOTLIGHTS
+ for(i = 0; i < numSpotLights; i++)
+ output.Color.xyz += DoSpotLight(lights[i+firstSpotLight], V, N)*surfDiffuse;
+#endif
+ // PS2 clamps before material color
+ output.Color = clamp(output.Color, 0.0, 1.0);
+ output.EnvColor = max(output.Color, colorClamp) * envColor;
+ output.Color *= matCol;
+
+ output.TexCoord0.z = clamp((output.Position.w - fogEnd)*fogRange, fogDisable, 1.0);
+
+ return output;
+}
diff --git a/src/d3d/shaders/matfx_env_all_VS.h b/src/d3d/shaders/matfx_env_all_VS.h
new file mode 100644
index 0000000..65e1c15
--- /dev/null
+++ b/src/d3d/shaders/matfx_env_all_VS.h
@@ -0,0 +1,535 @@
+#if 0
+//
+// Generated by Microsoft (R) HLSL Shader Compiler 9.29.952.3111
+//
+// fxc /nologo /T vs_2_0 /DDIRECTIONALS /DPOINTLIGHTS /DSPOTLIGHTS /Fh
+// matfx_env_all_VS.h matfx_env_VS.hlsl
+//
+//
+// Parameters:
+//
+// float4 ambientLight;
+// float4 colorClamp;
+// float4x4 combinedMat;
+// float4 envColor;
+// int4 firstLight;
+// float4 fogData;
+//
+// struct
+// {
+// float4 color;
+// float4 position;
+// float4 direction;
+//
+// } lights[8];
+//
+// float4 matCol;
+// float3x3 normalMat;
+// int numDirLights;
+// int numPointLights;
+// int numSpotLights;
+// float4 surfProps;
+// float4x4 texMat;
+// float4x4 worldMat;
+//
+//
+// Registers:
+//
+// Name Reg Size
+// -------------- ----- ----
+// numDirLights i0 1
+// numPointLights i1 1
+// numSpotLights i2 1
+// combinedMat c0 4
+// worldMat c4 4
+// normalMat c8 3
+// matCol c12 1
+// surfProps c13 1
+// fogData c14 1
+// ambientLight c15 1
+// firstLight c16 1
+// lights c17 24
+// texMat c41 4
+// colorClamp c45 1
+// envColor c46 1
+//
+
+ vs_2_0
+ def c11, 0, 3, 1, 0
+ dcl_position v0
+ dcl_normal v1
+ dcl_texcoord v2
+ dcl_color v3
+ mul r0, v0.y, c1
+ mad r0, c0, v0.x, r0
+ mad r0, c2, v0.z, r0
+ mad r0, c3, v0.w, r0
+ mov oPos, r0
+ mul r0.xyz, v0.y, c5
+ mad r0.xyz, c4, v0.x, r0
+ mad r0.xyz, c6, v0.z, r0
+ mad r0.xyz, c7, v0.w, r0
+ mul r1.xyz, v1.y, c9
+ mad r1.xyz, c8, v1.x, r1
+ mad r1.xyz, c10, v1.z, r1
+ mov r2.x, c13.x
+ mad r2.xyz, c15, r2.x, v3
+ mov r3.xyz, r2
+ mov r1.w, c11.x
+ rep i0
+ add r2.w, r1.w, c16.x
+ mul r2.w, r2.w, c11.y
+ mova a0.x, r2.w
+ dp3 r2.w, r1, -c19[a0.x]
+ max r2.w, r2.w, c11.x
+ mul r4.xyz, r2.w, c17[a0.x]
+ mad r3.xyz, r4, c13.z, r3
+ add r1.w, r1.w, c11.z
+ endrep
+ mov r2.xyz, r3
+ mov r1.w, c11.x
+ rep i1
+ add r2.w, r1.w, c16.y
+ mul r2.w, r2.w, c11.y
+ mova a0.x, r2.w
+ add r4.xyz, r0, -c18[a0.x]
+ dp3 r2.w, r4, r4
+ rsq r2.w, r2.w
+ mul r4.xyz, r2.w, r4
+ dp3 r3.w, r1, -r4
+ max r3.w, r3.w, c11.x
+ mul r4.xyz, r3.w, c17[a0.x]
+ rcp r2.w, r2.w
+ rcp r3.w, c17[a0.x].w
+ mad r2.w, r2.w, -r3.w, c11.z
+ max r2.w, r2.w, c11.x
+ mul r4.xyz, r2.w, r4
+ mad r2.xyz, r4, c13.z, r2
+ add r1.w, r1.w, c11.z
+ endrep
+ mov r3.xyz, r2
+ mov r1.w, c11.x
+ rep i2
+ add r2.w, r1.w, c16.z
+ mul r2.w, r2.w, c11.y
+ mova a0.x, r2.w
+ add r4.xyz, r0, -c18[a0.x]
+ dp3 r2.w, r4, r4
+ rsq r2.w, r2.w
+ mul r4.xyz, r2.w, r4
+ dp3 r4.w, r1, -r4
+ dp3 r4.x, r4, c19[a0.x]
+ max r4.y, r4.w, c11.x
+ mov r4.z, c11.z
+ add r4.xz, r4, c18[a0.x].w
+ rcp r4.z, r4.z
+ mul r4.x, r4.z, r4.x
+ slt r4.z, r4.x, c11.x
+ mad r4.y, r4.z, -r4.y, r4.y
+ max r4.x, r4.x, c19[a0.x].w
+ mul r4.x, r4.x, r4.y
+ mul r4.xyz, r4.x, c17[a0.x]
+ rcp r2.w, r2.w
+ rcp r4.w, c17[a0.x].w
+ mad r2.w, r2.w, -r4.w, c11.z
+ max r2.w, r2.w, c11.x
+ mul r4.xyz, r2.w, r4
+ mad r3.xyz, r4, c13.z, r3
+ add r1.w, r1.w, c11.z
+ endrep
+ mov r3.w, v3.w
+ max r2, r3, c11.x
+ min r2, r2, c11.z
+ mul oD0, r2, c12
+ mul r0.xy, r1.y, c42
+ mad r0.xy, c41, r1.x, r0
+ mad r0.xy, c43, r1.z, r0
+ add oT1.xy, r0, c44
+ max r1, r2, c45
+ mul oD1, r1, c46
+ add r0.x, r0.w, -c14.y
+ mul r0.x, r0.x, c14.z
+ max r0.x, r0.x, c14.w
+ min oT0.z, r0.x, c11.z
+ mov oT0.xy, v2
+
+// approximately 101 instruction slots used
+#endif
+
+const BYTE g_vs20_main[] =
+{
+ 0, 2, 254, 255, 254, 255,
+ 180, 0, 67, 84, 65, 66,
+ 28, 0, 0, 0, 154, 2,
+ 0, 0, 0, 2, 254, 255,
+ 15, 0, 0, 0, 28, 0,
+ 0, 0, 0, 1, 0, 0,
+ 147, 2, 0, 0, 72, 1,
+ 0, 0, 2, 0, 15, 0,
+ 1, 0, 62, 0, 88, 1,
+ 0, 0, 0, 0, 0, 0,
+ 104, 1, 0, 0, 2, 0,
+ 45, 0, 1, 0, 182, 0,
+ 88, 1, 0, 0, 0, 0,
+ 0, 0, 115, 1, 0, 0,
+ 2, 0, 0, 0, 4, 0,
+ 2, 0, 128, 1, 0, 0,
+ 0, 0, 0, 0, 144, 1,
+ 0, 0, 2, 0, 46, 0,
+ 1, 0, 186, 0, 88, 1,
+ 0, 0, 0, 0, 0, 0,
+ 153, 1, 0, 0, 2, 0,
+ 16, 0, 1, 0, 66, 0,
+ 164, 1, 0, 0, 0, 0,
+ 0, 0, 180, 1, 0, 0,
+ 2, 0, 14, 0, 1, 0,
+ 58, 0, 88, 1, 0, 0,
+ 0, 0, 0, 0, 188, 1,
+ 0, 0, 2, 0, 17, 0,
+ 24, 0, 70, 0, 8, 2,
+ 0, 0, 0, 0, 0, 0,
+ 24, 2, 0, 0, 2, 0,
+ 12, 0, 1, 0, 50, 0,
+ 88, 1, 0, 0, 0, 0,
+ 0, 0, 31, 2, 0, 0,
+ 2, 0, 8, 0, 3, 0,
+ 34, 0, 44, 2, 0, 0,
+ 0, 0, 0, 0, 60, 2,
+ 0, 0, 1, 0, 0, 0,
+ 1, 0, 2, 0, 76, 2,
+ 0, 0, 0, 0, 0, 0,
+ 92, 2, 0, 0, 1, 0,
+ 1, 0, 1, 0, 6, 0,
+ 76, 2, 0, 0, 0, 0,
+ 0, 0, 107, 2, 0, 0,
+ 1, 0, 2, 0, 1, 0,
+ 10, 0, 76, 2, 0, 0,
+ 0, 0, 0, 0, 121, 2,
+ 0, 0, 2, 0, 13, 0,
+ 1, 0, 54, 0, 88, 1,
+ 0, 0, 0, 0, 0, 0,
+ 131, 2, 0, 0, 2, 0,
+ 41, 0, 4, 0, 166, 0,
+ 128, 1, 0, 0, 0, 0,
+ 0, 0, 138, 2, 0, 0,
+ 2, 0, 4, 0, 4, 0,
+ 18, 0, 128, 1, 0, 0,
+ 0, 0, 0, 0, 97, 109,
+ 98, 105, 101, 110, 116, 76,
+ 105, 103, 104, 116, 0, 171,
+ 171, 171, 1, 0, 3, 0,
+ 1, 0, 4, 0, 1, 0,
+ 0, 0, 0, 0, 0, 0,
+ 99, 111, 108, 111, 114, 67,
+ 108, 97, 109, 112, 0, 99,
+ 111, 109, 98, 105, 110, 101,
+ 100, 77, 97, 116, 0, 171,
+ 3, 0, 3, 0, 4, 0,
+ 4, 0, 1, 0, 0, 0,
+ 0, 0, 0, 0, 101, 110,
+ 118, 67, 111, 108, 111, 114,
+ 0, 102, 105, 114, 115, 116,
+ 76, 105, 103, 104, 116, 0,
+ 1, 0, 2, 0, 1, 0,
+ 4, 0, 1, 0, 0, 0,
+ 0, 0, 0, 0, 102, 111,
+ 103, 68, 97, 116, 97, 0,
+ 108, 105, 103, 104, 116, 115,
+ 0, 99, 111, 108, 111, 114,
+ 0, 171, 171, 171, 1, 0,
+ 3, 0, 1, 0, 4, 0,
+ 1, 0, 0, 0, 0, 0,
+ 0, 0, 112, 111, 115, 105,
+ 116, 105, 111, 110, 0, 100,
+ 105, 114, 101, 99, 116, 105,
+ 111, 110, 0, 171, 195, 1,
+ 0, 0, 204, 1, 0, 0,
+ 220, 1, 0, 0, 204, 1,
+ 0, 0, 229, 1, 0, 0,
+ 204, 1, 0, 0, 5, 0,
+ 0, 0, 1, 0, 12, 0,
+ 8, 0, 3, 0, 240, 1,
+ 0, 0, 109, 97, 116, 67,
+ 111, 108, 0, 110, 111, 114,
+ 109, 97, 108, 77, 97, 116,
+ 0, 171, 171, 171, 3, 0,
+ 3, 0, 3, 0, 3, 0,
+ 1, 0, 0, 0, 0, 0,
+ 0, 0, 110, 117, 109, 68,
+ 105, 114, 76, 105, 103, 104,
+ 116, 115, 0, 171, 171, 171,
+ 0, 0, 2, 0, 1, 0,
+ 1, 0, 1, 0, 0, 0,
+ 0, 0, 0, 0, 110, 117,
+ 109, 80, 111, 105, 110, 116,
+ 76, 105, 103, 104, 116, 115,
+ 0, 110, 117, 109, 83, 112,
+ 111, 116, 76, 105, 103, 104,
+ 116, 115, 0, 115, 117, 114,
+ 102, 80, 114, 111, 112, 115,
+ 0, 116, 101, 120, 77, 97,
+ 116, 0, 119, 111, 114, 108,
+ 100, 77, 97, 116, 0, 118,
+ 115, 95, 50, 95, 48, 0,
+ 77, 105, 99, 114, 111, 115,
+ 111, 102, 116, 32, 40, 82,
+ 41, 32, 72, 76, 83, 76,
+ 32, 83, 104, 97, 100, 101,
+ 114, 32, 67, 111, 109, 112,
+ 105, 108, 101, 114, 32, 57,
+ 46, 50, 57, 46, 57, 53,
+ 50, 46, 51, 49, 49, 49,
+ 0, 171, 81, 0, 0, 5,
+ 11, 0, 15, 160, 0, 0,
+ 0, 0, 0, 0, 64, 64,
+ 0, 0, 128, 63, 0, 0,
+ 0, 0, 31, 0, 0, 2,
+ 0, 0, 0, 128, 0, 0,
+ 15, 144, 31, 0, 0, 2,
+ 3, 0, 0, 128, 1, 0,
+ 15, 144, 31, 0, 0, 2,
+ 5, 0, 0, 128, 2, 0,
+ 15, 144, 31, 0, 0, 2,
+ 10, 0, 0, 128, 3, 0,
+ 15, 144, 5, 0, 0, 3,
+ 0, 0, 15, 128, 0, 0,
+ 85, 144, 1, 0, 228, 160,
+ 4, 0, 0, 4, 0, 0,
+ 15, 128, 0, 0, 228, 160,
+ 0, 0, 0, 144, 0, 0,
+ 228, 128, 4, 0, 0, 4,
+ 0, 0, 15, 128, 2, 0,
+ 228, 160, 0, 0, 170, 144,
+ 0, 0, 228, 128, 4, 0,
+ 0, 4, 0, 0, 15, 128,
+ 3, 0, 228, 160, 0, 0,
+ 255, 144, 0, 0, 228, 128,
+ 1, 0, 0, 2, 0, 0,
+ 15, 192, 0, 0, 228, 128,
+ 5, 0, 0, 3, 0, 0,
+ 7, 128, 0, 0, 85, 144,
+ 5, 0, 228, 160, 4, 0,
+ 0, 4, 0, 0, 7, 128,
+ 4, 0, 228, 160, 0, 0,
+ 0, 144, 0, 0, 228, 128,
+ 4, 0, 0, 4, 0, 0,
+ 7, 128, 6, 0, 228, 160,
+ 0, 0, 170, 144, 0, 0,
+ 228, 128, 4, 0, 0, 4,
+ 0, 0, 7, 128, 7, 0,
+ 228, 160, 0, 0, 255, 144,
+ 0, 0, 228, 128, 5, 0,
+ 0, 3, 1, 0, 7, 128,
+ 1, 0, 85, 144, 9, 0,
+ 228, 160, 4, 0, 0, 4,
+ 1, 0, 7, 128, 8, 0,
+ 228, 160, 1, 0, 0, 144,
+ 1, 0, 228, 128, 4, 0,
+ 0, 4, 1, 0, 7, 128,
+ 10, 0, 228, 160, 1, 0,
+ 170, 144, 1, 0, 228, 128,
+ 1, 0, 0, 2, 2, 0,
+ 1, 128, 13, 0, 0, 160,
+ 4, 0, 0, 4, 2, 0,
+ 7, 128, 15, 0, 228, 160,
+ 2, 0, 0, 128, 3, 0,
+ 228, 144, 1, 0, 0, 2,
+ 3, 0, 7, 128, 2, 0,
+ 228, 128, 1, 0, 0, 2,
+ 1, 0, 8, 128, 11, 0,
+ 0, 160, 38, 0, 0, 1,
+ 0, 0, 228, 240, 2, 0,
+ 0, 3, 2, 0, 8, 128,
+ 1, 0, 255, 128, 16, 0,
+ 0, 160, 5, 0, 0, 3,
+ 2, 0, 8, 128, 2, 0,
+ 255, 128, 11, 0, 85, 160,
+ 46, 0, 0, 2, 0, 0,
+ 1, 176, 2, 0, 255, 128,
+ 8, 0, 0, 4, 2, 0,
+ 8, 128, 1, 0, 228, 128,
+ 19, 32, 228, 161, 0, 0,
+ 0, 176, 11, 0, 0, 3,
+ 2, 0, 8, 128, 2, 0,
+ 255, 128, 11, 0, 0, 160,
+ 5, 0, 0, 4, 4, 0,
+ 7, 128, 2, 0, 255, 128,
+ 17, 32, 228, 160, 0, 0,
+ 0, 176, 4, 0, 0, 4,
+ 3, 0, 7, 128, 4, 0,
+ 228, 128, 13, 0, 170, 160,
+ 3, 0, 228, 128, 2, 0,
+ 0, 3, 1, 0, 8, 128,
+ 1, 0, 255, 128, 11, 0,
+ 170, 160, 39, 0, 0, 0,
+ 1, 0, 0, 2, 2, 0,
+ 7, 128, 3, 0, 228, 128,
+ 1, 0, 0, 2, 1, 0,
+ 8, 128, 11, 0, 0, 160,
+ 38, 0, 0, 1, 1, 0,
+ 228, 240, 2, 0, 0, 3,
+ 2, 0, 8, 128, 1, 0,
+ 255, 128, 16, 0, 85, 160,
+ 5, 0, 0, 3, 2, 0,
+ 8, 128, 2, 0, 255, 128,
+ 11, 0, 85, 160, 46, 0,
+ 0, 2, 0, 0, 1, 176,
+ 2, 0, 255, 128, 2, 0,
+ 0, 4, 4, 0, 7, 128,
+ 0, 0, 228, 128, 18, 32,
+ 228, 161, 0, 0, 0, 176,
+ 8, 0, 0, 3, 2, 0,
+ 8, 128, 4, 0, 228, 128,
+ 4, 0, 228, 128, 7, 0,
+ 0, 2, 2, 0, 8, 128,
+ 2, 0, 255, 128, 5, 0,
+ 0, 3, 4, 0, 7, 128,
+ 2, 0, 255, 128, 4, 0,
+ 228, 128, 8, 0, 0, 3,
+ 3, 0, 8, 128, 1, 0,
+ 228, 128, 4, 0, 228, 129,
+ 11, 0, 0, 3, 3, 0,
+ 8, 128, 3, 0, 255, 128,
+ 11, 0, 0, 160, 5, 0,
+ 0, 4, 4, 0, 7, 128,
+ 3, 0, 255, 128, 17, 32,
+ 228, 160, 0, 0, 0, 176,
+ 6, 0, 0, 2, 2, 0,
+ 8, 128, 2, 0, 255, 128,
+ 6, 0, 0, 3, 3, 0,
+ 8, 128, 17, 32, 255, 160,
+ 0, 0, 0, 176, 4, 0,
+ 0, 4, 2, 0, 8, 128,
+ 2, 0, 255, 128, 3, 0,
+ 255, 129, 11, 0, 170, 160,
+ 11, 0, 0, 3, 2, 0,
+ 8, 128, 2, 0, 255, 128,
+ 11, 0, 0, 160, 5, 0,
+ 0, 3, 4, 0, 7, 128,
+ 2, 0, 255, 128, 4, 0,
+ 228, 128, 4, 0, 0, 4,
+ 2, 0, 7, 128, 4, 0,
+ 228, 128, 13, 0, 170, 160,
+ 2, 0, 228, 128, 2, 0,
+ 0, 3, 1, 0, 8, 128,
+ 1, 0, 255, 128, 11, 0,
+ 170, 160, 39, 0, 0, 0,
+ 1, 0, 0, 2, 3, 0,
+ 7, 128, 2, 0, 228, 128,
+ 1, 0, 0, 2, 1, 0,
+ 8, 128, 11, 0, 0, 160,
+ 38, 0, 0, 1, 2, 0,
+ 228, 240, 2, 0, 0, 3,
+ 2, 0, 8, 128, 1, 0,
+ 255, 128, 16, 0, 170, 160,
+ 5, 0, 0, 3, 2, 0,
+ 8, 128, 2, 0, 255, 128,
+ 11, 0, 85, 160, 46, 0,
+ 0, 2, 0, 0, 1, 176,
+ 2, 0, 255, 128, 2, 0,
+ 0, 4, 4, 0, 7, 128,
+ 0, 0, 228, 128, 18, 32,
+ 228, 161, 0, 0, 0, 176,
+ 8, 0, 0, 3, 2, 0,
+ 8, 128, 4, 0, 228, 128,
+ 4, 0, 228, 128, 7, 0,
+ 0, 2, 2, 0, 8, 128,
+ 2, 0, 255, 128, 5, 0,
+ 0, 3, 4, 0, 7, 128,
+ 2, 0, 255, 128, 4, 0,
+ 228, 128, 8, 0, 0, 3,
+ 4, 0, 8, 128, 1, 0,
+ 228, 128, 4, 0, 228, 129,
+ 8, 0, 0, 4, 4, 0,
+ 1, 128, 4, 0, 228, 128,
+ 19, 32, 228, 160, 0, 0,
+ 0, 176, 11, 0, 0, 3,
+ 4, 0, 2, 128, 4, 0,
+ 255, 128, 11, 0, 0, 160,
+ 1, 0, 0, 2, 4, 0,
+ 4, 128, 11, 0, 170, 160,
+ 2, 0, 0, 4, 4, 0,
+ 5, 128, 4, 0, 228, 128,
+ 18, 32, 255, 160, 0, 0,
+ 0, 176, 6, 0, 0, 2,
+ 4, 0, 4, 128, 4, 0,
+ 170, 128, 5, 0, 0, 3,
+ 4, 0, 1, 128, 4, 0,
+ 170, 128, 4, 0, 0, 128,
+ 12, 0, 0, 3, 4, 0,
+ 4, 128, 4, 0, 0, 128,
+ 11, 0, 0, 160, 4, 0,
+ 0, 4, 4, 0, 2, 128,
+ 4, 0, 170, 128, 4, 0,
+ 85, 129, 4, 0, 85, 128,
+ 11, 0, 0, 4, 4, 0,
+ 1, 128, 4, 0, 0, 128,
+ 19, 32, 255, 160, 0, 0,
+ 0, 176, 5, 0, 0, 3,
+ 4, 0, 1, 128, 4, 0,
+ 0, 128, 4, 0, 85, 128,
+ 5, 0, 0, 4, 4, 0,
+ 7, 128, 4, 0, 0, 128,
+ 17, 32, 228, 160, 0, 0,
+ 0, 176, 6, 0, 0, 2,
+ 2, 0, 8, 128, 2, 0,
+ 255, 128, 6, 0, 0, 3,
+ 4, 0, 8, 128, 17, 32,
+ 255, 160, 0, 0, 0, 176,
+ 4, 0, 0, 4, 2, 0,
+ 8, 128, 2, 0, 255, 128,
+ 4, 0, 255, 129, 11, 0,
+ 170, 160, 11, 0, 0, 3,
+ 2, 0, 8, 128, 2, 0,
+ 255, 128, 11, 0, 0, 160,
+ 5, 0, 0, 3, 4, 0,
+ 7, 128, 2, 0, 255, 128,
+ 4, 0, 228, 128, 4, 0,
+ 0, 4, 3, 0, 7, 128,
+ 4, 0, 228, 128, 13, 0,
+ 170, 160, 3, 0, 228, 128,
+ 2, 0, 0, 3, 1, 0,
+ 8, 128, 1, 0, 255, 128,
+ 11, 0, 170, 160, 39, 0,
+ 0, 0, 1, 0, 0, 2,
+ 3, 0, 8, 128, 3, 0,
+ 255, 144, 11, 0, 0, 3,
+ 2, 0, 15, 128, 3, 0,
+ 228, 128, 11, 0, 0, 160,
+ 10, 0, 0, 3, 2, 0,
+ 15, 128, 2, 0, 228, 128,
+ 11, 0, 170, 160, 5, 0,
+ 0, 3, 0, 0, 15, 208,
+ 2, 0, 228, 128, 12, 0,
+ 228, 160, 5, 0, 0, 3,
+ 0, 0, 3, 128, 1, 0,
+ 85, 128, 42, 0, 228, 160,
+ 4, 0, 0, 4, 0, 0,
+ 3, 128, 41, 0, 228, 160,
+ 1, 0, 0, 128, 0, 0,
+ 228, 128, 4, 0, 0, 4,
+ 0, 0, 3, 128, 43, 0,
+ 228, 160, 1, 0, 170, 128,
+ 0, 0, 228, 128, 2, 0,
+ 0, 3, 1, 0, 3, 224,
+ 0, 0, 228, 128, 44, 0,
+ 228, 160, 11, 0, 0, 3,
+ 1, 0, 15, 128, 2, 0,
+ 228, 128, 45, 0, 228, 160,
+ 5, 0, 0, 3, 1, 0,
+ 15, 208, 1, 0, 228, 128,
+ 46, 0, 228, 160, 2, 0,
+ 0, 3, 0, 0, 1, 128,
+ 0, 0, 255, 128, 14, 0,
+ 85, 161, 5, 0, 0, 3,
+ 0, 0, 1, 128, 0, 0,
+ 0, 128, 14, 0, 170, 160,
+ 11, 0, 0, 3, 0, 0,
+ 1, 128, 0, 0, 0, 128,
+ 14, 0, 255, 160, 10, 0,
+ 0, 3, 0, 0, 4, 224,
+ 0, 0, 0, 128, 11, 0,
+ 170, 160, 1, 0, 0, 2,
+ 0, 0, 3, 224, 2, 0,
+ 228, 144, 255, 255, 0, 0
+};
diff --git a/src/d3d/shaders/matfx_env_amb_VS.h b/src/d3d/shaders/matfx_env_amb_VS.h
new file mode 100644
index 0000000..0367d5e
--- /dev/null
+++ b/src/d3d/shaders/matfx_env_amb_VS.h
@@ -0,0 +1,225 @@
+#if 0
+//
+// Generated by Microsoft (R) HLSL Shader Compiler 9.29.952.3111
+//
+// fxc /nologo /T vs_2_0 /Fh matfx_env_amb_VS.h matfx_env_VS.hlsl
+//
+//
+// Parameters:
+//
+// float4 ambientLight;
+// float4 colorClamp;
+// float4x4 combinedMat;
+// float4 envColor;
+// float4 fogData;
+// float4 matCol;
+// float3x3 normalMat;
+// float4 surfProps;
+// float4x4 texMat;
+//
+//
+// Registers:
+//
+// Name Reg Size
+// ------------ ----- ----
+// combinedMat c0 4
+// normalMat c8 3
+// matCol c12 1
+// surfProps c13 1
+// fogData c14 1
+// ambientLight c15 1
+// texMat c41 4
+// colorClamp c45 1
+// envColor c46 1
+//
+
+ vs_2_0
+ def c4, 0, 1, 0, 0
+ dcl_position v0
+ dcl_normal v1
+ dcl_texcoord v2
+ dcl_color v3
+ mul r0.xyz, v1.y, c9
+ mad r0.xyz, c8, v1.x, r0
+ mad r0.xyz, c10, v1.z, r0
+ mul r0.yw, r0.y, c42.xxzy
+ mad r0.xy, c41, r0.x, r0.ywzw
+ mad r0.xy, c43, r0.z, r0
+ add oT1.xy, r0, c44
+ mov r0.xyz, c15
+ mad r0.xyz, r0, c13.x, v3
+ mov r0.w, v3.w
+ max r0, r0, c4.x
+ min r0, r0, c4.y
+ max r1, r0, c45
+ mul oD0, r0, c12
+ mul oD1, r1, c46
+ mul r0, v0.y, c1
+ mad r0, c0, v0.x, r0
+ mad r0, c2, v0.z, r0
+ mad r0, c3, v0.w, r0
+ add r1.x, r0.w, -c14.y
+ mov oPos, r0
+ mul r0.x, r1.x, c14.z
+ max r0.x, r0.x, c14.w
+ min oT0.z, r0.x, c4.y
+ mov oT0.xy, v2
+
+// approximately 25 instruction slots used
+#endif
+
+const BYTE g_vs20_main[] =
+{
+ 0, 2, 254, 255, 254, 255,
+ 103, 0, 67, 84, 65, 66,
+ 28, 0, 0, 0, 100, 1,
+ 0, 0, 0, 2, 254, 255,
+ 9, 0, 0, 0, 28, 0,
+ 0, 0, 0, 1, 0, 0,
+ 93, 1, 0, 0, 208, 0,
+ 0, 0, 2, 0, 15, 0,
+ 1, 0, 62, 0, 224, 0,
+ 0, 0, 0, 0, 0, 0,
+ 240, 0, 0, 0, 2, 0,
+ 45, 0, 1, 0, 182, 0,
+ 224, 0, 0, 0, 0, 0,
+ 0, 0, 251, 0, 0, 0,
+ 2, 0, 0, 0, 4, 0,
+ 2, 0, 8, 1, 0, 0,
+ 0, 0, 0, 0, 24, 1,
+ 0, 0, 2, 0, 46, 0,
+ 1, 0, 186, 0, 224, 0,
+ 0, 0, 0, 0, 0, 0,
+ 33, 1, 0, 0, 2, 0,
+ 14, 0, 1, 0, 58, 0,
+ 224, 0, 0, 0, 0, 0,
+ 0, 0, 41, 1, 0, 0,
+ 2, 0, 12, 0, 1, 0,
+ 50, 0, 224, 0, 0, 0,
+ 0, 0, 0, 0, 48, 1,
+ 0, 0, 2, 0, 8, 0,
+ 3, 0, 34, 0, 60, 1,
+ 0, 0, 0, 0, 0, 0,
+ 76, 1, 0, 0, 2, 0,
+ 13, 0, 1, 0, 54, 0,
+ 224, 0, 0, 0, 0, 0,
+ 0, 0, 86, 1, 0, 0,
+ 2, 0, 41, 0, 4, 0,
+ 166, 0, 8, 1, 0, 0,
+ 0, 0, 0, 0, 97, 109,
+ 98, 105, 101, 110, 116, 76,
+ 105, 103, 104, 116, 0, 171,
+ 171, 171, 1, 0, 3, 0,
+ 1, 0, 4, 0, 1, 0,
+ 0, 0, 0, 0, 0, 0,
+ 99, 111, 108, 111, 114, 67,
+ 108, 97, 109, 112, 0, 99,
+ 111, 109, 98, 105, 110, 101,
+ 100, 77, 97, 116, 0, 171,
+ 3, 0, 3, 0, 4, 0,
+ 4, 0, 1, 0, 0, 0,
+ 0, 0, 0, 0, 101, 110,
+ 118, 67, 111, 108, 111, 114,
+ 0, 102, 111, 103, 68, 97,
+ 116, 97, 0, 109, 97, 116,
+ 67, 111, 108, 0, 110, 111,
+ 114, 109, 97, 108, 77, 97,
+ 116, 0, 171, 171, 3, 0,
+ 3, 0, 3, 0, 3, 0,
+ 1, 0, 0, 0, 0, 0,
+ 0, 0, 115, 117, 114, 102,
+ 80, 114, 111, 112, 115, 0,
+ 116, 101, 120, 77, 97, 116,
+ 0, 118, 115, 95, 50, 95,
+ 48, 0, 77, 105, 99, 114,
+ 111, 115, 111, 102, 116, 32,
+ 40, 82, 41, 32, 72, 76,
+ 83, 76, 32, 83, 104, 97,
+ 100, 101, 114, 32, 67, 111,
+ 109, 112, 105, 108, 101, 114,
+ 32, 57, 46, 50, 57, 46,
+ 57, 53, 50, 46, 51, 49,
+ 49, 49, 0, 171, 171, 171,
+ 81, 0, 0, 5, 4, 0,
+ 15, 160, 0, 0, 0, 0,
+ 0, 0, 128, 63, 0, 0,
+ 0, 0, 0, 0, 0, 0,
+ 31, 0, 0, 2, 0, 0,
+ 0, 128, 0, 0, 15, 144,
+ 31, 0, 0, 2, 3, 0,
+ 0, 128, 1, 0, 15, 144,
+ 31, 0, 0, 2, 5, 0,
+ 0, 128, 2, 0, 15, 144,
+ 31, 0, 0, 2, 10, 0,
+ 0, 128, 3, 0, 15, 144,
+ 5, 0, 0, 3, 0, 0,
+ 7, 128, 1, 0, 85, 144,
+ 9, 0, 228, 160, 4, 0,
+ 0, 4, 0, 0, 7, 128,
+ 8, 0, 228, 160, 1, 0,
+ 0, 144, 0, 0, 228, 128,
+ 4, 0, 0, 4, 0, 0,
+ 7, 128, 10, 0, 228, 160,
+ 1, 0, 170, 144, 0, 0,
+ 228, 128, 5, 0, 0, 3,
+ 0, 0, 10, 128, 0, 0,
+ 85, 128, 42, 0, 96, 160,
+ 4, 0, 0, 4, 0, 0,
+ 3, 128, 41, 0, 228, 160,
+ 0, 0, 0, 128, 0, 0,
+ 237, 128, 4, 0, 0, 4,
+ 0, 0, 3, 128, 43, 0,
+ 228, 160, 0, 0, 170, 128,
+ 0, 0, 228, 128, 2, 0,
+ 0, 3, 1, 0, 3, 224,
+ 0, 0, 228, 128, 44, 0,
+ 228, 160, 1, 0, 0, 2,
+ 0, 0, 7, 128, 15, 0,
+ 228, 160, 4, 0, 0, 4,
+ 0, 0, 7, 128, 0, 0,
+ 228, 128, 13, 0, 0, 160,
+ 3, 0, 228, 144, 1, 0,
+ 0, 2, 0, 0, 8, 128,
+ 3, 0, 255, 144, 11, 0,
+ 0, 3, 0, 0, 15, 128,
+ 0, 0, 228, 128, 4, 0,
+ 0, 160, 10, 0, 0, 3,
+ 0, 0, 15, 128, 0, 0,
+ 228, 128, 4, 0, 85, 160,
+ 11, 0, 0, 3, 1, 0,
+ 15, 128, 0, 0, 228, 128,
+ 45, 0, 228, 160, 5, 0,
+ 0, 3, 0, 0, 15, 208,
+ 0, 0, 228, 128, 12, 0,
+ 228, 160, 5, 0, 0, 3,
+ 1, 0, 15, 208, 1, 0,
+ 228, 128, 46, 0, 228, 160,
+ 5, 0, 0, 3, 0, 0,
+ 15, 128, 0, 0, 85, 144,
+ 1, 0, 228, 160, 4, 0,
+ 0, 4, 0, 0, 15, 128,
+ 0, 0, 228, 160, 0, 0,
+ 0, 144, 0, 0, 228, 128,
+ 4, 0, 0, 4, 0, 0,
+ 15, 128, 2, 0, 228, 160,
+ 0, 0, 170, 144, 0, 0,
+ 228, 128, 4, 0, 0, 4,
+ 0, 0, 15, 128, 3, 0,
+ 228, 160, 0, 0, 255, 144,
+ 0, 0, 228, 128, 2, 0,
+ 0, 3, 1, 0, 1, 128,
+ 0, 0, 255, 128, 14, 0,
+ 85, 161, 1, 0, 0, 2,
+ 0, 0, 15, 192, 0, 0,
+ 228, 128, 5, 0, 0, 3,
+ 0, 0, 1, 128, 1, 0,
+ 0, 128, 14, 0, 170, 160,
+ 11, 0, 0, 3, 0, 0,
+ 1, 128, 0, 0, 0, 128,
+ 14, 0, 255, 160, 10, 0,
+ 0, 3, 0, 0, 4, 224,
+ 0, 0, 0, 128, 4, 0,
+ 85, 160, 1, 0, 0, 2,
+ 0, 0, 3, 224, 2, 0,
+ 228, 144, 255, 255, 0, 0
+};
diff --git a/src/d3d/shaders/matfx_env_amb_dir_VS.h b/src/d3d/shaders/matfx_env_amb_dir_VS.h
new file mode 100644
index 0000000..b93e572
--- /dev/null
+++ b/src/d3d/shaders/matfx_env_amb_dir_VS.h
@@ -0,0 +1,316 @@
+#if 0
+//
+// Generated by Microsoft (R) HLSL Shader Compiler 9.29.952.3111
+//
+// fxc /nologo /T vs_2_0 /DDIRECTIONALS /Fh matfx_env_amb_dir_VS.h
+// matfx_env_VS.hlsl
+//
+//
+// Parameters:
+//
+// float4 ambientLight;
+// float4 colorClamp;
+// float4x4 combinedMat;
+// float4 envColor;
+// int4 firstLight;
+// float4 fogData;
+//
+// struct
+// {
+// float4 color;
+// float4 position;
+// float4 direction;
+//
+// } lights[8];
+//
+// float4 matCol;
+// float3x3 normalMat;
+// int numDirLights;
+// float4 surfProps;
+// float4x4 texMat;
+//
+//
+// Registers:
+//
+// Name Reg Size
+// ------------ ----- ----
+// numDirLights i0 1
+// combinedMat c0 4
+// normalMat c8 3
+// matCol c12 1
+// surfProps c13 1
+// fogData c14 1
+// ambientLight c15 1
+// firstLight c16 1
+// lights c17 24
+// texMat c41 4
+// colorClamp c45 1
+// envColor c46 1
+//
+
+ vs_2_0
+ def c4, 0, 3, 1, 0
+ dcl_position v0
+ dcl_normal v1
+ dcl_texcoord v2
+ dcl_color v3
+ mul r0, v0.y, c1
+ mad r0, c0, v0.x, r0
+ mad r0, c2, v0.z, r0
+ mad r0, c3, v0.w, r0
+ mov oPos, r0
+ mul r0.xyz, v1.y, c9
+ mad r0.xyz, c8, v1.x, r0
+ mad r0.xyz, c10, v1.z, r0
+ mov r1.x, c13.x
+ mad r1.xyz, c15, r1.x, v3
+ mov r2.xyz, r1
+ mov r1.w, c4.x
+ rep i0
+ add r3.x, r1.w, c16.x
+ mul r3.x, r3.x, c4.y
+ mova a0.x, r3.x
+ dp3 r3.x, r0, -c19[a0.x]
+ max r3.x, r3.x, c4.x
+ mul r3.xyz, r3.x, c17[a0.x]
+ mad r2.xyz, r3, c13.z, r2
+ add r1.w, r1.w, c4.z
+ endrep
+ mov r2.w, v3.w
+ max r1, r2, c4.x
+ min r1, r1, c4.z
+ mul oD0, r1, c12
+ mul r2.xy, r0.y, c42
+ mad r0.xy, c41, r0.x, r2
+ mad r0.xy, c43, r0.z, r0
+ add oT1.xy, r0, c44
+ max r1, r1, c45
+ mul oD1, r1, c46
+ add r0.x, r0.w, -c14.y
+ mul r0.x, r0.x, c14.z
+ max r0.x, r0.x, c14.w
+ min oT0.z, r0.x, c4.z
+ mov oT0.xy, v2
+
+// approximately 40 instruction slots used
+#endif
+
+const BYTE g_vs20_main[] =
+{
+ 0, 2, 254, 255, 254, 255,
+ 156, 0, 67, 84, 65, 66,
+ 28, 0, 0, 0, 56, 2,
+ 0, 0, 0, 2, 254, 255,
+ 12, 0, 0, 0, 28, 0,
+ 0, 0, 0, 1, 0, 0,
+ 49, 2, 0, 0, 12, 1,
+ 0, 0, 2, 0, 15, 0,
+ 1, 0, 62, 0, 28, 1,
+ 0, 0, 0, 0, 0, 0,
+ 44, 1, 0, 0, 2, 0,
+ 45, 0, 1, 0, 182, 0,
+ 28, 1, 0, 0, 0, 0,
+ 0, 0, 55, 1, 0, 0,
+ 2, 0, 0, 0, 4, 0,
+ 2, 0, 68, 1, 0, 0,
+ 0, 0, 0, 0, 84, 1,
+ 0, 0, 2, 0, 46, 0,
+ 1, 0, 186, 0, 28, 1,
+ 0, 0, 0, 0, 0, 0,
+ 93, 1, 0, 0, 2, 0,
+ 16, 0, 1, 0, 66, 0,
+ 104, 1, 0, 0, 0, 0,
+ 0, 0, 120, 1, 0, 0,
+ 2, 0, 14, 0, 1, 0,
+ 58, 0, 28, 1, 0, 0,
+ 0, 0, 0, 0, 128, 1,
+ 0, 0, 2, 0, 17, 0,
+ 24, 0, 70, 0, 204, 1,
+ 0, 0, 0, 0, 0, 0,
+ 220, 1, 0, 0, 2, 0,
+ 12, 0, 1, 0, 50, 0,
+ 28, 1, 0, 0, 0, 0,
+ 0, 0, 227, 1, 0, 0,
+ 2, 0, 8, 0, 3, 0,
+ 34, 0, 240, 1, 0, 0,
+ 0, 0, 0, 0, 0, 2,
+ 0, 0, 1, 0, 0, 0,
+ 1, 0, 2, 0, 16, 2,
+ 0, 0, 0, 0, 0, 0,
+ 32, 2, 0, 0, 2, 0,
+ 13, 0, 1, 0, 54, 0,
+ 28, 1, 0, 0, 0, 0,
+ 0, 0, 42, 2, 0, 0,
+ 2, 0, 41, 0, 4, 0,
+ 166, 0, 68, 1, 0, 0,
+ 0, 0, 0, 0, 97, 109,
+ 98, 105, 101, 110, 116, 76,
+ 105, 103, 104, 116, 0, 171,
+ 171, 171, 1, 0, 3, 0,
+ 1, 0, 4, 0, 1, 0,
+ 0, 0, 0, 0, 0, 0,
+ 99, 111, 108, 111, 114, 67,
+ 108, 97, 109, 112, 0, 99,
+ 111, 109, 98, 105, 110, 101,
+ 100, 77, 97, 116, 0, 171,
+ 3, 0, 3, 0, 4, 0,
+ 4, 0, 1, 0, 0, 0,
+ 0, 0, 0, 0, 101, 110,
+ 118, 67, 111, 108, 111, 114,
+ 0, 102, 105, 114, 115, 116,
+ 76, 105, 103, 104, 116, 0,
+ 1, 0, 2, 0, 1, 0,
+ 4, 0, 1, 0, 0, 0,
+ 0, 0, 0, 0, 102, 111,
+ 103, 68, 97, 116, 97, 0,
+ 108, 105, 103, 104, 116, 115,
+ 0, 99, 111, 108, 111, 114,
+ 0, 171, 171, 171, 1, 0,
+ 3, 0, 1, 0, 4, 0,
+ 1, 0, 0, 0, 0, 0,
+ 0, 0, 112, 111, 115, 105,
+ 116, 105, 111, 110, 0, 100,
+ 105, 114, 101, 99, 116, 105,
+ 111, 110, 0, 171, 135, 1,
+ 0, 0, 144, 1, 0, 0,
+ 160, 1, 0, 0, 144, 1,
+ 0, 0, 169, 1, 0, 0,
+ 144, 1, 0, 0, 5, 0,
+ 0, 0, 1, 0, 12, 0,
+ 8, 0, 3, 0, 180, 1,
+ 0, 0, 109, 97, 116, 67,
+ 111, 108, 0, 110, 111, 114,
+ 109, 97, 108, 77, 97, 116,
+ 0, 171, 171, 171, 3, 0,
+ 3, 0, 3, 0, 3, 0,
+ 1, 0, 0, 0, 0, 0,
+ 0, 0, 110, 117, 109, 68,
+ 105, 114, 76, 105, 103, 104,
+ 116, 115, 0, 171, 171, 171,
+ 0, 0, 2, 0, 1, 0,
+ 1, 0, 1, 0, 0, 0,
+ 0, 0, 0, 0, 115, 117,
+ 114, 102, 80, 114, 111, 112,
+ 115, 0, 116, 101, 120, 77,
+ 97, 116, 0, 118, 115, 95,
+ 50, 95, 48, 0, 77, 105,
+ 99, 114, 111, 115, 111, 102,
+ 116, 32, 40, 82, 41, 32,
+ 72, 76, 83, 76, 32, 83,
+ 104, 97, 100, 101, 114, 32,
+ 67, 111, 109, 112, 105, 108,
+ 101, 114, 32, 57, 46, 50,
+ 57, 46, 57, 53, 50, 46,
+ 51, 49, 49, 49, 0, 171,
+ 171, 171, 81, 0, 0, 5,
+ 4, 0, 15, 160, 0, 0,
+ 0, 0, 0, 0, 64, 64,
+ 0, 0, 128, 63, 0, 0,
+ 0, 0, 31, 0, 0, 2,
+ 0, 0, 0, 128, 0, 0,
+ 15, 144, 31, 0, 0, 2,
+ 3, 0, 0, 128, 1, 0,
+ 15, 144, 31, 0, 0, 2,
+ 5, 0, 0, 128, 2, 0,
+ 15, 144, 31, 0, 0, 2,
+ 10, 0, 0, 128, 3, 0,
+ 15, 144, 5, 0, 0, 3,
+ 0, 0, 15, 128, 0, 0,
+ 85, 144, 1, 0, 228, 160,
+ 4, 0, 0, 4, 0, 0,
+ 15, 128, 0, 0, 228, 160,
+ 0, 0, 0, 144, 0, 0,
+ 228, 128, 4, 0, 0, 4,
+ 0, 0, 15, 128, 2, 0,
+ 228, 160, 0, 0, 170, 144,
+ 0, 0, 228, 128, 4, 0,
+ 0, 4, 0, 0, 15, 128,
+ 3, 0, 228, 160, 0, 0,
+ 255, 144, 0, 0, 228, 128,
+ 1, 0, 0, 2, 0, 0,
+ 15, 192, 0, 0, 228, 128,
+ 5, 0, 0, 3, 0, 0,
+ 7, 128, 1, 0, 85, 144,
+ 9, 0, 228, 160, 4, 0,
+ 0, 4, 0, 0, 7, 128,
+ 8, 0, 228, 160, 1, 0,
+ 0, 144, 0, 0, 228, 128,
+ 4, 0, 0, 4, 0, 0,
+ 7, 128, 10, 0, 228, 160,
+ 1, 0, 170, 144, 0, 0,
+ 228, 128, 1, 0, 0, 2,
+ 1, 0, 1, 128, 13, 0,
+ 0, 160, 4, 0, 0, 4,
+ 1, 0, 7, 128, 15, 0,
+ 228, 160, 1, 0, 0, 128,
+ 3, 0, 228, 144, 1, 0,
+ 0, 2, 2, 0, 7, 128,
+ 1, 0, 228, 128, 1, 0,
+ 0, 2, 1, 0, 8, 128,
+ 4, 0, 0, 160, 38, 0,
+ 0, 1, 0, 0, 228, 240,
+ 2, 0, 0, 3, 3, 0,
+ 1, 128, 1, 0, 255, 128,
+ 16, 0, 0, 160, 5, 0,
+ 0, 3, 3, 0, 1, 128,
+ 3, 0, 0, 128, 4, 0,
+ 85, 160, 46, 0, 0, 2,
+ 0, 0, 1, 176, 3, 0,
+ 0, 128, 8, 0, 0, 4,
+ 3, 0, 1, 128, 0, 0,
+ 228, 128, 19, 32, 228, 161,
+ 0, 0, 0, 176, 11, 0,
+ 0, 3, 3, 0, 1, 128,
+ 3, 0, 0, 128, 4, 0,
+ 0, 160, 5, 0, 0, 4,
+ 3, 0, 7, 128, 3, 0,
+ 0, 128, 17, 32, 228, 160,
+ 0, 0, 0, 176, 4, 0,
+ 0, 4, 2, 0, 7, 128,
+ 3, 0, 228, 128, 13, 0,
+ 170, 160, 2, 0, 228, 128,
+ 2, 0, 0, 3, 1, 0,
+ 8, 128, 1, 0, 255, 128,
+ 4, 0, 170, 160, 39, 0,
+ 0, 0, 1, 0, 0, 2,
+ 2, 0, 8, 128, 3, 0,
+ 255, 144, 11, 0, 0, 3,
+ 1, 0, 15, 128, 2, 0,
+ 228, 128, 4, 0, 0, 160,
+ 10, 0, 0, 3, 1, 0,
+ 15, 128, 1, 0, 228, 128,
+ 4, 0, 170, 160, 5, 0,
+ 0, 3, 0, 0, 15, 208,
+ 1, 0, 228, 128, 12, 0,
+ 228, 160, 5, 0, 0, 3,
+ 2, 0, 3, 128, 0, 0,
+ 85, 128, 42, 0, 228, 160,
+ 4, 0, 0, 4, 0, 0,
+ 3, 128, 41, 0, 228, 160,
+ 0, 0, 0, 128, 2, 0,
+ 228, 128, 4, 0, 0, 4,
+ 0, 0, 3, 128, 43, 0,
+ 228, 160, 0, 0, 170, 128,
+ 0, 0, 228, 128, 2, 0,
+ 0, 3, 1, 0, 3, 224,
+ 0, 0, 228, 128, 44, 0,
+ 228, 160, 11, 0, 0, 3,
+ 1, 0, 15, 128, 1, 0,
+ 228, 128, 45, 0, 228, 160,
+ 5, 0, 0, 3, 1, 0,
+ 15, 208, 1, 0, 228, 128,
+ 46, 0, 228, 160, 2, 0,
+ 0, 3, 0, 0, 1, 128,
+ 0, 0, 255, 128, 14, 0,
+ 85, 161, 5, 0, 0, 3,
+ 0, 0, 1, 128, 0, 0,
+ 0, 128, 14, 0, 170, 160,
+ 11, 0, 0, 3, 0, 0,
+ 1, 128, 0, 0, 0, 128,
+ 14, 0, 255, 160, 10, 0,
+ 0, 3, 0, 0, 4, 224,
+ 0, 0, 0, 128, 4, 0,
+ 170, 160, 1, 0, 0, 2,
+ 0, 0, 3, 224, 2, 0,
+ 228, 144, 255, 255, 0, 0
+};
diff --git a/src/d3d/shaders/matfx_env_tex_PS.h b/src/d3d/shaders/matfx_env_tex_PS.h
new file mode 100644
index 0000000..e2e7429
--- /dev/null
+++ b/src/d3d/shaders/matfx_env_tex_PS.h
@@ -0,0 +1,141 @@
+#if 0
+//
+// Generated by Microsoft (R) HLSL Shader Compiler 9.29.952.3111
+//
+// fxc /nologo /T ps_2_0 /DTEX /Fh matfx_env_tex_PS.h matfx_env_PS.hlsl
+//
+//
+// Parameters:
+//
+// sampler2D diffTex;
+// sampler2D envTex;
+// float4 fogColor;
+// float4 fxparams;
+//
+//
+// Registers:
+//
+// Name Reg Size
+// ------------ ----- ----
+// fogColor c0 1
+// fxparams c1 1
+// diffTex s0 1
+// envTex s1 1
+//
+
+ ps_2_0
+ dcl t0.xyz
+ dcl t1.xy
+ dcl v0
+ dcl v1.xyz
+ dcl_2d s0
+ dcl_2d s1
+ texld r0, t1, s1
+ texld r1, t0, s0
+ mul r2.xyz, v1, c1.x
+ mul r0.xyz, r0, r2
+ mul r0.xyz, r0, t0.z
+ mul r2.w, r1.w, v0.w
+ mad r1.xyz, v0, r1, -c0
+ mad r1.xyz, t0.z, r1, c0
+ max r0.w, r2.w, c1.y
+ mul r0.xyz, r0.w, r0
+ mad r2.xyz, r1, r2.w, r0
+ mov oC0, r2
+
+// approximately 12 instruction slots used (2 texture, 10 arithmetic)
+#endif
+
+const BYTE g_ps20_main[] =
+{
+ 0, 2, 255, 255, 254, 255,
+ 64, 0, 67, 84, 65, 66,
+ 28, 0, 0, 0, 200, 0,
+ 0, 0, 0, 2, 255, 255,
+ 4, 0, 0, 0, 28, 0,
+ 0, 0, 0, 1, 0, 0,
+ 193, 0, 0, 0, 108, 0,
+ 0, 0, 3, 0, 0, 0,
+ 1, 0, 2, 0, 116, 0,
+ 0, 0, 0, 0, 0, 0,
+ 132, 0, 0, 0, 3, 0,
+ 1, 0, 1, 0, 6, 0,
+ 140, 0, 0, 0, 0, 0,
+ 0, 0, 156, 0, 0, 0,
+ 2, 0, 0, 0, 1, 0,
+ 2, 0, 168, 0, 0, 0,
+ 0, 0, 0, 0, 184, 0,
+ 0, 0, 2, 0, 1, 0,
+ 1, 0, 6, 0, 168, 0,
+ 0, 0, 0, 0, 0, 0,
+ 100, 105, 102, 102, 84, 101,
+ 120, 0, 4, 0, 12, 0,
+ 1, 0, 1, 0, 1, 0,
+ 0, 0, 0, 0, 0, 0,
+ 101, 110, 118, 84, 101, 120,
+ 0, 171, 4, 0, 12, 0,
+ 1, 0, 1, 0, 1, 0,
+ 0, 0, 0, 0, 0, 0,
+ 102, 111, 103, 67, 111, 108,
+ 111, 114, 0, 171, 171, 171,
+ 1, 0, 3, 0, 1, 0,
+ 4, 0, 1, 0, 0, 0,
+ 0, 0, 0, 0, 102, 120,
+ 112, 97, 114, 97, 109, 115,
+ 0, 112, 115, 95, 50, 95,
+ 48, 0, 77, 105, 99, 114,
+ 111, 115, 111, 102, 116, 32,
+ 40, 82, 41, 32, 72, 76,
+ 83, 76, 32, 83, 104, 97,
+ 100, 101, 114, 32, 67, 111,
+ 109, 112, 105, 108, 101, 114,
+ 32, 57, 46, 50, 57, 46,
+ 57, 53, 50, 46, 51, 49,
+ 49, 49, 0, 171, 171, 171,
+ 31, 0, 0, 2, 0, 0,
+ 0, 128, 0, 0, 7, 176,
+ 31, 0, 0, 2, 0, 0,
+ 0, 128, 1, 0, 3, 176,
+ 31, 0, 0, 2, 0, 0,
+ 0, 128, 0, 0, 15, 144,
+ 31, 0, 0, 2, 0, 0,
+ 0, 128, 1, 0, 7, 144,
+ 31, 0, 0, 2, 0, 0,
+ 0, 144, 0, 8, 15, 160,
+ 31, 0, 0, 2, 0, 0,
+ 0, 144, 1, 8, 15, 160,
+ 66, 0, 0, 3, 0, 0,
+ 15, 128, 1, 0, 228, 176,
+ 1, 8, 228, 160, 66, 0,
+ 0, 3, 1, 0, 15, 128,
+ 0, 0, 228, 176, 0, 8,
+ 228, 160, 5, 0, 0, 3,
+ 2, 0, 7, 128, 1, 0,
+ 228, 144, 1, 0, 0, 160,
+ 5, 0, 0, 3, 0, 0,
+ 7, 128, 0, 0, 228, 128,
+ 2, 0, 228, 128, 5, 0,
+ 0, 3, 0, 0, 7, 128,
+ 0, 0, 228, 128, 0, 0,
+ 170, 176, 5, 0, 0, 3,
+ 2, 0, 8, 128, 1, 0,
+ 255, 128, 0, 0, 255, 144,
+ 4, 0, 0, 4, 1, 0,
+ 7, 128, 0, 0, 228, 144,
+ 1, 0, 228, 128, 0, 0,
+ 228, 161, 4, 0, 0, 4,
+ 1, 0, 7, 128, 0, 0,
+ 170, 176, 1, 0, 228, 128,
+ 0, 0, 228, 160, 11, 0,
+ 0, 3, 0, 0, 8, 128,
+ 2, 0, 255, 128, 1, 0,
+ 85, 160, 5, 0, 0, 3,
+ 0, 0, 7, 128, 0, 0,
+ 255, 128, 0, 0, 228, 128,
+ 4, 0, 0, 4, 2, 0,
+ 7, 128, 1, 0, 228, 128,
+ 2, 0, 255, 128, 0, 0,
+ 228, 128, 1, 0, 0, 2,
+ 0, 8, 15, 128, 2, 0,
+ 228, 128, 255, 255, 0, 0
+};
diff --git a/src/d3d/shaders/skin_VS.hlsl b/src/d3d/shaders/skin_VS.hlsl
new file mode 100644
index 0000000..bede50f
--- /dev/null
+++ b/src/d3d/shaders/skin_VS.hlsl
@@ -0,0 +1,63 @@
+#include "standardConstants.h"
+
+float4x3 boneMatrices[64] : register(c41);
+
+struct VS_in
+{
+ float4 Position : POSITION;
+ float3 Normal : NORMAL;
+ float2 TexCoord : TEXCOORD0;
+ float4 Prelight : COLOR0;
+ float4 Weights : BLENDWEIGHT;
+ int4 Indices : BLENDINDICES;
+};
+
+struct VS_out {
+ float4 Position : POSITION;
+ float3 TexCoord0 : TEXCOORD0; // also fog
+ float4 Color : COLOR0;
+};
+
+
+VS_out main(in VS_in input)
+{
+ VS_out output;
+
+ int j;
+ float3 SkinVertex = float3(0.0, 0.0, 0.0);
+ float3 SkinNormal = float3(0.0, 0.0, 0.0);
+ for(j = 0; j < 4; j++){
+ SkinVertex += mul(input.Position, boneMatrices[input.Indices[j]]).xyz * input.Weights[j];
+ SkinNormal += mul(input.Normal, (float3x3)boneMatrices[input.Indices[j]]).xyz * input.Weights[j];
+ }
+
+ output.Position = mul(combinedMat, float4(SkinVertex, 1.0));
+ float3 Vertex = mul(worldMat, float4(SkinVertex, 1.0)).xyz;
+ float3 Normal = mul(normalMat, SkinNormal);
+
+ output.TexCoord0.xy = input.TexCoord;
+
+ output.Color = input.Prelight;
+ output.Color.rgb += ambientLight.rgb * surfAmbient;
+
+ int i;
+#ifdef DIRECTIONALS
+ for(i = 0; i < numDirLights; i++)
+ output.Color.xyz += DoDirLight(lights[i+firstDirLight], Normal)*surfDiffuse;
+#endif
+#ifdef POINTLIGHTS
+ for(i = 0; i < numPointLights; i++)
+ output.Color.xyz += DoPointLight(lights[i+firstPointLight], Vertex.xyz, Normal)*surfDiffuse;
+#endif
+#ifdef SPOTLIGHTS
+ for(i = 0; i < numSpotLights; i++)
+ output.Color.xyz += DoSpotLight(lights[i+firstSpotLight], Vertex.xyz, Normal)*surfDiffuse;
+#endif
+ // PS2 clamps before material color
+ output.Color = clamp(output.Color, 0.0, 1.0);
+ output.Color *= matCol;
+
+ output.TexCoord0.z = clamp((output.Position.w - fogEnd)*fogRange, fogDisable, 1.0);
+
+ return output;
+}
diff --git a/src/d3d/shaders/skin_all_VS.h b/src/d3d/shaders/skin_all_VS.h
new file mode 100644
index 0000000..67f89f3
--- /dev/null
+++ b/src/d3d/shaders/skin_all_VS.h
@@ -0,0 +1,664 @@
+#if 0
+//
+// Generated by Microsoft (R) HLSL Shader Compiler 9.29.952.3111
+//
+// fxc /nologo /T vs_2_0 /DDIRECTIONALS /DPOINTLIGHTS /DSPOTLIGHTS /Fh
+// skin_all_VS.h skin_VS.hlsl
+//
+//
+// Parameters:
+//
+// float4 ambientLight;
+// float4x3 boneMatrices[64];
+// float4x4 combinedMat;
+// int4 firstLight;
+// float4 fogData;
+//
+// struct
+// {
+// float4 color;
+// float4 position;
+// float4 direction;
+//
+// } lights[8];
+//
+// float4 matCol;
+// float3x3 normalMat;
+// int numDirLights;
+// int numPointLights;
+// int numSpotLights;
+// float4 surfProps;
+// float4x4 worldMat;
+//
+//
+// Registers:
+//
+// Name Reg Size
+// -------------- ----- ----
+// numDirLights i0 1
+// numPointLights i1 1
+// numSpotLights i2 1
+// combinedMat c0 4
+// worldMat c4 4
+// normalMat c8 3
+// matCol c12 1
+// surfProps c13 1
+// fogData c14 1
+// ambientLight c15 1
+// firstLight c16 1
+// lights c17 24
+// boneMatrices c41 192
+//
+
+ vs_2_0
+ def c11, 3, 0, 1, 0
+ dcl_position v0
+ dcl_normal v1
+ dcl_texcoord v2
+ dcl_color v3
+ dcl_blendweight v4
+ dcl_blendindices v5
+ mul r0, v5, c11.x
+ mova a0.x, r0.x
+ dp3 r1.z, v1, c43[a0.x]
+ dp4 r2.x, v0, c41[a0.x]
+ dp4 r2.y, v0, c42[a0.x]
+ dp4 r2.z, v0, c43[a0.x]
+ dp3 r1.x, v1, c41[a0.x]
+ dp3 r1.y, v1, c42[a0.x]
+ mova a0.x, r0.y
+ dp3 r3.z, v1, c43[a0.x]
+ dp4 r4.x, v0, c41[a0.x]
+ dp4 r4.y, v0, c42[a0.x]
+ dp4 r4.z, v0, c43[a0.x]
+ mul r4.xyz, r4, v4.y
+ mad r2.xyz, r2, v4.x, r4
+ dp3 r3.x, v1, c41[a0.x]
+ dp3 r3.y, v1, c42[a0.x]
+ mul r3.xyz, r3, v4.y
+ mad r1.xyz, r1, v4.x, r3
+ mova a0.x, r0.z
+ dp3 r0.z, v1, c43[a0.x]
+ dp4 r3.x, v0, c41[a0.x]
+ dp4 r3.y, v0, c42[a0.x]
+ dp4 r3.z, v0, c43[a0.x]
+ mad r2.xyz, r3, v4.z, r2
+ dp3 r0.x, v1, c41[a0.x]
+ dp3 r0.y, v1, c42[a0.x]
+ mad r0.xyz, r0, v4.z, r1
+ mova a0.x, r0.w
+ dp3 r1.z, v1, c43[a0.x]
+ dp4 r3.x, v0, c41[a0.x]
+ dp4 r3.y, v0, c42[a0.x]
+ dp4 r3.z, v0, c43[a0.x]
+ mad r2.xyz, r3, v4.w, r2
+ dp3 r1.x, v1, c41[a0.x]
+ dp3 r1.y, v1, c42[a0.x]
+ mad r0.xyz, r1, v4.w, r0
+ mul r1.xyz, r2.y, c5
+ mad r1.xyz, c4, r2.x, r1
+ mad r1.xyz, c6, r2.z, r1
+ add r1.xyz, r1, c7
+ mul r3.xyz, r0.y, c9
+ mad r0.xyw, c8.xyzz, r0.x, r3.xyzz
+ mad r0.xyz, c10, r0.z, r0.xyww
+ mov r3.x, c13.x
+ mad r3.xyz, c15, r3.x, v3
+ mov r4.xyz, r3
+ mov r0.w, c11.y
+ rep i0
+ add r1.w, r0.w, c16.x
+ mul r1.w, r1.w, c11.x
+ mova a0.x, r1.w
+ dp3 r1.w, r0, -c19[a0.x]
+ max r1.w, r1.w, c11.y
+ mul r5.xyz, r1.w, c17[a0.x]
+ mad r4.xyz, r5, c13.z, r4
+ add r0.w, r0.w, c11.z
+ endrep
+ mov r3.xyz, r4
+ mov r0.w, c11.y
+ rep i1
+ add r1.w, r0.w, c16.y
+ mul r1.w, r1.w, c11.x
+ mova a0.x, r1.w
+ add r5.xyz, r1, -c18[a0.x]
+ dp3 r1.w, r5, r5
+ rsq r1.w, r1.w
+ mul r5.xyz, r1.w, r5
+ dp3 r2.w, r0, -r5
+ max r2.w, r2.w, c11.y
+ mul r5.xyz, r2.w, c17[a0.x]
+ rcp r1.w, r1.w
+ rcp r2.w, c17[a0.x].w
+ mad r1.w, r1.w, -r2.w, c11.z
+ max r1.w, r1.w, c11.y
+ mul r5.xyz, r1.w, r5
+ mad r3.xyz, r5, c13.z, r3
+ add r0.w, r0.w, c11.z
+ endrep
+ mov r4.xyz, r3
+ mov r0.w, c11.y
+ rep i2
+ add r1.w, r0.w, c16.z
+ mul r1.w, r1.w, c11.x
+ mova a0.x, r1.w
+ add r5.xyz, r1, -c18[a0.x]
+ dp3 r1.w, r5, r5
+ rsq r1.w, r1.w
+ mul r5.xyz, r1.w, r5
+ dp3 r2.w, r0, -r5
+ dp3 r3.w, r5, c19[a0.x]
+ max r2.w, r2.w, c11.y
+ add r3.w, r3.w, c18[a0.x].w
+ mov r5.z, c11.z
+ add r5.x, r5.z, c18[a0.x].w
+ rcp r5.x, r5.x
+ mul r3.w, r3.w, r5.x
+ slt r5.x, r3.w, c11.y
+ mad r2.w, r5.x, -r2.w, r2.w
+ max r3.w, r3.w, c19[a0.x].w
+ mul r2.w, r2.w, r3.w
+ mul r5.xyz, r2.w, c17[a0.x]
+ rcp r1.w, r1.w
+ rcp r2.w, c17[a0.x].w
+ mad r1.w, r1.w, -r2.w, c11.z
+ max r1.w, r1.w, c11.y
+ mul r5.xyz, r1.w, r5
+ mad r4.xyz, r5, c13.z, r4
+ add r0.w, r0.w, c11.z
+ endrep
+ mov r4.w, v3.w
+ max r0, r4, c11.y
+ min r0, r0, c11.z
+ mul oD0, r0, c12
+ mul r0, r2.y, c1
+ mad r0, c0, r2.x, r0
+ mad r0, c2, r2.z, r0
+ add r0, r0, c3
+ mov oPos, r0
+ add r0.x, r0.w, -c14.y
+ mul r0.x, r0.x, c14.z
+ max r0.x, r0.x, c14.w
+ min oT0.z, r0.x, c11.z
+ mov oT0.xy, v2
+
+// approximately 133 instruction slots used
+#endif
+
+const BYTE g_vs20_main[] =
+{
+ 0, 2, 254, 255, 254, 255,
+ 171, 0, 67, 84, 65, 66,
+ 28, 0, 0, 0, 119, 2,
+ 0, 0, 0, 2, 254, 255,
+ 13, 0, 0, 0, 28, 0,
+ 0, 0, 0, 1, 0, 0,
+ 112, 2, 0, 0, 32, 1,
+ 0, 0, 2, 0, 15, 0,
+ 1, 0, 62, 0, 48, 1,
+ 0, 0, 0, 0, 0, 0,
+ 64, 1, 0, 0, 2, 0,
+ 41, 0, 192, 0, 166, 0,
+ 80, 1, 0, 0, 0, 0,
+ 0, 0, 96, 1, 0, 0,
+ 2, 0, 0, 0, 4, 0,
+ 2, 0, 108, 1, 0, 0,
+ 0, 0, 0, 0, 124, 1,
+ 0, 0, 2, 0, 16, 0,
+ 1, 0, 66, 0, 136, 1,
+ 0, 0, 0, 0, 0, 0,
+ 152, 1, 0, 0, 2, 0,
+ 14, 0, 1, 0, 58, 0,
+ 48, 1, 0, 0, 0, 0,
+ 0, 0, 160, 1, 0, 0,
+ 2, 0, 17, 0, 24, 0,
+ 70, 0, 236, 1, 0, 0,
+ 0, 0, 0, 0, 252, 1,
+ 0, 0, 2, 0, 12, 0,
+ 1, 0, 50, 0, 48, 1,
+ 0, 0, 0, 0, 0, 0,
+ 3, 2, 0, 0, 2, 0,
+ 8, 0, 3, 0, 34, 0,
+ 16, 2, 0, 0, 0, 0,
+ 0, 0, 32, 2, 0, 0,
+ 1, 0, 0, 0, 1, 0,
+ 2, 0, 48, 2, 0, 0,
+ 0, 0, 0, 0, 64, 2,
+ 0, 0, 1, 0, 1, 0,
+ 1, 0, 6, 0, 48, 2,
+ 0, 0, 0, 0, 0, 0,
+ 79, 2, 0, 0, 1, 0,
+ 2, 0, 1, 0, 10, 0,
+ 48, 2, 0, 0, 0, 0,
+ 0, 0, 93, 2, 0, 0,
+ 2, 0, 13, 0, 1, 0,
+ 54, 0, 48, 1, 0, 0,
+ 0, 0, 0, 0, 103, 2,
+ 0, 0, 2, 0, 4, 0,
+ 4, 0, 18, 0, 108, 1,
+ 0, 0, 0, 0, 0, 0,
+ 97, 109, 98, 105, 101, 110,
+ 116, 76, 105, 103, 104, 116,
+ 0, 171, 171, 171, 1, 0,
+ 3, 0, 1, 0, 4, 0,
+ 1, 0, 0, 0, 0, 0,
+ 0, 0, 98, 111, 110, 101,
+ 77, 97, 116, 114, 105, 99,
+ 101, 115, 0, 171, 171, 171,
+ 3, 0, 3, 0, 4, 0,
+ 3, 0, 64, 0, 0, 0,
+ 0, 0, 0, 0, 99, 111,
+ 109, 98, 105, 110, 101, 100,
+ 77, 97, 116, 0, 3, 0,
+ 3, 0, 4, 0, 4, 0,
+ 1, 0, 0, 0, 0, 0,
+ 0, 0, 102, 105, 114, 115,
+ 116, 76, 105, 103, 104, 116,
+ 0, 171, 1, 0, 2, 0,
+ 1, 0, 4, 0, 1, 0,
+ 0, 0, 0, 0, 0, 0,
+ 102, 111, 103, 68, 97, 116,
+ 97, 0, 108, 105, 103, 104,
+ 116, 115, 0, 99, 111, 108,
+ 111, 114, 0, 171, 171, 171,
+ 1, 0, 3, 0, 1, 0,
+ 4, 0, 1, 0, 0, 0,
+ 0, 0, 0, 0, 112, 111,
+ 115, 105, 116, 105, 111, 110,
+ 0, 100, 105, 114, 101, 99,
+ 116, 105, 111, 110, 0, 171,
+ 167, 1, 0, 0, 176, 1,
+ 0, 0, 192, 1, 0, 0,
+ 176, 1, 0, 0, 201, 1,
+ 0, 0, 176, 1, 0, 0,
+ 5, 0, 0, 0, 1, 0,
+ 12, 0, 8, 0, 3, 0,
+ 212, 1, 0, 0, 109, 97,
+ 116, 67, 111, 108, 0, 110,
+ 111, 114, 109, 97, 108, 77,
+ 97, 116, 0, 171, 171, 171,
+ 3, 0, 3, 0, 3, 0,
+ 3, 0, 1, 0, 0, 0,
+ 0, 0, 0, 0, 110, 117,
+ 109, 68, 105, 114, 76, 105,
+ 103, 104, 116, 115, 0, 171,
+ 171, 171, 0, 0, 2, 0,
+ 1, 0, 1, 0, 1, 0,
+ 0, 0, 0, 0, 0, 0,
+ 110, 117, 109, 80, 111, 105,
+ 110, 116, 76, 105, 103, 104,
+ 116, 115, 0, 110, 117, 109,
+ 83, 112, 111, 116, 76, 105,
+ 103, 104, 116, 115, 0, 115,
+ 117, 114, 102, 80, 114, 111,
+ 112, 115, 0, 119, 111, 114,
+ 108, 100, 77, 97, 116, 0,
+ 118, 115, 95, 50, 95, 48,
+ 0, 77, 105, 99, 114, 111,
+ 115, 111, 102, 116, 32, 40,
+ 82, 41, 32, 72, 76, 83,
+ 76, 32, 83, 104, 97, 100,
+ 101, 114, 32, 67, 111, 109,
+ 112, 105, 108, 101, 114, 32,
+ 57, 46, 50, 57, 46, 57,
+ 53, 50, 46, 51, 49, 49,
+ 49, 0, 81, 0, 0, 5,
+ 11, 0, 15, 160, 0, 0,
+ 64, 64, 0, 0, 0, 0,
+ 0, 0, 128, 63, 0, 0,
+ 0, 0, 31, 0, 0, 2,
+ 0, 0, 0, 128, 0, 0,
+ 15, 144, 31, 0, 0, 2,
+ 3, 0, 0, 128, 1, 0,
+ 15, 144, 31, 0, 0, 2,
+ 5, 0, 0, 128, 2, 0,
+ 15, 144, 31, 0, 0, 2,
+ 10, 0, 0, 128, 3, 0,
+ 15, 144, 31, 0, 0, 2,
+ 1, 0, 0, 128, 4, 0,
+ 15, 144, 31, 0, 0, 2,
+ 2, 0, 0, 128, 5, 0,
+ 15, 144, 5, 0, 0, 3,
+ 0, 0, 15, 128, 5, 0,
+ 228, 144, 11, 0, 0, 160,
+ 46, 0, 0, 2, 0, 0,
+ 1, 176, 0, 0, 0, 128,
+ 8, 0, 0, 4, 1, 0,
+ 4, 128, 1, 0, 228, 144,
+ 43, 32, 228, 160, 0, 0,
+ 0, 176, 9, 0, 0, 4,
+ 2, 0, 1, 128, 0, 0,
+ 228, 144, 41, 32, 228, 160,
+ 0, 0, 0, 176, 9, 0,
+ 0, 4, 2, 0, 2, 128,
+ 0, 0, 228, 144, 42, 32,
+ 228, 160, 0, 0, 0, 176,
+ 9, 0, 0, 4, 2, 0,
+ 4, 128, 0, 0, 228, 144,
+ 43, 32, 228, 160, 0, 0,
+ 0, 176, 8, 0, 0, 4,
+ 1, 0, 1, 128, 1, 0,
+ 228, 144, 41, 32, 228, 160,
+ 0, 0, 0, 176, 8, 0,
+ 0, 4, 1, 0, 2, 128,
+ 1, 0, 228, 144, 42, 32,
+ 228, 160, 0, 0, 0, 176,
+ 46, 0, 0, 2, 0, 0,
+ 1, 176, 0, 0, 85, 128,
+ 8, 0, 0, 4, 3, 0,
+ 4, 128, 1, 0, 228, 144,
+ 43, 32, 228, 160, 0, 0,
+ 0, 176, 9, 0, 0, 4,
+ 4, 0, 1, 128, 0, 0,
+ 228, 144, 41, 32, 228, 160,
+ 0, 0, 0, 176, 9, 0,
+ 0, 4, 4, 0, 2, 128,
+ 0, 0, 228, 144, 42, 32,
+ 228, 160, 0, 0, 0, 176,
+ 9, 0, 0, 4, 4, 0,
+ 4, 128, 0, 0, 228, 144,
+ 43, 32, 228, 160, 0, 0,
+ 0, 176, 5, 0, 0, 3,
+ 4, 0, 7, 128, 4, 0,
+ 228, 128, 4, 0, 85, 144,
+ 4, 0, 0, 4, 2, 0,
+ 7, 128, 2, 0, 228, 128,
+ 4, 0, 0, 144, 4, 0,
+ 228, 128, 8, 0, 0, 4,
+ 3, 0, 1, 128, 1, 0,
+ 228, 144, 41, 32, 228, 160,
+ 0, 0, 0, 176, 8, 0,
+ 0, 4, 3, 0, 2, 128,
+ 1, 0, 228, 144, 42, 32,
+ 228, 160, 0, 0, 0, 176,
+ 5, 0, 0, 3, 3, 0,
+ 7, 128, 3, 0, 228, 128,
+ 4, 0, 85, 144, 4, 0,
+ 0, 4, 1, 0, 7, 128,
+ 1, 0, 228, 128, 4, 0,
+ 0, 144, 3, 0, 228, 128,
+ 46, 0, 0, 2, 0, 0,
+ 1, 176, 0, 0, 170, 128,
+ 8, 0, 0, 4, 0, 0,
+ 4, 128, 1, 0, 228, 144,
+ 43, 32, 228, 160, 0, 0,
+ 0, 176, 9, 0, 0, 4,
+ 3, 0, 1, 128, 0, 0,
+ 228, 144, 41, 32, 228, 160,
+ 0, 0, 0, 176, 9, 0,
+ 0, 4, 3, 0, 2, 128,
+ 0, 0, 228, 144, 42, 32,
+ 228, 160, 0, 0, 0, 176,
+ 9, 0, 0, 4, 3, 0,
+ 4, 128, 0, 0, 228, 144,
+ 43, 32, 228, 160, 0, 0,
+ 0, 176, 4, 0, 0, 4,
+ 2, 0, 7, 128, 3, 0,
+ 228, 128, 4, 0, 170, 144,
+ 2, 0, 228, 128, 8, 0,
+ 0, 4, 0, 0, 1, 128,
+ 1, 0, 228, 144, 41, 32,
+ 228, 160, 0, 0, 0, 176,
+ 8, 0, 0, 4, 0, 0,
+ 2, 128, 1, 0, 228, 144,
+ 42, 32, 228, 160, 0, 0,
+ 0, 176, 4, 0, 0, 4,
+ 0, 0, 7, 128, 0, 0,
+ 228, 128, 4, 0, 170, 144,
+ 1, 0, 228, 128, 46, 0,
+ 0, 2, 0, 0, 1, 176,
+ 0, 0, 255, 128, 8, 0,
+ 0, 4, 1, 0, 4, 128,
+ 1, 0, 228, 144, 43, 32,
+ 228, 160, 0, 0, 0, 176,
+ 9, 0, 0, 4, 3, 0,
+ 1, 128, 0, 0, 228, 144,
+ 41, 32, 228, 160, 0, 0,
+ 0, 176, 9, 0, 0, 4,
+ 3, 0, 2, 128, 0, 0,
+ 228, 144, 42, 32, 228, 160,
+ 0, 0, 0, 176, 9, 0,
+ 0, 4, 3, 0, 4, 128,
+ 0, 0, 228, 144, 43, 32,
+ 228, 160, 0, 0, 0, 176,
+ 4, 0, 0, 4, 2, 0,
+ 7, 128, 3, 0, 228, 128,
+ 4, 0, 255, 144, 2, 0,
+ 228, 128, 8, 0, 0, 4,
+ 1, 0, 1, 128, 1, 0,
+ 228, 144, 41, 32, 228, 160,
+ 0, 0, 0, 176, 8, 0,
+ 0, 4, 1, 0, 2, 128,
+ 1, 0, 228, 144, 42, 32,
+ 228, 160, 0, 0, 0, 176,
+ 4, 0, 0, 4, 0, 0,
+ 7, 128, 1, 0, 228, 128,
+ 4, 0, 255, 144, 0, 0,
+ 228, 128, 5, 0, 0, 3,
+ 1, 0, 7, 128, 2, 0,
+ 85, 128, 5, 0, 228, 160,
+ 4, 0, 0, 4, 1, 0,
+ 7, 128, 4, 0, 228, 160,
+ 2, 0, 0, 128, 1, 0,
+ 228, 128, 4, 0, 0, 4,
+ 1, 0, 7, 128, 6, 0,
+ 228, 160, 2, 0, 170, 128,
+ 1, 0, 228, 128, 2, 0,
+ 0, 3, 1, 0, 7, 128,
+ 1, 0, 228, 128, 7, 0,
+ 228, 160, 5, 0, 0, 3,
+ 3, 0, 7, 128, 0, 0,
+ 85, 128, 9, 0, 228, 160,
+ 4, 0, 0, 4, 0, 0,
+ 11, 128, 8, 0, 164, 160,
+ 0, 0, 0, 128, 3, 0,
+ 164, 128, 4, 0, 0, 4,
+ 0, 0, 7, 128, 10, 0,
+ 228, 160, 0, 0, 170, 128,
+ 0, 0, 244, 128, 1, 0,
+ 0, 2, 3, 0, 1, 128,
+ 13, 0, 0, 160, 4, 0,
+ 0, 4, 3, 0, 7, 128,
+ 15, 0, 228, 160, 3, 0,
+ 0, 128, 3, 0, 228, 144,
+ 1, 0, 0, 2, 4, 0,
+ 7, 128, 3, 0, 228, 128,
+ 1, 0, 0, 2, 0, 0,
+ 8, 128, 11, 0, 85, 160,
+ 38, 0, 0, 1, 0, 0,
+ 228, 240, 2, 0, 0, 3,
+ 1, 0, 8, 128, 0, 0,
+ 255, 128, 16, 0, 0, 160,
+ 5, 0, 0, 3, 1, 0,
+ 8, 128, 1, 0, 255, 128,
+ 11, 0, 0, 160, 46, 0,
+ 0, 2, 0, 0, 1, 176,
+ 1, 0, 255, 128, 8, 0,
+ 0, 4, 1, 0, 8, 128,
+ 0, 0, 228, 128, 19, 32,
+ 228, 161, 0, 0, 0, 176,
+ 11, 0, 0, 3, 1, 0,
+ 8, 128, 1, 0, 255, 128,
+ 11, 0, 85, 160, 5, 0,
+ 0, 4, 5, 0, 7, 128,
+ 1, 0, 255, 128, 17, 32,
+ 228, 160, 0, 0, 0, 176,
+ 4, 0, 0, 4, 4, 0,
+ 7, 128, 5, 0, 228, 128,
+ 13, 0, 170, 160, 4, 0,
+ 228, 128, 2, 0, 0, 3,
+ 0, 0, 8, 128, 0, 0,
+ 255, 128, 11, 0, 170, 160,
+ 39, 0, 0, 0, 1, 0,
+ 0, 2, 3, 0, 7, 128,
+ 4, 0, 228, 128, 1, 0,
+ 0, 2, 0, 0, 8, 128,
+ 11, 0, 85, 160, 38, 0,
+ 0, 1, 1, 0, 228, 240,
+ 2, 0, 0, 3, 1, 0,
+ 8, 128, 0, 0, 255, 128,
+ 16, 0, 85, 160, 5, 0,
+ 0, 3, 1, 0, 8, 128,
+ 1, 0, 255, 128, 11, 0,
+ 0, 160, 46, 0, 0, 2,
+ 0, 0, 1, 176, 1, 0,
+ 255, 128, 2, 0, 0, 4,
+ 5, 0, 7, 128, 1, 0,
+ 228, 128, 18, 32, 228, 161,
+ 0, 0, 0, 176, 8, 0,
+ 0, 3, 1, 0, 8, 128,
+ 5, 0, 228, 128, 5, 0,
+ 228, 128, 7, 0, 0, 2,
+ 1, 0, 8, 128, 1, 0,
+ 255, 128, 5, 0, 0, 3,
+ 5, 0, 7, 128, 1, 0,
+ 255, 128, 5, 0, 228, 128,
+ 8, 0, 0, 3, 2, 0,
+ 8, 128, 0, 0, 228, 128,
+ 5, 0, 228, 129, 11, 0,
+ 0, 3, 2, 0, 8, 128,
+ 2, 0, 255, 128, 11, 0,
+ 85, 160, 5, 0, 0, 4,
+ 5, 0, 7, 128, 2, 0,
+ 255, 128, 17, 32, 228, 160,
+ 0, 0, 0, 176, 6, 0,
+ 0, 2, 1, 0, 8, 128,
+ 1, 0, 255, 128, 6, 0,
+ 0, 3, 2, 0, 8, 128,
+ 17, 32, 255, 160, 0, 0,
+ 0, 176, 4, 0, 0, 4,
+ 1, 0, 8, 128, 1, 0,
+ 255, 128, 2, 0, 255, 129,
+ 11, 0, 170, 160, 11, 0,
+ 0, 3, 1, 0, 8, 128,
+ 1, 0, 255, 128, 11, 0,
+ 85, 160, 5, 0, 0, 3,
+ 5, 0, 7, 128, 1, 0,
+ 255, 128, 5, 0, 228, 128,
+ 4, 0, 0, 4, 3, 0,
+ 7, 128, 5, 0, 228, 128,
+ 13, 0, 170, 160, 3, 0,
+ 228, 128, 2, 0, 0, 3,
+ 0, 0, 8, 128, 0, 0,
+ 255, 128, 11, 0, 170, 160,
+ 39, 0, 0, 0, 1, 0,
+ 0, 2, 4, 0, 7, 128,
+ 3, 0, 228, 128, 1, 0,
+ 0, 2, 0, 0, 8, 128,
+ 11, 0, 85, 160, 38, 0,
+ 0, 1, 2, 0, 228, 240,
+ 2, 0, 0, 3, 1, 0,
+ 8, 128, 0, 0, 255, 128,
+ 16, 0, 170, 160, 5, 0,
+ 0, 3, 1, 0, 8, 128,
+ 1, 0, 255, 128, 11, 0,
+ 0, 160, 46, 0, 0, 2,
+ 0, 0, 1, 176, 1, 0,
+ 255, 128, 2, 0, 0, 4,
+ 5, 0, 7, 128, 1, 0,
+ 228, 128, 18, 32, 228, 161,
+ 0, 0, 0, 176, 8, 0,
+ 0, 3, 1, 0, 8, 128,
+ 5, 0, 228, 128, 5, 0,
+ 228, 128, 7, 0, 0, 2,
+ 1, 0, 8, 128, 1, 0,
+ 255, 128, 5, 0, 0, 3,
+ 5, 0, 7, 128, 1, 0,
+ 255, 128, 5, 0, 228, 128,
+ 8, 0, 0, 3, 2, 0,
+ 8, 128, 0, 0, 228, 128,
+ 5, 0, 228, 129, 8, 0,
+ 0, 4, 3, 0, 8, 128,
+ 5, 0, 228, 128, 19, 32,
+ 228, 160, 0, 0, 0, 176,
+ 11, 0, 0, 3, 2, 0,
+ 8, 128, 2, 0, 255, 128,
+ 11, 0, 85, 160, 2, 0,
+ 0, 4, 3, 0, 8, 128,
+ 3, 0, 255, 128, 18, 32,
+ 255, 160, 0, 0, 0, 176,
+ 1, 0, 0, 2, 5, 0,
+ 4, 128, 11, 0, 170, 160,
+ 2, 0, 0, 4, 5, 0,
+ 1, 128, 5, 0, 170, 128,
+ 18, 32, 255, 160, 0, 0,
+ 0, 176, 6, 0, 0, 2,
+ 5, 0, 1, 128, 5, 0,
+ 0, 128, 5, 0, 0, 3,
+ 3, 0, 8, 128, 3, 0,
+ 255, 128, 5, 0, 0, 128,
+ 12, 0, 0, 3, 5, 0,
+ 1, 128, 3, 0, 255, 128,
+ 11, 0, 85, 160, 4, 0,
+ 0, 4, 2, 0, 8, 128,
+ 5, 0, 0, 128, 2, 0,
+ 255, 129, 2, 0, 255, 128,
+ 11, 0, 0, 4, 3, 0,
+ 8, 128, 3, 0, 255, 128,
+ 19, 32, 255, 160, 0, 0,
+ 0, 176, 5, 0, 0, 3,
+ 2, 0, 8, 128, 2, 0,
+ 255, 128, 3, 0, 255, 128,
+ 5, 0, 0, 4, 5, 0,
+ 7, 128, 2, 0, 255, 128,
+ 17, 32, 228, 160, 0, 0,
+ 0, 176, 6, 0, 0, 2,
+ 1, 0, 8, 128, 1, 0,
+ 255, 128, 6, 0, 0, 3,
+ 2, 0, 8, 128, 17, 32,
+ 255, 160, 0, 0, 0, 176,
+ 4, 0, 0, 4, 1, 0,
+ 8, 128, 1, 0, 255, 128,
+ 2, 0, 255, 129, 11, 0,
+ 170, 160, 11, 0, 0, 3,
+ 1, 0, 8, 128, 1, 0,
+ 255, 128, 11, 0, 85, 160,
+ 5, 0, 0, 3, 5, 0,
+ 7, 128, 1, 0, 255, 128,
+ 5, 0, 228, 128, 4, 0,
+ 0, 4, 4, 0, 7, 128,
+ 5, 0, 228, 128, 13, 0,
+ 170, 160, 4, 0, 228, 128,
+ 2, 0, 0, 3, 0, 0,
+ 8, 128, 0, 0, 255, 128,
+ 11, 0, 170, 160, 39, 0,
+ 0, 0, 1, 0, 0, 2,
+ 4, 0, 8, 128, 3, 0,
+ 255, 144, 11, 0, 0, 3,
+ 0, 0, 15, 128, 4, 0,
+ 228, 128, 11, 0, 85, 160,
+ 10, 0, 0, 3, 0, 0,
+ 15, 128, 0, 0, 228, 128,
+ 11, 0, 170, 160, 5, 0,
+ 0, 3, 0, 0, 15, 208,
+ 0, 0, 228, 128, 12, 0,
+ 228, 160, 5, 0, 0, 3,
+ 0, 0, 15, 128, 2, 0,
+ 85, 128, 1, 0, 228, 160,
+ 4, 0, 0, 4, 0, 0,
+ 15, 128, 0, 0, 228, 160,
+ 2, 0, 0, 128, 0, 0,
+ 228, 128, 4, 0, 0, 4,
+ 0, 0, 15, 128, 2, 0,
+ 228, 160, 2, 0, 170, 128,
+ 0, 0, 228, 128, 2, 0,
+ 0, 3, 0, 0, 15, 128,
+ 0, 0, 228, 128, 3, 0,
+ 228, 160, 1, 0, 0, 2,
+ 0, 0, 15, 192, 0, 0,
+ 228, 128, 2, 0, 0, 3,
+ 0, 0, 1, 128, 0, 0,
+ 255, 128, 14, 0, 85, 161,
+ 5, 0, 0, 3, 0, 0,
+ 1, 128, 0, 0, 0, 128,
+ 14, 0, 170, 160, 11, 0,
+ 0, 3, 0, 0, 1, 128,
+ 0, 0, 0, 128, 14, 0,
+ 255, 160, 10, 0, 0, 3,
+ 0, 0, 4, 224, 0, 0,
+ 0, 128, 11, 0, 170, 160,
+ 1, 0, 0, 2, 0, 0,
+ 3, 224, 2, 0, 228, 144,
+ 255, 255, 0, 0
+};
diff --git a/src/d3d/shaders/skin_amb_VS.h b/src/d3d/shaders/skin_amb_VS.h
new file mode 100644
index 0000000..e0a5548
--- /dev/null
+++ b/src/d3d/shaders/skin_amb_VS.h
@@ -0,0 +1,253 @@
+#if 0
+//
+// Generated by Microsoft (R) HLSL Shader Compiler 9.29.952.3111
+//
+// fxc /nologo /T vs_2_0 /Fh skin_amb_VS.h skin_VS.hlsl
+//
+//
+// Parameters:
+//
+// float4 ambientLight;
+// float4x3 boneMatrices[64];
+// float4x4 combinedMat;
+// float4 fogData;
+// float4 matCol;
+// float4 surfProps;
+//
+//
+// Registers:
+//
+// Name Reg Size
+// ------------ ----- ----
+// combinedMat c0 4
+// matCol c12 1
+// surfProps c13 1
+// fogData c14 1
+// ambientLight c15 1
+// boneMatrices c41 192
+//
+
+ vs_2_0
+ def c4, 3, 0, 1, 0
+ dcl_position v0
+ dcl_texcoord v1
+ dcl_color v2
+ dcl_blendweight v3
+ dcl_blendindices v4
+ mov r0.xyz, c15
+ mad r0.xyz, r0, c13.x, v2
+ mov r0.w, v2.w
+ max r0, r0, c4.y
+ min r0, r0, c4.z
+ mul oD0, r0, c12
+ mul r0, v4, c4.x
+ mova a0.x, r0.y
+ dp4 r1.x, v0, c41[a0.x]
+ dp4 r1.y, v0, c42[a0.x]
+ dp4 r1.z, v0, c43[a0.x]
+ mul r1.xyz, r1, v3.y
+ mova a0.x, r0.x
+ dp4 r2.x, v0, c41[a0.x]
+ dp4 r2.y, v0, c42[a0.x]
+ dp4 r2.z, v0, c43[a0.x]
+ mad r1.xyz, r2, v3.x, r1
+ mova a0.xy, r0.zwzw
+ dp4 r0.x, v0, c41[a0.x]
+ dp4 r0.y, v0, c42[a0.x]
+ dp4 r0.z, v0, c43[a0.x]
+ mad r0.xyz, r0, v3.z, r1
+ dp4 r1.x, v0, c41[a0.y]
+ dp4 r1.y, v0, c42[a0.y]
+ dp4 r1.z, v0, c43[a0.y]
+ mad r0.xyz, r1, v3.w, r0
+ mul r1, r0.y, c1
+ mad r1, c0, r0.x, r1
+ mad r0, c2, r0.z, r1
+ add r0, r0, c3
+ add r1.x, r0.w, -c14.y
+ mov oPos, r0
+ mul r0.x, r1.x, c14.z
+ max r0.x, r0.x, c14.w
+ min oT0.z, r0.x, c4.z
+ mov oT0.xy, v1
+
+// approximately 36 instruction slots used
+#endif
+
+const BYTE g_vs20_main[] =
+{
+ 0, 2, 254, 255, 254, 255,
+ 82, 0, 67, 84, 65, 66,
+ 28, 0, 0, 0, 16, 1,
+ 0, 0, 0, 2, 254, 255,
+ 6, 0, 0, 0, 28, 0,
+ 0, 0, 0, 1, 0, 0,
+ 9, 1, 0, 0, 148, 0,
+ 0, 0, 2, 0, 15, 0,
+ 1, 0, 62, 0, 164, 0,
+ 0, 0, 0, 0, 0, 0,
+ 180, 0, 0, 0, 2, 0,
+ 41, 0, 192, 0, 166, 0,
+ 196, 0, 0, 0, 0, 0,
+ 0, 0, 212, 0, 0, 0,
+ 2, 0, 0, 0, 4, 0,
+ 2, 0, 224, 0, 0, 0,
+ 0, 0, 0, 0, 240, 0,
+ 0, 0, 2, 0, 14, 0,
+ 1, 0, 58, 0, 164, 0,
+ 0, 0, 0, 0, 0, 0,
+ 248, 0, 0, 0, 2, 0,
+ 12, 0, 1, 0, 50, 0,
+ 164, 0, 0, 0, 0, 0,
+ 0, 0, 255, 0, 0, 0,
+ 2, 0, 13, 0, 1, 0,
+ 54, 0, 164, 0, 0, 0,
+ 0, 0, 0, 0, 97, 109,
+ 98, 105, 101, 110, 116, 76,
+ 105, 103, 104, 116, 0, 171,
+ 171, 171, 1, 0, 3, 0,
+ 1, 0, 4, 0, 1, 0,
+ 0, 0, 0, 0, 0, 0,
+ 98, 111, 110, 101, 77, 97,
+ 116, 114, 105, 99, 101, 115,
+ 0, 171, 171, 171, 3, 0,
+ 3, 0, 4, 0, 3, 0,
+ 64, 0, 0, 0, 0, 0,
+ 0, 0, 99, 111, 109, 98,
+ 105, 110, 101, 100, 77, 97,
+ 116, 0, 3, 0, 3, 0,
+ 4, 0, 4, 0, 1, 0,
+ 0, 0, 0, 0, 0, 0,
+ 102, 111, 103, 68, 97, 116,
+ 97, 0, 109, 97, 116, 67,
+ 111, 108, 0, 115, 117, 114,
+ 102, 80, 114, 111, 112, 115,
+ 0, 118, 115, 95, 50, 95,
+ 48, 0, 77, 105, 99, 114,
+ 111, 115, 111, 102, 116, 32,
+ 40, 82, 41, 32, 72, 76,
+ 83, 76, 32, 83, 104, 97,
+ 100, 101, 114, 32, 67, 111,
+ 109, 112, 105, 108, 101, 114,
+ 32, 57, 46, 50, 57, 46,
+ 57, 53, 50, 46, 51, 49,
+ 49, 49, 0, 171, 171, 171,
+ 81, 0, 0, 5, 4, 0,
+ 15, 160, 0, 0, 64, 64,
+ 0, 0, 0, 0, 0, 0,
+ 128, 63, 0, 0, 0, 0,
+ 31, 0, 0, 2, 0, 0,
+ 0, 128, 0, 0, 15, 144,
+ 31, 0, 0, 2, 5, 0,
+ 0, 128, 1, 0, 15, 144,
+ 31, 0, 0, 2, 10, 0,
+ 0, 128, 2, 0, 15, 144,
+ 31, 0, 0, 2, 1, 0,
+ 0, 128, 3, 0, 15, 144,
+ 31, 0, 0, 2, 2, 0,
+ 0, 128, 4, 0, 15, 144,
+ 1, 0, 0, 2, 0, 0,
+ 7, 128, 15, 0, 228, 160,
+ 4, 0, 0, 4, 0, 0,
+ 7, 128, 0, 0, 228, 128,
+ 13, 0, 0, 160, 2, 0,
+ 228, 144, 1, 0, 0, 2,
+ 0, 0, 8, 128, 2, 0,
+ 255, 144, 11, 0, 0, 3,
+ 0, 0, 15, 128, 0, 0,
+ 228, 128, 4, 0, 85, 160,
+ 10, 0, 0, 3, 0, 0,
+ 15, 128, 0, 0, 228, 128,
+ 4, 0, 170, 160, 5, 0,
+ 0, 3, 0, 0, 15, 208,
+ 0, 0, 228, 128, 12, 0,
+ 228, 160, 5, 0, 0, 3,
+ 0, 0, 15, 128, 4, 0,
+ 228, 144, 4, 0, 0, 160,
+ 46, 0, 0, 2, 0, 0,
+ 1, 176, 0, 0, 85, 128,
+ 9, 0, 0, 4, 1, 0,
+ 1, 128, 0, 0, 228, 144,
+ 41, 32, 228, 160, 0, 0,
+ 0, 176, 9, 0, 0, 4,
+ 1, 0, 2, 128, 0, 0,
+ 228, 144, 42, 32, 228, 160,
+ 0, 0, 0, 176, 9, 0,
+ 0, 4, 1, 0, 4, 128,
+ 0, 0, 228, 144, 43, 32,
+ 228, 160, 0, 0, 0, 176,
+ 5, 0, 0, 3, 1, 0,
+ 7, 128, 1, 0, 228, 128,
+ 3, 0, 85, 144, 46, 0,
+ 0, 2, 0, 0, 1, 176,
+ 0, 0, 0, 128, 9, 0,
+ 0, 4, 2, 0, 1, 128,
+ 0, 0, 228, 144, 41, 32,
+ 228, 160, 0, 0, 0, 176,
+ 9, 0, 0, 4, 2, 0,
+ 2, 128, 0, 0, 228, 144,
+ 42, 32, 228, 160, 0, 0,
+ 0, 176, 9, 0, 0, 4,
+ 2, 0, 4, 128, 0, 0,
+ 228, 144, 43, 32, 228, 160,
+ 0, 0, 0, 176, 4, 0,
+ 0, 4, 1, 0, 7, 128,
+ 2, 0, 228, 128, 3, 0,
+ 0, 144, 1, 0, 228, 128,
+ 46, 0, 0, 2, 0, 0,
+ 3, 176, 0, 0, 238, 128,
+ 9, 0, 0, 4, 0, 0,
+ 1, 128, 0, 0, 228, 144,
+ 41, 32, 228, 160, 0, 0,
+ 0, 176, 9, 0, 0, 4,
+ 0, 0, 2, 128, 0, 0,
+ 228, 144, 42, 32, 228, 160,
+ 0, 0, 0, 176, 9, 0,
+ 0, 4, 0, 0, 4, 128,
+ 0, 0, 228, 144, 43, 32,
+ 228, 160, 0, 0, 0, 176,
+ 4, 0, 0, 4, 0, 0,
+ 7, 128, 0, 0, 228, 128,
+ 3, 0, 170, 144, 1, 0,
+ 228, 128, 9, 0, 0, 4,
+ 1, 0, 1, 128, 0, 0,
+ 228, 144, 41, 32, 228, 160,
+ 0, 0, 85, 176, 9, 0,
+ 0, 4, 1, 0, 2, 128,
+ 0, 0, 228, 144, 42, 32,
+ 228, 160, 0, 0, 85, 176,
+ 9, 0, 0, 4, 1, 0,
+ 4, 128, 0, 0, 228, 144,
+ 43, 32, 228, 160, 0, 0,
+ 85, 176, 4, 0, 0, 4,
+ 0, 0, 7, 128, 1, 0,
+ 228, 128, 3, 0, 255, 144,
+ 0, 0, 228, 128, 5, 0,
+ 0, 3, 1, 0, 15, 128,
+ 0, 0, 85, 128, 1, 0,
+ 228, 160, 4, 0, 0, 4,
+ 1, 0, 15, 128, 0, 0,
+ 228, 160, 0, 0, 0, 128,
+ 1, 0, 228, 128, 4, 0,
+ 0, 4, 0, 0, 15, 128,
+ 2, 0, 228, 160, 0, 0,
+ 170, 128, 1, 0, 228, 128,
+ 2, 0, 0, 3, 0, 0,
+ 15, 128, 0, 0, 228, 128,
+ 3, 0, 228, 160, 2, 0,
+ 0, 3, 1, 0, 1, 128,
+ 0, 0, 255, 128, 14, 0,
+ 85, 161, 1, 0, 0, 2,
+ 0, 0, 15, 192, 0, 0,
+ 228, 128, 5, 0, 0, 3,
+ 0, 0, 1, 128, 1, 0,
+ 0, 128, 14, 0, 170, 160,
+ 11, 0, 0, 3, 0, 0,
+ 1, 128, 0, 0, 0, 128,
+ 14, 0, 255, 160, 10, 0,
+ 0, 3, 0, 0, 4, 224,
+ 0, 0, 0, 128, 4, 0,
+ 170, 160, 1, 0, 0, 2,
+ 0, 0, 3, 224, 1, 0,
+ 228, 144, 255, 255, 0, 0
+};
diff --git a/src/d3d/shaders/skin_amb_dir_VS.h b/src/d3d/shaders/skin_amb_dir_VS.h
new file mode 100644
index 0000000..7949749
--- /dev/null
+++ b/src/d3d/shaders/skin_amb_dir_VS.h
@@ -0,0 +1,503 @@
+#if 0
+//
+// Generated by Microsoft (R) HLSL Shader Compiler 9.29.952.3111
+//
+// fxc /nologo /T vs_2_0 /DDIRECTIONALS /Fh skin_amb_dir_VS.h skin_VS.hlsl
+//
+//
+// Parameters:
+//
+// float4 ambientLight;
+// float4x3 boneMatrices[64];
+// float4x4 combinedMat;
+// int4 firstLight;
+// float4 fogData;
+//
+// struct
+// {
+// float4 color;
+// float4 position;
+// float4 direction;
+//
+// } lights[8];
+//
+// float4 matCol;
+// float3x3 normalMat;
+// int numDirLights;
+// float4 surfProps;
+//
+//
+// Registers:
+//
+// Name Reg Size
+// ------------ ----- ----
+// numDirLights i0 1
+// combinedMat c0 4
+// normalMat c8 3
+// matCol c12 1
+// surfProps c13 1
+// fogData c14 1
+// ambientLight c15 1
+// firstLight c16 1
+// lights c17 24
+// boneMatrices c41 192
+//
+
+ vs_2_0
+ def c4, 3, 0, 1, 0
+ dcl_position v0
+ dcl_normal v1
+ dcl_texcoord v2
+ dcl_color v3
+ dcl_blendweight v4
+ dcl_blendindices v5
+ mul r0, v5, c4.x
+ mova a0.w, r0.x
+ dp3 r1.z, v1, c43[a0.w]
+ mova a0.w, r0.x
+ dp3 r1.x, v1, c41[a0.w]
+ mova a0.w, r0.x
+ dp3 r1.y, v1, c42[a0.w]
+ mova a0.w, r0.y
+ dp3 r2.z, v1, c43[a0.w]
+ mova a0.w, r0.y
+ dp3 r2.x, v1, c41[a0.w]
+ mova a0.w, r0.y
+ dp3 r2.y, v1, c42[a0.w]
+ mul r2.xyz, r2, v4.y
+ mad r1.xyz, r1, v4.x, r2
+ mova a0.w, r0.z
+ dp3 r2.z, v1, c43[a0.w]
+ mova a0.w, r0.z
+ dp3 r2.x, v1, c41[a0.w]
+ mova a0.w, r0.z
+ dp3 r2.y, v1, c42[a0.w]
+ mad r1.xyz, r2, v4.z, r1
+ mova a0.w, r0.w
+ dp3 r2.z, v1, c43[a0.w]
+ mova a0.w, r0.w
+ dp3 r2.x, v1, c41[a0.w]
+ mova a0.w, r0.w
+ dp3 r2.y, v1, c42[a0.w]
+ mad r1.xyz, r2, v4.w, r1
+ mul r2.xyz, r1.y, c9
+ mad r1.xyw, c8.xyzz, r1.x, r2.xyzz
+ mad r1.xyz, c10, r1.z, r1.xyww
+ mov r2.x, c13.x
+ mad r2.xyz, c15, r2.x, v3
+ mov r3.xyz, r2
+ mov r1.w, c4.y
+ rep i0
+ add r2.w, r1.w, c16.x
+ mul r2.w, r2.w, c4.x
+ mova a0.w, r2.w
+ dp3 r4.x, r1, -c19[a0.w]
+ max r4.x, r4.x, c4.y
+ mova a0.w, r2.w
+ mul r4.xyz, r4.x, c17[a0.w]
+ mad r3.xyz, r4, c13.z, r3
+ add r1.w, r1.w, c4.z
+ endrep
+ mov r3.w, v3.w
+ max r1, r3, c4.y
+ min r1, r1, c4.z
+ mul oD0, r1, c12
+ mova a0.w, r0.y
+ dp4 r1.x, v0, c41[a0.w]
+ mova a0.w, r0.y
+ dp4 r1.y, v0, c42[a0.w]
+ mova a0.w, r0.y
+ dp4 r1.z, v0, c43[a0.w]
+ mul r1.xyz, r1, v4.y
+ mova a0.w, r0.x
+ dp4 r2.x, v0, c41[a0.w]
+ mova a0.w, r0.x
+ dp4 r2.y, v0, c42[a0.w]
+ mova a0.w, r0.x
+ dp4 r2.z, v0, c43[a0.w]
+ mad r1.xyz, r2, v4.x, r1
+ mova a0.w, r0.z
+ dp4 r2.x, v0, c41[a0.w]
+ mova a0.w, r0.z
+ dp4 r2.y, v0, c42[a0.w]
+ mova a0.w, r0.z
+ dp4 r2.z, v0, c43[a0.w]
+ mad r0.xyz, r2, v4.z, r1
+ mova a0.w, r0.w
+ dp4 r1.x, v0, c41[a0.w]
+ mova a0.w, r0.w
+ dp4 r1.y, v0, c42[a0.w]
+ mova a0.w, r0.w
+ dp4 r1.z, v0, c43[a0.w]
+ mad r0.xyz, r1, v4.w, r0
+ mul r1, r0.y, c1
+ mad r1, c0, r0.x, r1
+ mad r0, c2, r0.z, r1
+ add r0, r0, c3
+ mov oPos, r0
+ add r0.x, r0.w, -c14.y
+ mul r0.x, r0.x, c14.z
+ max r0.x, r0.x, c14.w
+ min oT0.z, r0.x, c4.z
+ mov oT0.xy, v2
+
+// approximately 92 instruction slots used
+#endif
+
+const BYTE g_vs20_main[] =
+{
+ 0, 2, 254, 255, 254, 255,
+ 147, 0, 67, 84, 65, 66,
+ 28, 0, 0, 0, 21, 2,
+ 0, 0, 0, 2, 254, 255,
+ 10, 0, 0, 0, 28, 0,
+ 0, 0, 0, 1, 0, 0,
+ 14, 2, 0, 0, 228, 0,
+ 0, 0, 2, 0, 15, 0,
+ 1, 0, 62, 0, 244, 0,
+ 0, 0, 0, 0, 0, 0,
+ 4, 1, 0, 0, 2, 0,
+ 41, 0, 192, 0, 166, 0,
+ 20, 1, 0, 0, 0, 0,
+ 0, 0, 36, 1, 0, 0,
+ 2, 0, 0, 0, 4, 0,
+ 2, 0, 48, 1, 0, 0,
+ 0, 0, 0, 0, 64, 1,
+ 0, 0, 2, 0, 16, 0,
+ 1, 0, 66, 0, 76, 1,
+ 0, 0, 0, 0, 0, 0,
+ 92, 1, 0, 0, 2, 0,
+ 14, 0, 1, 0, 58, 0,
+ 244, 0, 0, 0, 0, 0,
+ 0, 0, 100, 1, 0, 0,
+ 2, 0, 17, 0, 24, 0,
+ 70, 0, 176, 1, 0, 0,
+ 0, 0, 0, 0, 192, 1,
+ 0, 0, 2, 0, 12, 0,
+ 1, 0, 50, 0, 244, 0,
+ 0, 0, 0, 0, 0, 0,
+ 199, 1, 0, 0, 2, 0,
+ 8, 0, 3, 0, 34, 0,
+ 212, 1, 0, 0, 0, 0,
+ 0, 0, 228, 1, 0, 0,
+ 1, 0, 0, 0, 1, 0,
+ 2, 0, 244, 1, 0, 0,
+ 0, 0, 0, 0, 4, 2,
+ 0, 0, 2, 0, 13, 0,
+ 1, 0, 54, 0, 244, 0,
+ 0, 0, 0, 0, 0, 0,
+ 97, 109, 98, 105, 101, 110,
+ 116, 76, 105, 103, 104, 116,
+ 0, 171, 171, 171, 1, 0,
+ 3, 0, 1, 0, 4, 0,
+ 1, 0, 0, 0, 0, 0,
+ 0, 0, 98, 111, 110, 101,
+ 77, 97, 116, 114, 105, 99,
+ 101, 115, 0, 171, 171, 171,
+ 3, 0, 3, 0, 4, 0,
+ 3, 0, 64, 0, 0, 0,
+ 0, 0, 0, 0, 99, 111,
+ 109, 98, 105, 110, 101, 100,
+ 77, 97, 116, 0, 3, 0,
+ 3, 0, 4, 0, 4, 0,
+ 1, 0, 0, 0, 0, 0,
+ 0, 0, 102, 105, 114, 115,
+ 116, 76, 105, 103, 104, 116,
+ 0, 171, 1, 0, 2, 0,
+ 1, 0, 4, 0, 1, 0,
+ 0, 0, 0, 0, 0, 0,
+ 102, 111, 103, 68, 97, 116,
+ 97, 0, 108, 105, 103, 104,
+ 116, 115, 0, 99, 111, 108,
+ 111, 114, 0, 171, 171, 171,
+ 1, 0, 3, 0, 1, 0,
+ 4, 0, 1, 0, 0, 0,
+ 0, 0, 0, 0, 112, 111,
+ 115, 105, 116, 105, 111, 110,
+ 0, 100, 105, 114, 101, 99,
+ 116, 105, 111, 110, 0, 171,
+ 107, 1, 0, 0, 116, 1,
+ 0, 0, 132, 1, 0, 0,
+ 116, 1, 0, 0, 141, 1,
+ 0, 0, 116, 1, 0, 0,
+ 5, 0, 0, 0, 1, 0,
+ 12, 0, 8, 0, 3, 0,
+ 152, 1, 0, 0, 109, 97,
+ 116, 67, 111, 108, 0, 110,
+ 111, 114, 109, 97, 108, 77,
+ 97, 116, 0, 171, 171, 171,
+ 3, 0, 3, 0, 3, 0,
+ 3, 0, 1, 0, 0, 0,
+ 0, 0, 0, 0, 110, 117,
+ 109, 68, 105, 114, 76, 105,
+ 103, 104, 116, 115, 0, 171,
+ 171, 171, 0, 0, 2, 0,
+ 1, 0, 1, 0, 1, 0,
+ 0, 0, 0, 0, 0, 0,
+ 115, 117, 114, 102, 80, 114,
+ 111, 112, 115, 0, 118, 115,
+ 95, 50, 95, 48, 0, 77,
+ 105, 99, 114, 111, 115, 111,
+ 102, 116, 32, 40, 82, 41,
+ 32, 72, 76, 83, 76, 32,
+ 83, 104, 97, 100, 101, 114,
+ 32, 67, 111, 109, 112, 105,
+ 108, 101, 114, 32, 57, 46,
+ 50, 57, 46, 57, 53, 50,
+ 46, 51, 49, 49, 49, 0,
+ 171, 171, 81, 0, 0, 5,
+ 4, 0, 15, 160, 0, 0,
+ 64, 64, 0, 0, 0, 0,
+ 0, 0, 128, 63, 0, 0,
+ 0, 0, 31, 0, 0, 2,
+ 0, 0, 0, 128, 0, 0,
+ 15, 144, 31, 0, 0, 2,
+ 3, 0, 0, 128, 1, 0,
+ 15, 144, 31, 0, 0, 2,
+ 5, 0, 0, 128, 2, 0,
+ 15, 144, 31, 0, 0, 2,
+ 10, 0, 0, 128, 3, 0,
+ 15, 144, 31, 0, 0, 2,
+ 1, 0, 0, 128, 4, 0,
+ 15, 144, 31, 0, 0, 2,
+ 2, 0, 0, 128, 5, 0,
+ 15, 144, 5, 0, 0, 3,
+ 0, 0, 15, 128, 5, 0,
+ 228, 144, 4, 0, 0, 160,
+ 46, 0, 0, 2, 0, 0,
+ 8, 176, 0, 0, 0, 128,
+ 8, 0, 0, 4, 1, 0,
+ 4, 128, 1, 0, 228, 144,
+ 43, 32, 228, 160, 0, 0,
+ 255, 176, 46, 0, 0, 2,
+ 0, 0, 8, 176, 0, 0,
+ 0, 128, 8, 0, 0, 4,
+ 1, 0, 1, 128, 1, 0,
+ 228, 144, 41, 32, 228, 160,
+ 0, 0, 255, 176, 46, 0,
+ 0, 2, 0, 0, 8, 176,
+ 0, 0, 0, 128, 8, 0,
+ 0, 4, 1, 0, 2, 128,
+ 1, 0, 228, 144, 42, 32,
+ 228, 160, 0, 0, 255, 176,
+ 46, 0, 0, 2, 0, 0,
+ 8, 176, 0, 0, 85, 128,
+ 8, 0, 0, 4, 2, 0,
+ 4, 128, 1, 0, 228, 144,
+ 43, 32, 228, 160, 0, 0,
+ 255, 176, 46, 0, 0, 2,
+ 0, 0, 8, 176, 0, 0,
+ 85, 128, 8, 0, 0, 4,
+ 2, 0, 1, 128, 1, 0,
+ 228, 144, 41, 32, 228, 160,
+ 0, 0, 255, 176, 46, 0,
+ 0, 2, 0, 0, 8, 176,
+ 0, 0, 85, 128, 8, 0,
+ 0, 4, 2, 0, 2, 128,
+ 1, 0, 228, 144, 42, 32,
+ 228, 160, 0, 0, 255, 176,
+ 5, 0, 0, 3, 2, 0,
+ 7, 128, 2, 0, 228, 128,
+ 4, 0, 85, 144, 4, 0,
+ 0, 4, 1, 0, 7, 128,
+ 1, 0, 228, 128, 4, 0,
+ 0, 144, 2, 0, 228, 128,
+ 46, 0, 0, 2, 0, 0,
+ 8, 176, 0, 0, 170, 128,
+ 8, 0, 0, 4, 2, 0,
+ 4, 128, 1, 0, 228, 144,
+ 43, 32, 228, 160, 0, 0,
+ 255, 176, 46, 0, 0, 2,
+ 0, 0, 8, 176, 0, 0,
+ 170, 128, 8, 0, 0, 4,
+ 2, 0, 1, 128, 1, 0,
+ 228, 144, 41, 32, 228, 160,
+ 0, 0, 255, 176, 46, 0,
+ 0, 2, 0, 0, 8, 176,
+ 0, 0, 170, 128, 8, 0,
+ 0, 4, 2, 0, 2, 128,
+ 1, 0, 228, 144, 42, 32,
+ 228, 160, 0, 0, 255, 176,
+ 4, 0, 0, 4, 1, 0,
+ 7, 128, 2, 0, 228, 128,
+ 4, 0, 170, 144, 1, 0,
+ 228, 128, 46, 0, 0, 2,
+ 0, 0, 8, 176, 0, 0,
+ 255, 128, 8, 0, 0, 4,
+ 2, 0, 4, 128, 1, 0,
+ 228, 144, 43, 32, 228, 160,
+ 0, 0, 255, 176, 46, 0,
+ 0, 2, 0, 0, 8, 176,
+ 0, 0, 255, 128, 8, 0,
+ 0, 4, 2, 0, 1, 128,
+ 1, 0, 228, 144, 41, 32,
+ 228, 160, 0, 0, 255, 176,
+ 46, 0, 0, 2, 0, 0,
+ 8, 176, 0, 0, 255, 128,
+ 8, 0, 0, 4, 2, 0,
+ 2, 128, 1, 0, 228, 144,
+ 42, 32, 228, 160, 0, 0,
+ 255, 176, 4, 0, 0, 4,
+ 1, 0, 7, 128, 2, 0,
+ 228, 128, 4, 0, 255, 144,
+ 1, 0, 228, 128, 5, 0,
+ 0, 3, 2, 0, 7, 128,
+ 1, 0, 85, 128, 9, 0,
+ 228, 160, 4, 0, 0, 4,
+ 1, 0, 11, 128, 8, 0,
+ 164, 160, 1, 0, 0, 128,
+ 2, 0, 164, 128, 4, 0,
+ 0, 4, 1, 0, 7, 128,
+ 10, 0, 228, 160, 1, 0,
+ 170, 128, 1, 0, 244, 128,
+ 1, 0, 0, 2, 2, 0,
+ 1, 128, 13, 0, 0, 160,
+ 4, 0, 0, 4, 2, 0,
+ 7, 128, 15, 0, 228, 160,
+ 2, 0, 0, 128, 3, 0,
+ 228, 144, 1, 0, 0, 2,
+ 3, 0, 7, 128, 2, 0,
+ 228, 128, 1, 0, 0, 2,
+ 1, 0, 8, 128, 4, 0,
+ 85, 160, 38, 0, 0, 1,
+ 0, 0, 228, 240, 2, 0,
+ 0, 3, 2, 0, 8, 128,
+ 1, 0, 255, 128, 16, 0,
+ 0, 160, 5, 0, 0, 3,
+ 2, 0, 8, 128, 2, 0,
+ 255, 128, 4, 0, 0, 160,
+ 46, 0, 0, 2, 0, 0,
+ 8, 176, 2, 0, 255, 128,
+ 8, 0, 0, 4, 4, 0,
+ 1, 128, 1, 0, 228, 128,
+ 19, 32, 228, 161, 0, 0,
+ 255, 176, 11, 0, 0, 3,
+ 4, 0, 1, 128, 4, 0,
+ 0, 128, 4, 0, 85, 160,
+ 46, 0, 0, 2, 0, 0,
+ 8, 176, 2, 0, 255, 128,
+ 5, 0, 0, 4, 4, 0,
+ 7, 128, 4, 0, 0, 128,
+ 17, 32, 228, 160, 0, 0,
+ 255, 176, 4, 0, 0, 4,
+ 3, 0, 7, 128, 4, 0,
+ 228, 128, 13, 0, 170, 160,
+ 3, 0, 228, 128, 2, 0,
+ 0, 3, 1, 0, 8, 128,
+ 1, 0, 255, 128, 4, 0,
+ 170, 160, 39, 0, 0, 0,
+ 1, 0, 0, 2, 3, 0,
+ 8, 128, 3, 0, 255, 144,
+ 11, 0, 0, 3, 1, 0,
+ 15, 128, 3, 0, 228, 128,
+ 4, 0, 85, 160, 10, 0,
+ 0, 3, 1, 0, 15, 128,
+ 1, 0, 228, 128, 4, 0,
+ 170, 160, 5, 0, 0, 3,
+ 0, 0, 15, 208, 1, 0,
+ 228, 128, 12, 0, 228, 160,
+ 46, 0, 0, 2, 0, 0,
+ 8, 176, 0, 0, 85, 128,
+ 9, 0, 0, 4, 1, 0,
+ 1, 128, 0, 0, 228, 144,
+ 41, 32, 228, 160, 0, 0,
+ 255, 176, 46, 0, 0, 2,
+ 0, 0, 8, 176, 0, 0,
+ 85, 128, 9, 0, 0, 4,
+ 1, 0, 2, 128, 0, 0,
+ 228, 144, 42, 32, 228, 160,
+ 0, 0, 255, 176, 46, 0,
+ 0, 2, 0, 0, 8, 176,
+ 0, 0, 85, 128, 9, 0,
+ 0, 4, 1, 0, 4, 128,
+ 0, 0, 228, 144, 43, 32,
+ 228, 160, 0, 0, 255, 176,
+ 5, 0, 0, 3, 1, 0,
+ 7, 128, 1, 0, 228, 128,
+ 4, 0, 85, 144, 46, 0,
+ 0, 2, 0, 0, 8, 176,
+ 0, 0, 0, 128, 9, 0,
+ 0, 4, 2, 0, 1, 128,
+ 0, 0, 228, 144, 41, 32,
+ 228, 160, 0, 0, 255, 176,
+ 46, 0, 0, 2, 0, 0,
+ 8, 176, 0, 0, 0, 128,
+ 9, 0, 0, 4, 2, 0,
+ 2, 128, 0, 0, 228, 144,
+ 42, 32, 228, 160, 0, 0,
+ 255, 176, 46, 0, 0, 2,
+ 0, 0, 8, 176, 0, 0,
+ 0, 128, 9, 0, 0, 4,
+ 2, 0, 4, 128, 0, 0,
+ 228, 144, 43, 32, 228, 160,
+ 0, 0, 255, 176, 4, 0,
+ 0, 4, 1, 0, 7, 128,
+ 2, 0, 228, 128, 4, 0,
+ 0, 144, 1, 0, 228, 128,
+ 46, 0, 0, 2, 0, 0,
+ 8, 176, 0, 0, 170, 128,
+ 9, 0, 0, 4, 2, 0,
+ 1, 128, 0, 0, 228, 144,
+ 41, 32, 228, 160, 0, 0,
+ 255, 176, 46, 0, 0, 2,
+ 0, 0, 8, 176, 0, 0,
+ 170, 128, 9, 0, 0, 4,
+ 2, 0, 2, 128, 0, 0,
+ 228, 144, 42, 32, 228, 160,
+ 0, 0, 255, 176, 46, 0,
+ 0, 2, 0, 0, 8, 176,
+ 0, 0, 170, 128, 9, 0,
+ 0, 4, 2, 0, 4, 128,
+ 0, 0, 228, 144, 43, 32,
+ 228, 160, 0, 0, 255, 176,
+ 4, 0, 0, 4, 0, 0,
+ 7, 128, 2, 0, 228, 128,
+ 4, 0, 170, 144, 1, 0,
+ 228, 128, 46, 0, 0, 2,
+ 0, 0, 8, 176, 0, 0,
+ 255, 128, 9, 0, 0, 4,
+ 1, 0, 1, 128, 0, 0,
+ 228, 144, 41, 32, 228, 160,
+ 0, 0, 255, 176, 46, 0,
+ 0, 2, 0, 0, 8, 176,
+ 0, 0, 255, 128, 9, 0,
+ 0, 4, 1, 0, 2, 128,
+ 0, 0, 228, 144, 42, 32,
+ 228, 160, 0, 0, 255, 176,
+ 46, 0, 0, 2, 0, 0,
+ 8, 176, 0, 0, 255, 128,
+ 9, 0, 0, 4, 1, 0,
+ 4, 128, 0, 0, 228, 144,
+ 43, 32, 228, 160, 0, 0,
+ 255, 176, 4, 0, 0, 4,
+ 0, 0, 7, 128, 1, 0,
+ 228, 128, 4, 0, 255, 144,
+ 0, 0, 228, 128, 5, 0,
+ 0, 3, 1, 0, 15, 128,
+ 0, 0, 85, 128, 1, 0,
+ 228, 160, 4, 0, 0, 4,
+ 1, 0, 15, 128, 0, 0,
+ 228, 160, 0, 0, 0, 128,
+ 1, 0, 228, 128, 4, 0,
+ 0, 4, 0, 0, 15, 128,
+ 2, 0, 228, 160, 0, 0,
+ 170, 128, 1, 0, 228, 128,
+ 2, 0, 0, 3, 0, 0,
+ 15, 128, 0, 0, 228, 128,
+ 3, 0, 228, 160, 1, 0,
+ 0, 2, 0, 0, 15, 192,
+ 0, 0, 228, 128, 2, 0,
+ 0, 3, 0, 0, 1, 128,
+ 0, 0, 255, 128, 14, 0,
+ 85, 161, 5, 0, 0, 3,
+ 0, 0, 1, 128, 0, 0,
+ 0, 128, 14, 0, 170, 160,
+ 11, 0, 0, 3, 0, 0,
+ 1, 128, 0, 0, 0, 128,
+ 14, 0, 255, 160, 10, 0,
+ 0, 3, 0, 0, 4, 224,
+ 0, 0, 0, 128, 4, 0,
+ 170, 160, 1, 0, 0, 2,
+ 0, 0, 3, 224, 2, 0,
+ 228, 144, 255, 255, 0, 0
+};
diff --git a/src/d3d/shaders/standardConstants.h b/src/d3d/shaders/standardConstants.h
new file mode 100644
index 0000000..088df7d
--- /dev/null
+++ b/src/d3d/shaders/standardConstants.h
@@ -0,0 +1,28 @@
+float4x4 combinedMat : register(c0);
+float4x4 worldMat : register(c4);
+float3x3 normalMat : register(c8);
+float4 matCol : register(c12);
+float4 surfProps : register(c13);
+float4 fogData : register(c14);
+float4 ambientLight : register(c15);
+
+#define surfAmbient (surfProps.x)
+#define surfSpecular (surfProps.y)
+#define surfDiffuse (surfProps.z)
+
+#define fogStart (fogData.x)
+#define fogEnd (fogData.y)
+#define fogRange (fogData.z)
+#define fogDisable (fogData.w)
+
+#include "lighting.h"
+
+int numDirLights : register(i0);
+int numPointLights : register(i1);
+int numSpotLights : register(i2);
+int4 firstLight : register(c16);
+Light lights[8] : register(c17);
+
+#define firstDirLight (firstLight.x)
+#define firstPointLight (firstLight.y)
+#define firstSpotLight (firstLight.z)