0
koryspansel <koryspansel@bendbroadband.com>
parents:
diff
changeset
|
1 extern uniform float4x4 kProjection;
|
koryspansel <koryspansel@bendbroadband.com>
parents:
diff
changeset
|
2 extern uniform float4x4 kWorld;
|
koryspansel <koryspansel@bendbroadband.com>
parents:
diff
changeset
|
3 extern uniform texture kTexture;
|
koryspansel <koryspansel@bendbroadband.com>
parents:
diff
changeset
|
4 extern uniform float4 kColor;
|
koryspansel <koryspansel@bendbroadband.com>
parents:
diff
changeset
|
5
|
koryspansel <koryspansel@bendbroadband.com>
parents:
diff
changeset
|
6 /*
|
koryspansel <koryspansel@bendbroadband.com>
parents:
diff
changeset
|
7 * TextureSampler
|
koryspansel <koryspansel@bendbroadband.com>
parents:
diff
changeset
|
8 */
|
koryspansel <koryspansel@bendbroadband.com>
parents:
diff
changeset
|
9 sampler TextureSampler = sampler_state
|
koryspansel <koryspansel@bendbroadband.com>
parents:
diff
changeset
|
10 {
|
koryspansel <koryspansel@bendbroadband.com>
parents:
diff
changeset
|
11 Texture = <kTexture>;
|
koryspansel <koryspansel@bendbroadband.com>
parents:
diff
changeset
|
12 MinFilter = POINT;
|
koryspansel <koryspansel@bendbroadband.com>
parents:
diff
changeset
|
13 MagFilter = POINT;
|
koryspansel <koryspansel@bendbroadband.com>
parents:
diff
changeset
|
14 AddressU = CLAMP;
|
koryspansel <koryspansel@bendbroadband.com>
parents:
diff
changeset
|
15 AddressV = CLAMP;
|
koryspansel <koryspansel@bendbroadband.com>
parents:
diff
changeset
|
16 };
|
koryspansel <koryspansel@bendbroadband.com>
parents:
diff
changeset
|
17
|
koryspansel <koryspansel@bendbroadband.com>
parents:
diff
changeset
|
18 /*
|
koryspansel <koryspansel@bendbroadband.com>
parents:
diff
changeset
|
19 * VertexInput
|
koryspansel <koryspansel@bendbroadband.com>
parents:
diff
changeset
|
20 */
|
koryspansel <koryspansel@bendbroadband.com>
parents:
diff
changeset
|
21 struct VertexInput
|
koryspansel <koryspansel@bendbroadband.com>
parents:
diff
changeset
|
22 {
|
koryspansel <koryspansel@bendbroadband.com>
parents:
diff
changeset
|
23 /*
|
koryspansel <koryspansel@bendbroadband.com>
parents:
diff
changeset
|
24 * Position
|
koryspansel <koryspansel@bendbroadband.com>
parents:
diff
changeset
|
25 */
|
koryspansel <koryspansel@bendbroadband.com>
parents:
diff
changeset
|
26 float3 Position : POSITION0;
|
koryspansel <koryspansel@bendbroadband.com>
parents:
diff
changeset
|
27
|
koryspansel <koryspansel@bendbroadband.com>
parents:
diff
changeset
|
28 /*
|
koryspansel <koryspansel@bendbroadband.com>
parents:
diff
changeset
|
29 * TextureCoordinate
|
koryspansel <koryspansel@bendbroadband.com>
parents:
diff
changeset
|
30 */
|
koryspansel <koryspansel@bendbroadband.com>
parents:
diff
changeset
|
31 float2 TextureCoordinate : TEXCOORD0;
|
koryspansel <koryspansel@bendbroadband.com>
parents:
diff
changeset
|
32 };
|
koryspansel <koryspansel@bendbroadband.com>
parents:
diff
changeset
|
33
|
koryspansel <koryspansel@bendbroadband.com>
parents:
diff
changeset
|
34 /*
|
koryspansel <koryspansel@bendbroadband.com>
parents:
diff
changeset
|
35 * VertexOutput
|
koryspansel <koryspansel@bendbroadband.com>
parents:
diff
changeset
|
36 */
|
koryspansel <koryspansel@bendbroadband.com>
parents:
diff
changeset
|
37 struct VertexOutput
|
koryspansel <koryspansel@bendbroadband.com>
parents:
diff
changeset
|
38 {
|
koryspansel <koryspansel@bendbroadband.com>
parents:
diff
changeset
|
39 /*
|
koryspansel <koryspansel@bendbroadband.com>
parents:
diff
changeset
|
40 * Position
|
koryspansel <koryspansel@bendbroadband.com>
parents:
diff
changeset
|
41 */
|
koryspansel <koryspansel@bendbroadband.com>
parents:
diff
changeset
|
42 float4 Position : POSITION0;
|
koryspansel <koryspansel@bendbroadband.com>
parents:
diff
changeset
|
43
|
koryspansel <koryspansel@bendbroadband.com>
parents:
diff
changeset
|
44 /*
|
koryspansel <koryspansel@bendbroadband.com>
parents:
diff
changeset
|
45 * TextureCoordinate
|
koryspansel <koryspansel@bendbroadband.com>
parents:
diff
changeset
|
46 */
|
koryspansel <koryspansel@bendbroadband.com>
parents:
diff
changeset
|
47 float2 TextureCoordinate : TEXCOORD0;
|
koryspansel <koryspansel@bendbroadband.com>
parents:
diff
changeset
|
48 };
|
koryspansel <koryspansel@bendbroadband.com>
parents:
diff
changeset
|
49
|
koryspansel <koryspansel@bendbroadband.com>
parents:
diff
changeset
|
50 /*
|
koryspansel <koryspansel@bendbroadband.com>
parents:
diff
changeset
|
51 * PixelInput
|
koryspansel <koryspansel@bendbroadband.com>
parents:
diff
changeset
|
52 */
|
koryspansel <koryspansel@bendbroadband.com>
parents:
diff
changeset
|
53 struct PixelInput
|
koryspansel <koryspansel@bendbroadband.com>
parents:
diff
changeset
|
54 {
|
koryspansel <koryspansel@bendbroadband.com>
parents:
diff
changeset
|
55 /*
|
koryspansel <koryspansel@bendbroadband.com>
parents:
diff
changeset
|
56 * TextureCoordinate
|
koryspansel <koryspansel@bendbroadband.com>
parents:
diff
changeset
|
57 */
|
koryspansel <koryspansel@bendbroadband.com>
parents:
diff
changeset
|
58 float2 TextureCoordinate : TEXCOORD0;
|
koryspansel <koryspansel@bendbroadband.com>
parents:
diff
changeset
|
59
|
koryspansel <koryspansel@bendbroadband.com>
parents:
diff
changeset
|
60 /*
|
koryspansel <koryspansel@bendbroadband.com>
parents:
diff
changeset
|
61 * Color
|
koryspansel <koryspansel@bendbroadband.com>
parents:
diff
changeset
|
62 */
|
koryspansel <koryspansel@bendbroadband.com>
parents:
diff
changeset
|
63 float4 Color : COLOR0;
|
koryspansel <koryspansel@bendbroadband.com>
parents:
diff
changeset
|
64 };
|
koryspansel <koryspansel@bendbroadband.com>
parents:
diff
changeset
|
65
|
koryspansel <koryspansel@bendbroadband.com>
parents:
diff
changeset
|
66 /*
|
koryspansel <koryspansel@bendbroadband.com>
parents:
diff
changeset
|
67 * PixelOutput
|
koryspansel <koryspansel@bendbroadband.com>
parents:
diff
changeset
|
68 */
|
koryspansel <koryspansel@bendbroadband.com>
parents:
diff
changeset
|
69 struct PixelOutput
|
koryspansel <koryspansel@bendbroadband.com>
parents:
diff
changeset
|
70 {
|
koryspansel <koryspansel@bendbroadband.com>
parents:
diff
changeset
|
71 /*
|
koryspansel <koryspansel@bendbroadband.com>
parents:
diff
changeset
|
72 * Color
|
koryspansel <koryspansel@bendbroadband.com>
parents:
diff
changeset
|
73 */
|
koryspansel <koryspansel@bendbroadband.com>
parents:
diff
changeset
|
74 float4 Color : COLOR0;
|
koryspansel <koryspansel@bendbroadband.com>
parents:
diff
changeset
|
75 };
|
koryspansel <koryspansel@bendbroadband.com>
parents:
diff
changeset
|
76
|
koryspansel <koryspansel@bendbroadband.com>
parents:
diff
changeset
|
77 /*
|
koryspansel <koryspansel@bendbroadband.com>
parents:
diff
changeset
|
78 * TexturedQuadVS
|
koryspansel <koryspansel@bendbroadband.com>
parents:
diff
changeset
|
79 */
|
koryspansel <koryspansel@bendbroadband.com>
parents:
diff
changeset
|
80 VertexOutput TexturedQuadVS(VertexInput kInput)
|
koryspansel <koryspansel@bendbroadband.com>
parents:
diff
changeset
|
81 {
|
koryspansel <koryspansel@bendbroadband.com>
parents:
diff
changeset
|
82 VertexOutput kOutput;
|
koryspansel <koryspansel@bendbroadband.com>
parents:
diff
changeset
|
83
|
koryspansel <koryspansel@bendbroadband.com>
parents:
diff
changeset
|
84 kOutput.Position = mul(float4(kInput.Position, 1.0f), mul(kWorld, kProjection));
|
koryspansel <koryspansel@bendbroadband.com>
parents:
diff
changeset
|
85 kOutput.TextureCoordinate = kInput.TextureCoordinate;
|
koryspansel <koryspansel@bendbroadband.com>
parents:
diff
changeset
|
86
|
koryspansel <koryspansel@bendbroadband.com>
parents:
diff
changeset
|
87 return kOutput;
|
koryspansel <koryspansel@bendbroadband.com>
parents:
diff
changeset
|
88 }
|
koryspansel <koryspansel@bendbroadband.com>
parents:
diff
changeset
|
89
|
koryspansel <koryspansel@bendbroadband.com>
parents:
diff
changeset
|
90 /*
|
koryspansel <koryspansel@bendbroadband.com>
parents:
diff
changeset
|
91 * TexturedQuadPS
|
koryspansel <koryspansel@bendbroadband.com>
parents:
diff
changeset
|
92 */
|
koryspansel <koryspansel@bendbroadband.com>
parents:
diff
changeset
|
93 PixelOutput TexturedQuadPS(PixelInput kInput)
|
koryspansel <koryspansel@bendbroadband.com>
parents:
diff
changeset
|
94 {
|
koryspansel <koryspansel@bendbroadband.com>
parents:
diff
changeset
|
95 PixelOutput kOutput;
|
koryspansel <koryspansel@bendbroadband.com>
parents:
diff
changeset
|
96
|
koryspansel <koryspansel@bendbroadband.com>
parents:
diff
changeset
|
97 float4 kTexture = tex2D(TextureSampler, kInput.TextureCoordinate);
|
koryspansel <koryspansel@bendbroadband.com>
parents:
diff
changeset
|
98
|
koryspansel <koryspansel@bendbroadband.com>
parents:
diff
changeset
|
99 kOutput.Color = float4(kTexture.rgb * kColor.rgb, kTexture.a);
|
koryspansel <koryspansel@bendbroadband.com>
parents:
diff
changeset
|
100 //kOutput.Color = kColor;
|
koryspansel <koryspansel@bendbroadband.com>
parents:
diff
changeset
|
101
|
koryspansel <koryspansel@bendbroadband.com>
parents:
diff
changeset
|
102 return kOutput;
|
koryspansel <koryspansel@bendbroadband.com>
parents:
diff
changeset
|
103 }
|
koryspansel <koryspansel@bendbroadband.com>
parents:
diff
changeset
|
104
|
koryspansel <koryspansel@bendbroadband.com>
parents:
diff
changeset
|
105 technique Default
|
koryspansel <koryspansel@bendbroadband.com>
parents:
diff
changeset
|
106 {
|
koryspansel <koryspansel@bendbroadband.com>
parents:
diff
changeset
|
107 pass Opaque
|
koryspansel <koryspansel@bendbroadband.com>
parents:
diff
changeset
|
108 {
|
koryspansel <koryspansel@bendbroadband.com>
parents:
diff
changeset
|
109 vertexShader = compile vs_2_0 TexturedQuadVS();
|
koryspansel <koryspansel@bendbroadband.com>
parents:
diff
changeset
|
110 pixelShader = compile ps_2_0 TexturedQuadPS();
|
koryspansel <koryspansel@bendbroadband.com>
parents:
diff
changeset
|
111
|
koryspansel <koryspansel@bendbroadband.com>
parents:
diff
changeset
|
112 /*
|
koryspansel <koryspansel@bendbroadband.com>
parents:
diff
changeset
|
113 ZEnable = true;
|
koryspansel <koryspansel@bendbroadband.com>
parents:
diff
changeset
|
114 ZWriteEnable = true;
|
koryspansel <koryspansel@bendbroadband.com>
parents:
diff
changeset
|
115 ZFunc = LessEqual;
|
koryspansel <koryspansel@bendbroadband.com>
parents:
diff
changeset
|
116 */
|
koryspansel <koryspansel@bendbroadband.com>
parents:
diff
changeset
|
117
|
koryspansel <koryspansel@bendbroadband.com>
parents:
diff
changeset
|
118 AlphaBlendEnable = true;
|
koryspansel <koryspansel@bendbroadband.com>
parents:
diff
changeset
|
119 AlphaFunc = LessEqual;
|
koryspansel <koryspansel@bendbroadband.com>
parents:
diff
changeset
|
120 SrcBlend = SrcAlpha;
|
koryspansel <koryspansel@bendbroadband.com>
parents:
diff
changeset
|
121 DestBlend = InvSrcAlpha;
|
koryspansel <koryspansel@bendbroadband.com>
parents:
diff
changeset
|
122 }
|
koryspansel <koryspansel@bendbroadband.com>
parents:
diff
changeset
|
123 } |