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 /*
|
51
|
35 * VertexInput1
|
|
36 */
|
|
37 struct VertexInput1
|
|
38 {
|
|
39 /*
|
|
40 * Position
|
|
41 */
|
|
42 float3 Position : POSITION0;
|
|
43
|
|
44 /*
|
|
45 * TextureCoordinate
|
|
46 */
|
|
47 float2 TextureCoordinate : TEXCOORD0;
|
|
48
|
|
49 /*
|
|
50 * Color
|
|
51 */
|
|
52 float4 Color : COLOR0;
|
|
53 };
|
|
54
|
|
55 /*
|
0
koryspansel <koryspansel@bendbroadband.com>
parents:
diff
changeset
|
56 * VertexOutput
|
koryspansel <koryspansel@bendbroadband.com>
parents:
diff
changeset
|
57 */
|
koryspansel <koryspansel@bendbroadband.com>
parents:
diff
changeset
|
58 struct VertexOutput
|
koryspansel <koryspansel@bendbroadband.com>
parents:
diff
changeset
|
59 {
|
koryspansel <koryspansel@bendbroadband.com>
parents:
diff
changeset
|
60 /*
|
koryspansel <koryspansel@bendbroadband.com>
parents:
diff
changeset
|
61 * Position
|
koryspansel <koryspansel@bendbroadband.com>
parents:
diff
changeset
|
62 */
|
koryspansel <koryspansel@bendbroadband.com>
parents:
diff
changeset
|
63 float4 Position : POSITION0;
|
koryspansel <koryspansel@bendbroadband.com>
parents:
diff
changeset
|
64
|
koryspansel <koryspansel@bendbroadband.com>
parents:
diff
changeset
|
65 /*
|
koryspansel <koryspansel@bendbroadband.com>
parents:
diff
changeset
|
66 * TextureCoordinate
|
koryspansel <koryspansel@bendbroadband.com>
parents:
diff
changeset
|
67 */
|
koryspansel <koryspansel@bendbroadband.com>
parents:
diff
changeset
|
68 float2 TextureCoordinate : TEXCOORD0;
|
koryspansel <koryspansel@bendbroadband.com>
parents:
diff
changeset
|
69 };
|
koryspansel <koryspansel@bendbroadband.com>
parents:
diff
changeset
|
70
|
koryspansel <koryspansel@bendbroadband.com>
parents:
diff
changeset
|
71 /*
|
51
|
72 * VertexOutput1
|
|
73 */
|
|
74 struct VertexOutput1
|
|
75 {
|
|
76 /*
|
|
77 * Position
|
|
78 */
|
|
79 float4 Position : POSITION0;
|
|
80
|
|
81 /*
|
|
82 * TextureCoordinate
|
|
83 */
|
|
84 float2 TextureCoordinate : TEXCOORD0;
|
|
85
|
|
86 /*
|
|
87 * Color
|
|
88 */
|
|
89 float4 Color : COLOR0;
|
|
90 };
|
|
91
|
|
92 /*
|
0
koryspansel <koryspansel@bendbroadband.com>
parents:
diff
changeset
|
93 * PixelInput
|
koryspansel <koryspansel@bendbroadband.com>
parents:
diff
changeset
|
94 */
|
koryspansel <koryspansel@bendbroadband.com>
parents:
diff
changeset
|
95 struct PixelInput
|
koryspansel <koryspansel@bendbroadband.com>
parents:
diff
changeset
|
96 {
|
koryspansel <koryspansel@bendbroadband.com>
parents:
diff
changeset
|
97 /*
|
koryspansel <koryspansel@bendbroadband.com>
parents:
diff
changeset
|
98 * TextureCoordinate
|
koryspansel <koryspansel@bendbroadband.com>
parents:
diff
changeset
|
99 */
|
koryspansel <koryspansel@bendbroadband.com>
parents:
diff
changeset
|
100 float2 TextureCoordinate : TEXCOORD0;
|
koryspansel <koryspansel@bendbroadband.com>
parents:
diff
changeset
|
101
|
koryspansel <koryspansel@bendbroadband.com>
parents:
diff
changeset
|
102 /*
|
koryspansel <koryspansel@bendbroadband.com>
parents:
diff
changeset
|
103 * Color
|
koryspansel <koryspansel@bendbroadband.com>
parents:
diff
changeset
|
104 */
|
koryspansel <koryspansel@bendbroadband.com>
parents:
diff
changeset
|
105 float4 Color : COLOR0;
|
koryspansel <koryspansel@bendbroadband.com>
parents:
diff
changeset
|
106 };
|
koryspansel <koryspansel@bendbroadband.com>
parents:
diff
changeset
|
107
|
koryspansel <koryspansel@bendbroadband.com>
parents:
diff
changeset
|
108 /*
|
koryspansel <koryspansel@bendbroadband.com>
parents:
diff
changeset
|
109 * PixelOutput
|
koryspansel <koryspansel@bendbroadband.com>
parents:
diff
changeset
|
110 */
|
koryspansel <koryspansel@bendbroadband.com>
parents:
diff
changeset
|
111 struct PixelOutput
|
koryspansel <koryspansel@bendbroadband.com>
parents:
diff
changeset
|
112 {
|
koryspansel <koryspansel@bendbroadband.com>
parents:
diff
changeset
|
113 /*
|
koryspansel <koryspansel@bendbroadband.com>
parents:
diff
changeset
|
114 * Color
|
koryspansel <koryspansel@bendbroadband.com>
parents:
diff
changeset
|
115 */
|
koryspansel <koryspansel@bendbroadband.com>
parents:
diff
changeset
|
116 float4 Color : COLOR0;
|
koryspansel <koryspansel@bendbroadband.com>
parents:
diff
changeset
|
117 };
|
koryspansel <koryspansel@bendbroadband.com>
parents:
diff
changeset
|
118
|
koryspansel <koryspansel@bendbroadband.com>
parents:
diff
changeset
|
119 /*
|
koryspansel <koryspansel@bendbroadband.com>
parents:
diff
changeset
|
120 * TexturedQuadVS
|
koryspansel <koryspansel@bendbroadband.com>
parents:
diff
changeset
|
121 */
|
koryspansel <koryspansel@bendbroadband.com>
parents:
diff
changeset
|
122 VertexOutput TexturedQuadVS(VertexInput kInput)
|
koryspansel <koryspansel@bendbroadband.com>
parents:
diff
changeset
|
123 {
|
koryspansel <koryspansel@bendbroadband.com>
parents:
diff
changeset
|
124 VertexOutput kOutput;
|
koryspansel <koryspansel@bendbroadband.com>
parents:
diff
changeset
|
125
|
koryspansel <koryspansel@bendbroadband.com>
parents:
diff
changeset
|
126 kOutput.Position = mul(float4(kInput.Position, 1.0f), mul(kWorld, kProjection));
|
koryspansel <koryspansel@bendbroadband.com>
parents:
diff
changeset
|
127 kOutput.TextureCoordinate = kInput.TextureCoordinate;
|
koryspansel <koryspansel@bendbroadband.com>
parents:
diff
changeset
|
128
|
koryspansel <koryspansel@bendbroadband.com>
parents:
diff
changeset
|
129 return kOutput;
|
koryspansel <koryspansel@bendbroadband.com>
parents:
diff
changeset
|
130 }
|
koryspansel <koryspansel@bendbroadband.com>
parents:
diff
changeset
|
131
|
koryspansel <koryspansel@bendbroadband.com>
parents:
diff
changeset
|
132 /*
|
51
|
133 * TexturedQuadVS
|
|
134 */
|
|
135 VertexOutput1 TexturedQuadVS1(VertexInput1 kInput)
|
|
136 {
|
|
137 VertexOutput1 kOutput;
|
|
138
|
|
139 kOutput.Position = mul(float4(kInput.Position, 1.0f), kProjection);
|
|
140 kOutput.TextureCoordinate = kInput.TextureCoordinate;
|
|
141 kOutput.Color = kInput.Color;
|
|
142
|
|
143 return kOutput;
|
|
144 }
|
|
145
|
|
146 /*
|
0
koryspansel <koryspansel@bendbroadband.com>
parents:
diff
changeset
|
147 * TexturedQuadPS
|
koryspansel <koryspansel@bendbroadband.com>
parents:
diff
changeset
|
148 */
|
koryspansel <koryspansel@bendbroadband.com>
parents:
diff
changeset
|
149 PixelOutput TexturedQuadPS(PixelInput kInput)
|
koryspansel <koryspansel@bendbroadband.com>
parents:
diff
changeset
|
150 {
|
koryspansel <koryspansel@bendbroadband.com>
parents:
diff
changeset
|
151 PixelOutput kOutput;
|
koryspansel <koryspansel@bendbroadband.com>
parents:
diff
changeset
|
152
|
koryspansel <koryspansel@bendbroadband.com>
parents:
diff
changeset
|
153 float4 kTexture = tex2D(TextureSampler, kInput.TextureCoordinate);
|
koryspansel <koryspansel@bendbroadband.com>
parents:
diff
changeset
|
154
|
koryspansel <koryspansel@bendbroadband.com>
parents:
diff
changeset
|
155 kOutput.Color = float4(kTexture.rgb * kColor.rgb, kTexture.a);
|
koryspansel <koryspansel@bendbroadband.com>
parents:
diff
changeset
|
156 //kOutput.Color = kColor;
|
koryspansel <koryspansel@bendbroadband.com>
parents:
diff
changeset
|
157
|
koryspansel <koryspansel@bendbroadband.com>
parents:
diff
changeset
|
158 return kOutput;
|
koryspansel <koryspansel@bendbroadband.com>
parents:
diff
changeset
|
159 }
|
koryspansel <koryspansel@bendbroadband.com>
parents:
diff
changeset
|
160
|
51
|
161 /*
|
|
162 * TexturedQuadPS
|
|
163 */
|
|
164 PixelOutput TexturedQuadPS1(PixelInput kInput)
|
|
165 {
|
|
166 PixelOutput kOutput;
|
|
167
|
|
168 float4 kTexture = tex2D(TextureSampler, kInput.TextureCoordinate);
|
|
169 kOutput.Color = float4(kTexture.rgb * kInput.Color.rgb, kTexture.a);
|
|
170
|
|
171 return kOutput;
|
|
172 }
|
|
173
|
0
koryspansel <koryspansel@bendbroadband.com>
parents:
diff
changeset
|
174 technique Default
|
koryspansel <koryspansel@bendbroadband.com>
parents:
diff
changeset
|
175 {
|
koryspansel <koryspansel@bendbroadband.com>
parents:
diff
changeset
|
176 pass Opaque
|
koryspansel <koryspansel@bendbroadband.com>
parents:
diff
changeset
|
177 {
|
koryspansel <koryspansel@bendbroadband.com>
parents:
diff
changeset
|
178 vertexShader = compile vs_2_0 TexturedQuadVS();
|
koryspansel <koryspansel@bendbroadband.com>
parents:
diff
changeset
|
179 pixelShader = compile ps_2_0 TexturedQuadPS();
|
koryspansel <koryspansel@bendbroadband.com>
parents:
diff
changeset
|
180
|
51
|
181 //ZEnable = true;
|
|
182 //ZWriteEnable = true;
|
|
183 //ZFunc = LessEqual;
|
0
koryspansel <koryspansel@bendbroadband.com>
parents:
diff
changeset
|
184
|
koryspansel <koryspansel@bendbroadband.com>
parents:
diff
changeset
|
185 AlphaBlendEnable = true;
|
koryspansel <koryspansel@bendbroadband.com>
parents:
diff
changeset
|
186 AlphaFunc = LessEqual;
|
koryspansel <koryspansel@bendbroadband.com>
parents:
diff
changeset
|
187 SrcBlend = SrcAlpha;
|
koryspansel <koryspansel@bendbroadband.com>
parents:
diff
changeset
|
188 DestBlend = InvSrcAlpha;
|
koryspansel <koryspansel@bendbroadband.com>
parents:
diff
changeset
|
189 }
|
51
|
190 }
|
|
191
|
|
192 technique Color
|
|
193 {
|
|
194 pass Opaque
|
|
195 {
|
|
196 vertexShader = compile vs_2_0 TexturedQuadVS1();
|
|
197 pixelShader = compile ps_2_0 TexturedQuadPS1();
|
|
198
|
|
199 ZEnable = true;
|
|
200 ZWriteEnable = true;
|
|
201 //ZFunc = LessEqual;
|
|
202
|
|
203 AlphaBlendEnable = true;
|
|
204 AlphaFunc = LessEqual;
|
|
205 SrcBlend = SrcAlpha;
|
|
206 DestBlend = InvSrcAlpha;
|
|
207 }
|
|
208 }
|