sampler2D spriteTex; float4x4 wM; float4x4 vP; float4 colour; float2 corners[4]; float2 texCoords[4]; struct vertexOutput { float4 position : POSITION; float2 texCoord : TEXCOORD0; }; vertexOutput spriteVS( float3 position : POSITION) { vertexOutput OUT = (vertexOutput)0; // ssM = float4x4( 1, 0, 0, 0, // 0, 1, 0, 0, // 0, 0, 1, 0, // 0, 0, 0, 1); int posIndex = floor(position.z); OUT.position.xy = corners[posIndex].xy; OUT.position.zw = float2(0.f, 1.f); OUT.texCoord = texCoords[posIndex].xy; OUT.position = mul(wM, OUT.position); OUT.position = mul(vP, OUT.position); return OUT; } float4 spritePS( vertexOutput IN ) : COLOR0 { float4 final = tex2D(spriteTex, IN.texCoord) * colour; return final; } technique loadingScreen { pass p0 { VertexProgram = compile arbvp1 spriteVS(); FragmentProgram = compile arbfp1 spritePS(); AlphaTestEnable = true; DepthTestEnable = true; DepthMask = true; BlendEnable = true; BlendFunc = int2(SrcAlpha, InvSrcAlpha); CullFaceEnable = false; } }