string description = "Simple"; /************* UN-TWEAKABLES **************/ float4x4 vP : ViewProjection < string UIWidget="None"; >; float4x4 wM : World < string UIWidget="None"; >; /*********** Tweakables **********************/ /************* Textures ******************/ texture cm : Diffuse < string ResourceType = "2D"; string UIWidget="None"; >; sampler2D baseColourMap = sampler_state { Texture = ; MinFilter = None; MipFilter = None; MagFilter = None; WrapS = ClampToEdge; WrapT = ClampToEdge; }; /************* DATA STRUCTS **************/ /* data from application vertex buffer */ struct appdata { float4 position : POSITION; float2 texCoord0 : TEXCOORD0; }; /* data passed from vertex shader to pixel shader */ struct vertexOutput { float4 position : POSITION; float2 texCoord : TEXCOORD0; }; /*********** vertex program ******/ vertexOutput simpleVP(appdata IN) { vertexOutput OUT = (vertexOutput)0; //constants OUT.texCoord = IN.texCoord0; OUT.texCoord.y = 1 - OUT.texCoord.y; //postion OUT.position = mul(mul(vP, wM), IN.position); return OUT; } /********* fragment program ********/ float4 simpleFP(vertexOutput IN) : COLOR { return float4(tex2D(baseColourMap, IN.texCoord).xyz, 1); } /*************/ technique basic { pass p0 { VertexProgram = compile vp30 simpleVP(); FragmentProgram = compile fp30 simpleFP(); DepthTestEnable = true; DepthMask = true; BlendEnable = false; } } /***************************** eof ***/