0
koryspansel <koryspansel@bendbroadband.com>
parents:
diff
changeset
|
1 extern uniform float4x4 kWorld;
|
koryspansel <koryspansel@bendbroadband.com>
parents:
diff
changeset
|
2 extern uniform float4x4 kView;
|
koryspansel <koryspansel@bendbroadband.com>
parents:
diff
changeset
|
3 extern uniform float4x4 kProjection;
|
koryspansel <koryspansel@bendbroadband.com>
parents:
diff
changeset
|
4 extern uniform float4 kColor;
|
koryspansel <koryspansel@bendbroadband.com>
parents:
diff
changeset
|
5 extern uniform texture kTexture;
|
koryspansel <koryspansel@bendbroadband.com>
parents:
diff
changeset
|
6
|
koryspansel <koryspansel@bendbroadband.com>
parents:
diff
changeset
|
7 sampler TextureSampler = sampler_state
|
koryspansel <koryspansel@bendbroadband.com>
parents:
diff
changeset
|
8 {
|
koryspansel <koryspansel@bendbroadband.com>
parents:
diff
changeset
|
9 Texture = <kTexture>;
|
koryspansel <koryspansel@bendbroadband.com>
parents:
diff
changeset
|
10 MinFilter = LINEAR;
|
koryspansel <koryspansel@bendbroadband.com>
parents:
diff
changeset
|
11 MagFilter = LINEAR;
|
koryspansel <koryspansel@bendbroadband.com>
parents:
diff
changeset
|
12 AddressU = WRAP;
|
koryspansel <koryspansel@bendbroadband.com>
parents:
diff
changeset
|
13 AddressV = WRAP;
|
koryspansel <koryspansel@bendbroadband.com>
parents:
diff
changeset
|
14 };
|
koryspansel <koryspansel@bendbroadband.com>
parents:
diff
changeset
|
15
|
koryspansel <koryspansel@bendbroadband.com>
parents:
diff
changeset
|
16 struct VertexOutput
|
koryspansel <koryspansel@bendbroadband.com>
parents:
diff
changeset
|
17 {
|
koryspansel <koryspansel@bendbroadband.com>
parents:
diff
changeset
|
18 /*
|
koryspansel <koryspansel@bendbroadband.com>
parents:
diff
changeset
|
19 * kPosition
|
koryspansel <koryspansel@bendbroadband.com>
parents:
diff
changeset
|
20 */
|
koryspansel <koryspansel@bendbroadband.com>
parents:
diff
changeset
|
21 float4 kPosition : POSITION0;
|
koryspansel <koryspansel@bendbroadband.com>
parents:
diff
changeset
|
22
|
koryspansel <koryspansel@bendbroadband.com>
parents:
diff
changeset
|
23 /*
|
koryspansel <koryspansel@bendbroadband.com>
parents:
diff
changeset
|
24 * kTextureCoords
|
koryspansel <koryspansel@bendbroadband.com>
parents:
diff
changeset
|
25 */
|
koryspansel <koryspansel@bendbroadband.com>
parents:
diff
changeset
|
26 float2 kTextureCoords : TEXCOORD0;
|
koryspansel <koryspansel@bendbroadband.com>
parents:
diff
changeset
|
27 };
|
koryspansel <koryspansel@bendbroadband.com>
parents:
diff
changeset
|
28
|
koryspansel <koryspansel@bendbroadband.com>
parents:
diff
changeset
|
29 VertexOutput EnvironmentVS(float3 kVertexPosition : POSITION0, float3 kVertexNormal : NORMAL, float2 kTextureCoords : TEXCOORD0)
|
koryspansel <koryspansel@bendbroadband.com>
parents:
diff
changeset
|
30 {
|
koryspansel <koryspansel@bendbroadband.com>
parents:
diff
changeset
|
31 float4x4 kWorldViewProjection = mul(mul(kWorld, kView), kProjection);
|
koryspansel <koryspansel@bendbroadband.com>
parents:
diff
changeset
|
32
|
koryspansel <koryspansel@bendbroadband.com>
parents:
diff
changeset
|
33 VertexOutput kOutput;
|
koryspansel <koryspansel@bendbroadband.com>
parents:
diff
changeset
|
34 kOutput.kPosition = mul(float4(kVertexPosition, 1.0f), kWorldViewProjection);
|
koryspansel <koryspansel@bendbroadband.com>
parents:
diff
changeset
|
35 kOutput.kTextureCoords = kTextureCoords;
|
koryspansel <koryspansel@bendbroadband.com>
parents:
diff
changeset
|
36
|
koryspansel <koryspansel@bendbroadband.com>
parents:
diff
changeset
|
37 return kOutput;
|
koryspansel <koryspansel@bendbroadband.com>
parents:
diff
changeset
|
38 }
|
koryspansel <koryspansel@bendbroadband.com>
parents:
diff
changeset
|
39
|
koryspansel <koryspansel@bendbroadband.com>
parents:
diff
changeset
|
40 float4 EnvironmentPS(float2 kTextureCoords : TEXCOORD0) : COLOR0
|
koryspansel <koryspansel@bendbroadband.com>
parents:
diff
changeset
|
41 {
|
koryspansel <koryspansel@bendbroadband.com>
parents:
diff
changeset
|
42 float4 kTexture = tex2D(TextureSampler, kTextureCoords);
|
koryspansel <koryspansel@bendbroadband.com>
parents:
diff
changeset
|
43 return float4(kTexture.rgb * kColor.rgb, kTexture.a);
|
koryspansel <koryspansel@bendbroadband.com>
parents:
diff
changeset
|
44 }
|
koryspansel <koryspansel@bendbroadband.com>
parents:
diff
changeset
|
45
|
koryspansel <koryspansel@bendbroadband.com>
parents:
diff
changeset
|
46 technique Default
|
koryspansel <koryspansel@bendbroadband.com>
parents:
diff
changeset
|
47 {
|
koryspansel <koryspansel@bendbroadband.com>
parents:
diff
changeset
|
48 pass Pass0
|
koryspansel <koryspansel@bendbroadband.com>
parents:
diff
changeset
|
49 {
|
koryspansel <koryspansel@bendbroadband.com>
parents:
diff
changeset
|
50 vertexShader = compile vs_2_0 EnvironmentVS();
|
koryspansel <koryspansel@bendbroadband.com>
parents:
diff
changeset
|
51 pixelShader = compile ps_2_0 EnvironmentPS();
|
koryspansel <koryspansel@bendbroadband.com>
parents:
diff
changeset
|
52
|
koryspansel <koryspansel@bendbroadband.com>
parents:
diff
changeset
|
53 ZEnable = true;
|
koryspansel <koryspansel@bendbroadband.com>
parents:
diff
changeset
|
54 ZWriteEnable = true;
|
koryspansel <koryspansel@bendbroadband.com>
parents:
diff
changeset
|
55 ZFunc = LessEqual;
|
koryspansel <koryspansel@bendbroadband.com>
parents:
diff
changeset
|
56 }
|
koryspansel <koryspansel@bendbroadband.com>
parents:
diff
changeset
|
57 }
|
koryspansel <koryspansel@bendbroadband.com>
parents:
diff
changeset
|
58
|
koryspansel <koryspansel@bendbroadband.com>
parents:
diff
changeset
|
59 technique Wire
|
koryspansel <koryspansel@bendbroadband.com>
parents:
diff
changeset
|
60 {
|
koryspansel <koryspansel@bendbroadband.com>
parents:
diff
changeset
|
61 pass Pass0
|
koryspansel <koryspansel@bendbroadband.com>
parents:
diff
changeset
|
62 {
|
koryspansel <koryspansel@bendbroadband.com>
parents:
diff
changeset
|
63 vertexShader = compile vs_2_0 EnvironmentVS();
|
koryspansel <koryspansel@bendbroadband.com>
parents:
diff
changeset
|
64 pixelShader = compile ps_2_0 EnvironmentPS();
|
koryspansel <koryspansel@bendbroadband.com>
parents:
diff
changeset
|
65
|
koryspansel <koryspansel@bendbroadband.com>
parents:
diff
changeset
|
66 ZEnable = true;
|
koryspansel <koryspansel@bendbroadband.com>
parents:
diff
changeset
|
67 ZWriteEnable = false;
|
koryspansel <koryspansel@bendbroadband.com>
parents:
diff
changeset
|
68 ZFunc = LessEqual;
|
koryspansel <koryspansel@bendbroadband.com>
parents:
diff
changeset
|
69 FillMode = Wireframe;
|
koryspansel <koryspansel@bendbroadband.com>
parents:
diff
changeset
|
70 }
|
koryspansel <koryspansel@bendbroadband.com>
parents:
diff
changeset
|
71 }
|