|
1 typedef float4 rect; |
|
2 cbuffer PerLayer { |
|
3 rect vTextureCoords; |
|
4 rect vLayerQuad; |
|
5 rect vMaskQuad; |
|
6 float fLayerOpacity; |
|
7 float4x4 mLayerTransform; |
|
8 } |
|
9 |
|
10 cbuffer PerOccasionalLayer { |
|
11 float4 vRenderTargetOffset; |
|
12 float4 fLayerColor; |
|
13 } |
|
14 |
|
15 cbuffer PerLayerManager { |
|
16 float4x4 mProjection; |
|
17 } |
|
18 |
|
19 BlendState Premul |
|
20 { |
|
21 AlphaToCoverageEnable = FALSE; |
|
22 BlendEnable[0] = TRUE; |
|
23 SrcBlend = One; |
|
24 DestBlend = Inv_Src_Alpha; |
|
25 BlendOp = Add; |
|
26 SrcBlendAlpha = One; |
|
27 DestBlendAlpha = Inv_Src_Alpha; |
|
28 BlendOpAlpha = Add; |
|
29 RenderTargetWriteMask[0] = 0x0F; // All |
|
30 }; |
|
31 |
|
32 BlendState NonPremul |
|
33 { |
|
34 AlphaToCoverageEnable = FALSE; |
|
35 BlendEnable[0] = TRUE; |
|
36 SrcBlend = Src_Alpha; |
|
37 DestBlend = Inv_Src_Alpha; |
|
38 BlendOp = Add; |
|
39 SrcBlendAlpha = One; |
|
40 DestBlendAlpha = Inv_Src_Alpha; |
|
41 BlendOpAlpha = Add; |
|
42 RenderTargetWriteMask[0] = 0x0F; // All |
|
43 }; |
|
44 |
|
45 BlendState NoBlendDual |
|
46 { |
|
47 AlphaToCoverageEnable = FALSE; |
|
48 BlendEnable[0] = FALSE; |
|
49 BlendEnable[1] = FALSE; |
|
50 RenderTargetWriteMask[0] = 0x0F; // All |
|
51 RenderTargetWriteMask[1] = 0x0F; // All |
|
52 }; |
|
53 |
|
54 BlendState ComponentAlphaBlend |
|
55 { |
|
56 AlphaToCoverageEnable = FALSE; |
|
57 BlendEnable[0] = TRUE; |
|
58 SrcBlend = One; |
|
59 DestBlend = Inv_Src1_Color; |
|
60 BlendOp = Add; |
|
61 SrcBlendAlpha = One; |
|
62 DestBlendAlpha = Inv_Src_Alpha; |
|
63 BlendOpAlpha = Add; |
|
64 RenderTargetWriteMask[0] = 0x0F; // All |
|
65 }; |
|
66 |
|
67 RasterizerState LayerRast |
|
68 { |
|
69 ScissorEnable = True; |
|
70 CullMode = None; |
|
71 }; |
|
72 |
|
73 Texture2D tRGB; |
|
74 Texture2D tY; |
|
75 Texture2D tCb; |
|
76 Texture2D tCr; |
|
77 Texture2D tRGBWhite; |
|
78 Texture2D tMask; |
|
79 |
|
80 SamplerState LayerTextureSamplerLinear |
|
81 { |
|
82 Filter = MIN_MAG_MIP_LINEAR; |
|
83 AddressU = Clamp; |
|
84 AddressV = Clamp; |
|
85 }; |
|
86 |
|
87 SamplerState LayerTextureSamplerPoint |
|
88 { |
|
89 Filter = MIN_MAG_MIP_POINT; |
|
90 AddressU = Clamp; |
|
91 AddressV = Clamp; |
|
92 }; |
|
93 |
|
94 struct VS_INPUT { |
|
95 float2 vPosition : POSITION; |
|
96 }; |
|
97 |
|
98 struct VS_OUTPUT { |
|
99 float4 vPosition : SV_Position; |
|
100 float2 vTexCoords : TEXCOORD0; |
|
101 }; |
|
102 |
|
103 struct VS_MASK_OUTPUT { |
|
104 float4 vPosition : SV_Position; |
|
105 float2 vTexCoords : TEXCOORD0; |
|
106 float2 vMaskCoords : TEXCOORD1; |
|
107 }; |
|
108 |
|
109 struct VS_MASK_3D_OUTPUT { |
|
110 float4 vPosition : SV_Position; |
|
111 float2 vTexCoords : TEXCOORD0; |
|
112 float3 vMaskCoords : TEXCOORD1; |
|
113 }; |
|
114 |
|
115 struct PS_OUTPUT { |
|
116 float4 vSrc; |
|
117 float4 vAlpha; |
|
118 }; |
|
119 |
|
120 struct PS_DUAL_OUTPUT { |
|
121 float4 vOutput1 : SV_Target0; |
|
122 float4 vOutput2 : SV_Target1; |
|
123 }; |
|
124 |
|
125 float2 TexCoords(const float2 aPosition) |
|
126 { |
|
127 float2 result; |
|
128 const float2 size = vTextureCoords.zw; |
|
129 result.x = vTextureCoords.x + aPosition.x * size.x; |
|
130 result.y = vTextureCoords.y + aPosition.y * size.y; |
|
131 |
|
132 return result; |
|
133 } |
|
134 |
|
135 float4 TransformedPostion(float2 aInPosition) |
|
136 { |
|
137 // the current vertex's position on the quad |
|
138 float4 position = float4(0, 0, 0, 1); |
|
139 |
|
140 // We use 4 component floats to uniquely describe a rectangle, by the structure |
|
141 // of x, y, width, height. This allows us to easily generate the 4 corners |
|
142 // of any rectangle from the 4 corners of the 0,0-1,1 quad that we use as the |
|
143 // stream source for our LayerQuad vertex shader. We do this by doing: |
|
144 // Xout = x + Xin * width |
|
145 // Yout = y + Yin * height |
|
146 float2 size = vLayerQuad.zw; |
|
147 position.x = vLayerQuad.x + aInPosition.x * size.x; |
|
148 position.y = vLayerQuad.y + aInPosition.y * size.y; |
|
149 |
|
150 position = mul(mLayerTransform, position); |
|
151 |
|
152 return position; |
|
153 } |
|
154 |
|
155 float4 VertexPosition(float4 aTransformedPosition) |
|
156 { |
|
157 float4 result; |
|
158 result.w = aTransformedPosition.w; |
|
159 result.xyz = aTransformedPosition.xyz / aTransformedPosition.w; |
|
160 result -= vRenderTargetOffset; |
|
161 result.xyz *= result.w; |
|
162 |
|
163 result = mul(mProjection, result); |
|
164 |
|
165 return result; |
|
166 } |
|
167 |
|
168 VS_OUTPUT LayerQuadVS(const VS_INPUT aVertex) |
|
169 { |
|
170 VS_OUTPUT outp; |
|
171 float4 position = TransformedPostion(aVertex.vPosition); |
|
172 |
|
173 outp.vPosition = VertexPosition(position); |
|
174 outp.vTexCoords = TexCoords(aVertex.vPosition.xy); |
|
175 |
|
176 return outp; |
|
177 } |
|
178 |
|
179 VS_MASK_OUTPUT LayerQuadMaskVS(const VS_INPUT aVertex) |
|
180 { |
|
181 VS_MASK_OUTPUT outp; |
|
182 float4 position = TransformedPostion(aVertex.vPosition); |
|
183 |
|
184 outp.vPosition = VertexPosition(position); |
|
185 |
|
186 // calculate the position on the mask texture |
|
187 outp.vMaskCoords.x = (position.x - vMaskQuad.x) / vMaskQuad.z; |
|
188 outp.vMaskCoords.y = (position.y - vMaskQuad.y) / vMaskQuad.w; |
|
189 |
|
190 outp.vTexCoords = TexCoords(aVertex.vPosition.xy); |
|
191 |
|
192 return outp; |
|
193 } |
|
194 |
|
195 VS_MASK_3D_OUTPUT LayerQuadMask3DVS(const VS_INPUT aVertex) |
|
196 { |
|
197 VS_MASK_3D_OUTPUT outp; |
|
198 float4 position = TransformedPostion(aVertex.vPosition); |
|
199 |
|
200 outp.vPosition = VertexPosition(position); |
|
201 |
|
202 // calculate the position on the mask texture |
|
203 position.xyz /= position.w; |
|
204 outp.vMaskCoords.x = (position.x - vMaskQuad.x) / vMaskQuad.z; |
|
205 outp.vMaskCoords.y = (position.y - vMaskQuad.y) / vMaskQuad.w; |
|
206 // We use the w coord to do non-perspective correct interpolation: |
|
207 // the quad might be transformed in 3D, in which case it will have some |
|
208 // perspective. The graphics card will do perspective-correct interpolation |
|
209 // of the texture, but our mask is already transformed and so we require |
|
210 // linear interpolation. Therefore, we must correct the interpolation |
|
211 // ourselves, we do this by multiplying all coords by w here, and dividing by |
|
212 // w in the pixel shader (post-interpolation), we pass w in outp.vMaskCoords.z. |
|
213 // See http://en.wikipedia.org/wiki/Texture_mapping#Perspective_correctness |
|
214 outp.vMaskCoords.z = 1; |
|
215 outp.vMaskCoords *= position.w; |
|
216 |
|
217 outp.vTexCoords = TexCoords(aVertex.vPosition.xy); |
|
218 |
|
219 return outp; |
|
220 } |
|
221 |
|
222 float4 RGBAShaderMask(const VS_MASK_OUTPUT aVertex, uniform sampler aSampler) : SV_Target |
|
223 { |
|
224 float2 maskCoords = aVertex.vMaskCoords; |
|
225 float mask = tMask.Sample(LayerTextureSamplerLinear, maskCoords).a; |
|
226 return tRGB.Sample(aSampler, aVertex.vTexCoords) * fLayerOpacity * mask; |
|
227 } |
|
228 |
|
229 float4 RGBAShaderLinearMask3D(const VS_MASK_3D_OUTPUT aVertex) : SV_Target |
|
230 { |
|
231 float2 maskCoords = aVertex.vMaskCoords.xy / aVertex.vMaskCoords.z; |
|
232 float mask = tMask.Sample(LayerTextureSamplerLinear, maskCoords).a; |
|
233 return tRGB.Sample(LayerTextureSamplerLinear, aVertex.vTexCoords) * fLayerOpacity * mask; |
|
234 } |
|
235 |
|
236 float4 RGBShaderMask(const VS_MASK_OUTPUT aVertex, uniform sampler aSampler) : SV_Target |
|
237 { |
|
238 float4 result; |
|
239 result = tRGB.Sample(aSampler, aVertex.vTexCoords) * fLayerOpacity; |
|
240 result.a = fLayerOpacity; |
|
241 |
|
242 float2 maskCoords = aVertex.vMaskCoords; |
|
243 float mask = tMask.Sample(LayerTextureSamplerLinear, maskCoords).a; |
|
244 return result * mask; |
|
245 } |
|
246 |
|
247 float4 CalculateYCbCrColor(const float2 aTexCoords) |
|
248 { |
|
249 float4 yuv; |
|
250 float4 color; |
|
251 |
|
252 yuv.r = tCr.Sample(LayerTextureSamplerLinear, aTexCoords).a - 0.5; |
|
253 yuv.g = tY.Sample(LayerTextureSamplerLinear, aTexCoords).a - 0.0625; |
|
254 yuv.b = tCb.Sample(LayerTextureSamplerLinear, aTexCoords).a - 0.5; |
|
255 |
|
256 color.r = yuv.g * 1.164 + yuv.r * 1.596; |
|
257 color.g = yuv.g * 1.164 - 0.813 * yuv.r - 0.391 * yuv.b; |
|
258 color.b = yuv.g * 1.164 + yuv.b * 2.018; |
|
259 color.a = 1.0f; |
|
260 |
|
261 return color; |
|
262 } |
|
263 |
|
264 float4 YCbCrShaderMask(const VS_MASK_OUTPUT aVertex) : SV_Target |
|
265 { |
|
266 float2 maskCoords = aVertex.vMaskCoords; |
|
267 float mask = tMask.Sample(LayerTextureSamplerLinear, maskCoords).a; |
|
268 |
|
269 return CalculateYCbCrColor(aVertex.vTexCoords) * fLayerOpacity * mask; |
|
270 } |
|
271 |
|
272 PS_OUTPUT ComponentAlphaShaderMask(const VS_MASK_OUTPUT aVertex) : SV_Target |
|
273 { |
|
274 PS_OUTPUT result; |
|
275 |
|
276 result.vSrc = tRGB.Sample(LayerTextureSamplerLinear, aVertex.vTexCoords); |
|
277 result.vAlpha = 1.0 - tRGBWhite.Sample(LayerTextureSamplerLinear, aVertex.vTexCoords) + result.vSrc; |
|
278 result.vSrc.a = result.vAlpha.g; |
|
279 |
|
280 float2 maskCoords = aVertex.vMaskCoords; |
|
281 float mask = tMask.Sample(LayerTextureSamplerLinear, maskCoords).a; |
|
282 result.vSrc *= fLayerOpacity * mask; |
|
283 result.vAlpha *= fLayerOpacity * mask; |
|
284 |
|
285 return result; |
|
286 } |
|
287 |
|
288 float4 SolidColorShaderMask(const VS_MASK_OUTPUT aVertex) : SV_Target |
|
289 { |
|
290 float2 maskCoords = aVertex.vMaskCoords; |
|
291 float mask = tMask.Sample(LayerTextureSamplerLinear, maskCoords).a; |
|
292 return fLayerColor * mask; |
|
293 } |
|
294 |
|
295 /* |
|
296 * Un-masked versions |
|
297 ************************************************************* |
|
298 */ |
|
299 float4 RGBAShader(const VS_OUTPUT aVertex, uniform sampler aSampler) : SV_Target |
|
300 { |
|
301 return tRGB.Sample(aSampler, aVertex.vTexCoords) * fLayerOpacity; |
|
302 } |
|
303 |
|
304 float4 RGBShader(const VS_OUTPUT aVertex, uniform sampler aSampler) : SV_Target |
|
305 { |
|
306 float4 result; |
|
307 result = tRGB.Sample(aSampler, aVertex.vTexCoords) * fLayerOpacity; |
|
308 result.a = fLayerOpacity; |
|
309 return result; |
|
310 } |
|
311 |
|
312 float4 YCbCrShader(const VS_OUTPUT aVertex) : SV_Target |
|
313 { |
|
314 return CalculateYCbCrColor(aVertex.vTexCoords) * fLayerOpacity; |
|
315 } |
|
316 |
|
317 PS_OUTPUT ComponentAlphaShader(const VS_OUTPUT aVertex) : SV_Target |
|
318 { |
|
319 PS_OUTPUT result; |
|
320 |
|
321 result.vSrc = tRGB.Sample(LayerTextureSamplerLinear, aVertex.vTexCoords); |
|
322 result.vAlpha = 1.0 - tRGBWhite.Sample(LayerTextureSamplerLinear, aVertex.vTexCoords) + result.vSrc; |
|
323 result.vSrc.a = result.vAlpha.g; |
|
324 result.vSrc *= fLayerOpacity; |
|
325 result.vAlpha *= fLayerOpacity; |
|
326 return result; |
|
327 } |
|
328 |
|
329 float4 SolidColorShader(const VS_OUTPUT aVertex) : SV_Target |
|
330 { |
|
331 return fLayerColor; |
|
332 } |
|
333 |
|
334 PS_DUAL_OUTPUT AlphaExtractionPrepareShader(const VS_OUTPUT aVertex) |
|
335 { |
|
336 PS_DUAL_OUTPUT result; |
|
337 result.vOutput1 = float4(0, 0, 0, 1); |
|
338 result.vOutput2 = float4(1, 1, 1, 1); |
|
339 return result; |
|
340 } |
|
341 |
|
342 technique10 RenderRGBLayerPremul |
|
343 { |
|
344 pass P0 |
|
345 { |
|
346 SetRasterizerState( LayerRast ); |
|
347 SetBlendState( Premul, float4( 0.0f, 0.0f, 0.0f, 0.0f ), 0xFFFFFFFF ); |
|
348 SetVertexShader( CompileShader( vs_4_0_level_9_3, LayerQuadVS() ) ); |
|
349 SetGeometryShader( NULL ); |
|
350 SetPixelShader( CompileShader( ps_4_0_level_9_3, RGBShader(LayerTextureSamplerLinear) ) ); |
|
351 } |
|
352 } |
|
353 |
|
354 technique10 RenderRGBLayerPremulPoint |
|
355 { |
|
356 pass P0 |
|
357 { |
|
358 SetRasterizerState( LayerRast ); |
|
359 SetBlendState( Premul, float4( 0.0f, 0.0f, 0.0f, 0.0f ), 0xFFFFFFFF ); |
|
360 SetVertexShader( CompileShader( vs_4_0_level_9_3, LayerQuadVS() ) ); |
|
361 SetGeometryShader( NULL ); |
|
362 SetPixelShader( CompileShader( ps_4_0_level_9_3, RGBShader(LayerTextureSamplerPoint) ) ); |
|
363 } |
|
364 } |
|
365 |
|
366 technique10 RenderRGBALayerPremul |
|
367 { |
|
368 pass P0 |
|
369 { |
|
370 SetRasterizerState( LayerRast ); |
|
371 SetBlendState( Premul, float4( 0.0f, 0.0f, 0.0f, 0.0f ), 0xFFFFFFFF ); |
|
372 SetVertexShader( CompileShader( vs_4_0_level_9_3, LayerQuadVS() ) ); |
|
373 SetGeometryShader( NULL ); |
|
374 SetPixelShader( CompileShader( ps_4_0_level_9_3, RGBAShader(LayerTextureSamplerLinear) ) ); |
|
375 } |
|
376 } |
|
377 |
|
378 technique10 RenderRGBALayerNonPremul |
|
379 { |
|
380 pass P0 |
|
381 { |
|
382 SetRasterizerState( LayerRast ); |
|
383 SetBlendState( NonPremul, float4( 0.0f, 0.0f, 0.0f, 0.0f ), 0xFFFFFFFF ); |
|
384 SetVertexShader( CompileShader( vs_4_0_level_9_3, LayerQuadVS() ) ); |
|
385 SetGeometryShader( NULL ); |
|
386 SetPixelShader( CompileShader( ps_4_0_level_9_3, RGBAShader(LayerTextureSamplerLinear) ) ); |
|
387 } |
|
388 } |
|
389 |
|
390 technique10 RenderRGBALayerPremulPoint |
|
391 { |
|
392 pass P0 |
|
393 { |
|
394 SetRasterizerState( LayerRast ); |
|
395 SetBlendState( Premul, float4( 0.0f, 0.0f, 0.0f, 0.0f ), 0xFFFFFFFF ); |
|
396 SetVertexShader( CompileShader( vs_4_0_level_9_3, LayerQuadVS() ) ); |
|
397 SetGeometryShader( NULL ); |
|
398 SetPixelShader( CompileShader( ps_4_0_level_9_3, RGBAShader(LayerTextureSamplerPoint) ) ); |
|
399 } |
|
400 } |
|
401 |
|
402 technique10 RenderRGBALayerNonPremulPoint |
|
403 { |
|
404 pass P0 |
|
405 { |
|
406 SetRasterizerState( LayerRast ); |
|
407 SetBlendState( NonPremul, float4( 0.0f, 0.0f, 0.0f, 0.0f ), 0xFFFFFFFF ); |
|
408 SetVertexShader( CompileShader( vs_4_0_level_9_3, LayerQuadVS() ) ); |
|
409 SetGeometryShader( NULL ); |
|
410 SetPixelShader( CompileShader( ps_4_0_level_9_3, RGBAShader(LayerTextureSamplerPoint) ) ); |
|
411 } |
|
412 } |
|
413 |
|
414 technique10 RenderYCbCrLayer |
|
415 { |
|
416 pass P0 |
|
417 { |
|
418 SetRasterizerState( LayerRast ); |
|
419 SetBlendState( Premul, float4( 0.0f, 0.0f, 0.0f, 0.0f ), 0xFFFFFFFF ); |
|
420 SetVertexShader( CompileShader( vs_4_0_level_9_3, LayerQuadVS() ) ); |
|
421 SetGeometryShader( NULL ); |
|
422 SetPixelShader( CompileShader( ps_4_0_level_9_3, YCbCrShader() ) ); |
|
423 } |
|
424 } |
|
425 |
|
426 technique10 RenderComponentAlphaLayer |
|
427 { |
|
428 Pass P0 |
|
429 { |
|
430 SetRasterizerState( LayerRast ); |
|
431 SetBlendState( ComponentAlphaBlend, float4( 0.0f, 0.0f, 0.0f, 0.0f ), 0xFFFFFFFF ); |
|
432 SetVertexShader( CompileShader( vs_4_0_level_9_3, LayerQuadVS() ) ); |
|
433 SetGeometryShader( NULL ); |
|
434 SetPixelShader( CompileShader( ps_4_0_level_9_3, ComponentAlphaShader() ) ); |
|
435 } |
|
436 |
|
437 } |
|
438 |
|
439 technique10 RenderSolidColorLayer |
|
440 { |
|
441 pass P0 |
|
442 { |
|
443 SetRasterizerState( LayerRast ); |
|
444 SetBlendState( Premul, float4( 0.0f, 0.0f, 0.0f, 0.0f ), 0xFFFFFFFF ); |
|
445 SetVertexShader( CompileShader( vs_4_0_level_9_3, LayerQuadVS() ) ); |
|
446 SetGeometryShader( NULL ); |
|
447 SetPixelShader( CompileShader( ps_4_0_level_9_3, SolidColorShader() ) ); |
|
448 } |
|
449 } |
|
450 |
|
451 technique10 RenderClearLayer |
|
452 { |
|
453 pass P0 |
|
454 { |
|
455 SetRasterizerState( LayerRast ); |
|
456 SetBlendState( NoBlendDual, float4( 0.0f, 0.0f, 0.0f, 0.0f ), 0xFFFFFFFF ); |
|
457 SetVertexShader( CompileShader( vs_4_0_level_9_3, LayerQuadVS() ) ); |
|
458 SetGeometryShader( NULL ); |
|
459 SetPixelShader( CompileShader( ps_4_0_level_9_3, SolidColorShader() ) ); |
|
460 } |
|
461 } |
|
462 |
|
463 technique10 PrepareAlphaExtractionTextures |
|
464 { |
|
465 pass P0 |
|
466 { |
|
467 SetRasterizerState( LayerRast ); |
|
468 SetBlendState( NoBlendDual, float4( 0.0f, 0.0f, 0.0f, 0.0f ), 0xFFFFFFFF ); |
|
469 SetVertexShader( CompileShader( vs_4_0_level_9_3, LayerQuadVS() ) ); |
|
470 SetGeometryShader( NULL ); |
|
471 SetPixelShader( CompileShader( ps_4_0_level_9_3, AlphaExtractionPrepareShader() ) ); |
|
472 } |
|
473 } |
|
474 |
|
475 technique10 RenderRGBLayerPremulMask |
|
476 { |
|
477 pass P0 |
|
478 { |
|
479 SetRasterizerState( LayerRast ); |
|
480 SetBlendState( Premul, float4( 0.0f, 0.0f, 0.0f, 0.0f ), 0xFFFFFFFF ); |
|
481 SetVertexShader( CompileShader( vs_4_0_level_9_3, LayerQuadMaskVS() ) ); |
|
482 SetGeometryShader( NULL ); |
|
483 SetPixelShader( CompileShader( ps_4_0_level_9_3, RGBShaderMask(LayerTextureSamplerLinear) ) ); |
|
484 } |
|
485 } |
|
486 |
|
487 technique10 RenderRGBLayerPremulPointMask |
|
488 { |
|
489 pass P0 |
|
490 { |
|
491 SetRasterizerState( LayerRast ); |
|
492 SetBlendState( Premul, float4( 0.0f, 0.0f, 0.0f, 0.0f ), 0xFFFFFFFF ); |
|
493 SetVertexShader( CompileShader( vs_4_0_level_9_3, LayerQuadMaskVS() ) ); |
|
494 SetGeometryShader( NULL ); |
|
495 SetPixelShader( CompileShader( ps_4_0_level_9_3, RGBShaderMask(LayerTextureSamplerPoint) ) ); |
|
496 } |
|
497 } |
|
498 |
|
499 technique10 RenderRGBALayerPremulMask |
|
500 { |
|
501 pass P0 |
|
502 { |
|
503 SetRasterizerState( LayerRast ); |
|
504 SetBlendState( Premul, float4( 0.0f, 0.0f, 0.0f, 0.0f ), 0xFFFFFFFF ); |
|
505 SetVertexShader( CompileShader( vs_4_0_level_9_3, LayerQuadMaskVS() ) ); |
|
506 SetGeometryShader( NULL ); |
|
507 SetPixelShader( CompileShader( ps_4_0_level_9_3, RGBAShaderMask(LayerTextureSamplerLinear) ) ); |
|
508 } |
|
509 } |
|
510 |
|
511 technique10 RenderRGBALayerPremulMask3D |
|
512 { |
|
513 pass P0 |
|
514 { |
|
515 SetRasterizerState( LayerRast ); |
|
516 SetBlendState( Premul, float4( 0.0f, 0.0f, 0.0f, 0.0f ), 0xFFFFFFFF ); |
|
517 SetVertexShader( CompileShader( vs_4_0_level_9_3, LayerQuadMask3DVS() ) ); |
|
518 SetGeometryShader( NULL ); |
|
519 SetPixelShader( CompileShader( ps_4_0_level_9_3, RGBAShaderLinearMask3D() ) ); |
|
520 } |
|
521 } |
|
522 |
|
523 technique10 RenderRGBALayerNonPremulMask |
|
524 { |
|
525 pass P0 |
|
526 { |
|
527 SetRasterizerState( LayerRast ); |
|
528 SetBlendState( NonPremul, float4( 0.0f, 0.0f, 0.0f, 0.0f ), 0xFFFFFFFF ); |
|
529 SetVertexShader( CompileShader( vs_4_0_level_9_3, LayerQuadMaskVS() ) ); |
|
530 SetGeometryShader( NULL ); |
|
531 SetPixelShader( CompileShader( ps_4_0_level_9_3, RGBAShaderMask(LayerTextureSamplerLinear) ) ); |
|
532 } |
|
533 } |
|
534 |
|
535 technique10 RenderRGBALayerPremulPointMask |
|
536 { |
|
537 pass P0 |
|
538 { |
|
539 SetRasterizerState( LayerRast ); |
|
540 SetBlendState( Premul, float4( 0.0f, 0.0f, 0.0f, 0.0f ), 0xFFFFFFFF ); |
|
541 SetVertexShader( CompileShader( vs_4_0_level_9_3, LayerQuadMaskVS() ) ); |
|
542 SetGeometryShader( NULL ); |
|
543 SetPixelShader( CompileShader( ps_4_0_level_9_3, RGBAShaderMask(LayerTextureSamplerPoint) ) ); |
|
544 } |
|
545 } |
|
546 |
|
547 technique10 RenderRGBALayerNonPremulPointMask |
|
548 { |
|
549 pass P0 |
|
550 { |
|
551 SetRasterizerState( LayerRast ); |
|
552 SetBlendState( NonPremul, float4( 0.0f, 0.0f, 0.0f, 0.0f ), 0xFFFFFFFF ); |
|
553 SetVertexShader( CompileShader( vs_4_0_level_9_3, LayerQuadMaskVS() ) ); |
|
554 SetGeometryShader( NULL ); |
|
555 SetPixelShader( CompileShader( ps_4_0_level_9_3, RGBAShaderMask(LayerTextureSamplerPoint) ) ); |
|
556 } |
|
557 } |
|
558 |
|
559 technique10 RenderYCbCrLayerMask |
|
560 { |
|
561 pass P0 |
|
562 { |
|
563 SetRasterizerState( LayerRast ); |
|
564 SetBlendState( Premul, float4( 0.0f, 0.0f, 0.0f, 0.0f ), 0xFFFFFFFF ); |
|
565 SetVertexShader( CompileShader( vs_4_0_level_9_3, LayerQuadMaskVS() ) ); |
|
566 SetGeometryShader( NULL ); |
|
567 SetPixelShader( CompileShader( ps_4_0_level_9_3, YCbCrShaderMask() ) ); |
|
568 } |
|
569 } |
|
570 |
|
571 technique10 RenderComponentAlphaLayerMask |
|
572 { |
|
573 Pass P0 |
|
574 { |
|
575 SetRasterizerState( LayerRast ); |
|
576 SetBlendState( ComponentAlphaBlend, float4( 0.0f, 0.0f, 0.0f, 0.0f ), 0xFFFFFFFF ); |
|
577 SetVertexShader( CompileShader( vs_4_0_level_9_3, LayerQuadMaskVS() ) ); |
|
578 SetGeometryShader( NULL ); |
|
579 SetPixelShader( CompileShader( ps_4_0_level_9_3, ComponentAlphaShaderMask() ) ); |
|
580 } |
|
581 } |
|
582 |
|
583 technique10 RenderSolidColorLayerMask |
|
584 { |
|
585 pass P0 |
|
586 { |
|
587 SetRasterizerState( LayerRast ); |
|
588 SetBlendState( Premul, float4( 0.0f, 0.0f, 0.0f, 0.0f ), 0xFFFFFFFF ); |
|
589 SetVertexShader( CompileShader( vs_4_0_level_9_3, LayerQuadMaskVS() ) ); |
|
590 SetGeometryShader( NULL ); |
|
591 SetPixelShader( CompileShader( ps_4_0_level_9_3, SolidColorShaderMask() ) ); |
|
592 } |
|
593 } |
|
594 |