#include "properties.fx" #include "Shaders/technique_00.fx" #include "Shaders/technique_06.fx" #include "Shaders/technique_07.fx" #include "Shaders/technique_focusing.fx" //----------------------------------------------------------------------------- // RenderMapScreen // This shader renders the PhotonMap texture (g_txPhotonUVTexture) into the screen lower left corner. // This texture contains the PhotonHits positions and ObjectIDs. // The result is displayed on the screen. //----------------------------------------------------------------------------- void RenderMapScreenVS( float4 Pos : POSITION, out float4 outhPos : POSITION, out float2 outTex : TEXCOORD0 ) { outhPos = float4( Pos.xy, 0.0f, 1.0f ); outTex.x = Pos.x * 0.5f + 0.5f; outTex.y = -Pos.y * 0.5f + 0.5f; } // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - float4 RenderMapScreenPS( float2 Tex : TEXCOORD0 ) : COLOR { //return 1; half4 retColor = half4(0,0,0,1); return tex2D( g_ShadowWeightSampler, Tex ); } //***************************************************************************** void RenderMapScreen2VS( float4 Pos : POSITION, out float4 outhPos : POSITION, out float2 outTex : TEXCOORD0 ) { outhPos = float4( Pos.xy * 0.5f, 0.0f, 1.0f ); outTex.x = Pos.x * 0.5f + 0.5f; outTex.y = -Pos.y * 0.5f + 0.5f; } // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - float4 RenderMapScreen2PS( float2 Tex : TEXCOORD0 ) : COLOR { //return 1; half4 retColor = half4(g_fIntensity,0,0,1); return retColor; } //********************************************************************************************************* //********************************************************************************************************* // LIGHT SOURCE RENDERING //********************************************************************************************************* //********************************************************************************************************* //----------------------------------------------------------------------------- // Vertex Shader: RenderLightVS // Desc: Process vertex for the light object //----------------------------------------------------------------------------- VS_OUTPUT RenderLightVS( VS_INPUT IN ) { VS_OUTPUT OUT = (VS_OUTPUT)0; OUT.Color = IN.Color; OUT.Tex = IN.Tex; OUT.ldPosition = float4(0,0,0,0); // transform model-space vertex position to normalized screen space: OUT.hPosition = mul(IN.Position, WorldViewProj); return OUT; } //----------------------------------------------------------------------------- // Pixel Shader: RenderLightPS // Desc: Process pixel for the light object //----------------------------------------------------------------------------- float4 RenderLightPS( VS_OUTPUT IN ) : COLOR { return tex2D( g_samScene, IN.Tex ); } //----------------------------------------------------------------------------- // Technique: RenderLight // Desc: Renders the light object //----------------------------------------------------------------------------- technique RenderLight { pass p0 { VertexShader = compile vs_2_0 RenderLightVS(); PixelShader = compile ps_2_0 RenderLightPS(); } } //----------------------------------------------------------------------------- // Technique: RenderMapScreen // Desc: Renders the map //----------------------------------------------------------------------------- technique RenderMapScreen { pass p0 { VertexShader = compile vs_2_0 RenderMapScreenVS(); PixelShader = compile ps_2_0 RenderMapScreenPS(); } } technique RenderMapScreen2 { pass p0 { VertexShader = compile vs_2_0 RenderMapScreen2VS(); PixelShader = compile ps_2_0 RenderMapScreen2PS(); } }