// --------------------------------------------------------------------------------------------- // // ScreenMask Effect // --------------------------------------------------------------------------------------------- // // // Fills any polygons drawn with it in a solid color // /// Color the screen will be filled with float4 Color : COLOR; // --------------------------------------------------------------------------------------------- // // Supporting Structures // --------------------------------------------------------------------------------------------- // /// Vertex shader output values. These are sent to the pixel shader. struct VertexShaderOutput { /// Position in screen coordinates float4 Position : POSITION0; }; // --------------------------------------------------------------------------------------------- // // Vertex Shader // --------------------------------------------------------------------------------------------- // /// Transforms a vertex into view space /// Position of the vertex in world coordinates /// Color of the vertex /// The transformed vertex VertexShaderOutput VertexShaderFunction(float4 position : POSITION0) { VertexShaderOutput output; output.Position = position; return output; } // --------------------------------------------------------------------------------------------- // // Pixel Shader // --------------------------------------------------------------------------------------------- // /// Calculates the color of a pixel /// Color the pixel will have /// The calculated color of the pixel float4 PixelShaderFunction() : COLOR0 { return Color; }; // --------------------------------------------------------------------------------------------- // // Techniques // --------------------------------------------------------------------------------------------- // technique SolidColorTechnique { pass FillPass { CullMode = None; ZEnable = false; ZWriteEnable = false; AlphaBlendEnable = true; SrcBlend = SrcAlpha; DestBlend = InvSrcAlpha; VertexShader = compile vs_2_0 VertexShaderFunction(); PixelShader = compile ps_2_0 PixelShaderFunction(); } }