// Percentage closer soft shadows // Our PC sodt fhadow implementation // SHADOWMAP generation //----------------------------------------------------------------------------- // Vertex Shader: RenderShadowMap_Focusing_VS // Desc: Process vertex for the shadow map //----------------------------------------------------------------------------- VS_OUTPUT RenderFocusingMap_VS( VS_INPUT IN ) { VS_OUTPUT OUT = (VS_OUTPUT)0; OUT.Color = IN.Color; OUT.Tex = IN.Tex; // transform model-space vertex position to light's normalized device space: OUT.ldPosition = mul(IN.Position, WorldLightProj); // transform model-space vertex position to normalized screen space: OUT.hPosition = mul(IN.Position, WorldViewProj); return OUT; } //----------------------------------------------------------------------------- // Pixel Shader: RenderShadowMapPS_Focusing_PS // Desc: Process pixel for the shadow map // Writes uv coordinate of light's camera space //----------------------------------------------------------------------------- float4 RenderFocusingMap_PS( VS_OUTPUT IN ):COLOR { float3 lexel = IN.ldPosition.xyz / IN.ldPosition.w; return float4( lexel, 1 ); } // TECHNIQUE //----------------------------------------------------------------------------- // Techniques: RenderShadowMap // Desc: Render the shadow map //----------------------------------------------------------------------------- technique RenderFocusingMap { pass p0 { VertexShader = compile vs_2_0 RenderFocusingMap_VS(); PixelShader = compile ps_2_0 RenderFocusingMap_PS(); } }