string description = "DropShadowTextRendering"; /************* UN-TWEAKABLES **************/ /*********** Tweakables **********************/ float4x4 wM < string UIWidget="None"; >; float4 colourMod = {0.0f, 0.0f, 0.0f, 1.0f}; /************* Textures ******************/ sampler2D TexturePage[1]; /************* DATA STRUCTS **************/ /* data from application vertex buffer */ struct appdata { float4 position : POSITION; float2 texCoord0 : TEXCOORD0; int textureIdx : TEXCOORD1; }; /* data passed from vertex shader to pixel shader */ struct vertexOutput { float4 position : POSITION; float2 texCoord : TEXCOORD0; int textureIdx : TEXCOORD1; }; /*********** vertex program ******/ vertexOutput simpleVP(appdata IN) { vertexOutput OUT = (vertexOutput)0; //constants OUT.texCoord = IN.texCoord0; //position OUT.position = mul(wM, IN.position); OUT.textureIdx = IN.textureIdx; return OUT; } /********* fragment program ********/ float4 simpleFP(vertexOutput IN) : COLOR { float4 texCol = tex2D(TexturePage[0], IN.texCoord); return texCol*float4(colourMod.r, colourMod.g, colourMod.b, texCol.a); } /*************/ technique basic { pass p0 { VertexProgram = compile arbvp1 simpleVP(); FragmentProgram = compile arbfp1 simpleFP(); AlphaTestEnable = true; DepthTestEnable = true; DepthMask = true; BlendEnable = true; BlendFunc = int2(SrcAlpha, InvSrcAlpha); } } /***************************** eof ***/