// Downsample a 2x2 area & turn into luminence (unclamped) fragment_program Ogre/Compositor/HDR/downscale2x2Luminence_fp/HLSL hlsl { source hdr_downscale2x2luminence.glsl target ps_2_a } fragment_program Ogre/Compositor/HDR/downscale2x2Luminence_fp/GL glsl glsles glslang { source hdr_downscale2x2luminence.glsl } fragment_program Ogre/Compositor/HDR/downscale2x2Luminence_fp unified { delegate Ogre/Compositor/HDR/downscale2x2Luminence_fp/HLSL delegate Ogre/Compositor/HDR/downscale2x2Luminence_fp/GL default_params { param_named_auto texelSize inverse_texture_size 0 } } material Ogre/Compositor/HDR/Downsample2x2Luminence { technique { pass { cull_hardware none depth_check off polygon_mode_overrideable false vertex_program_ref Ogre/Compositor/StdQuad_vp { } fragment_program_ref Ogre/Compositor/HDR/downscale2x2Luminence_fp { } texture_unit { tex_coord_set 0 tex_address_mode clamp filtering none } } } } // Downsample a 3x3 area fragment_program Ogre/Compositor/HDR/downscale3x3_fp/HLSL hlsl { source hdr_downscale3x3.glsl target ps_2_a } fragment_program Ogre/Compositor/HDR/downscale3x3_fp/GL glsl glsles glslang { source hdr_downscale3x3.glsl } fragment_program Ogre/Compositor/HDR/downscale3x3_fp unified { delegate Ogre/Compositor/HDR/downscale3x3_fp/HLSL delegate Ogre/Compositor/HDR/downscale3x3_fp/GL default_params { param_named_auto texelSize inverse_texture_size 0 } } material Ogre/Compositor/HDR/Downsample3x3 { technique { pass { cull_hardware none depth_check off polygon_mode_overrideable false vertex_program_ref Ogre/Compositor/StdQuad_vp { } fragment_program_ref Ogre/Compositor/HDR/downscale3x3_fp { } texture_unit { tex_coord_set 0 tex_address_mode clamp filtering none } } } } // Adapt luminance fragment_program Ogre/Compositor/HDR/AdaptLuminance_fp/HLSL hlsl { source hdr/hdr_adaptLuminanceFP.glsl target ps_2_a } fragment_program Ogre/Compositor/HDR/AdaptLuminance_fp/GL glsl glsles { source hdr/hdr_adaptLuminanceFP.glsl default_params { param_named inRTT int 0 param_named inLum int 1 } } fragment_program Ogre/Compositor/HDR/AdaptLuminance_fp/GLSLang glslang { source hdr/hdr_adaptLuminanceFP.glsl } fragment_program Ogre/Compositor/HDR/AdaptLuminance_fp unified { delegate Ogre/Compositor/HDR/AdaptLuminance_fp/HLSL delegate Ogre/Compositor/HDR/AdaptLuminance_fp/GLSLang delegate Ogre/Compositor/HDR/AdaptLuminance_fp/GL default_params { param_named_auto dTime frame_time param_named AdaptationScale float 10.0 } } material Ogre/Compositor/HDR/AdaptLuminance { technique { pass { vertex_program_ref Ogre/Compositor/StdQuad_vp { } fragment_program_ref Ogre/Compositor/HDR/AdaptLuminance_fp { } texture_unit //InRTT { tex_address_mode clamp filtering none } texture_unit //lum { tex_coord_set 1 tex_address_mode clamp filtering none } } } } // Adapt luminance fragment_program Ogre/Compositor/HDR/AutoKey_fp/HLSL hlsl { source hdr/hdr_autokeyFP.glsl target ps_2_a } fragment_program Ogre/Compositor/HDR/AutoKey_fp/GL glsl glsles glslang { source hdr/hdr_autokeyFP.glsl } fragment_program Ogre/Compositor/HDR/AutoKey_fp unified { delegate Ogre/Compositor/HDR/AutoKey_fp/HLSL delegate Ogre/Compositor/HDR/AutoKey_fp/GL } material Ogre/Compositor/HDR/AutoKey { technique { pass { vertex_program_ref Ogre/Compositor/StdQuad_vp { } fragment_program_ref Ogre/Compositor/HDR/AutoKey_fp { } texture_unit //inRTT { tex_address_mode clamp filtering none } } } } // Downsample a 2x2 area & turn into luminence (unclamped) fragment_program Ogre/Compositor/HDR/finalLuminence_fp/HLSL hlsl { source hdr/hdr_finalLuminanceFP.glsl target ps_2_a } fragment_program Ogre/Compositor/HDR/finalLuminence_fp/GL glsl glsles glslang { source hdr/hdr_finalLuminanceFP.glsl } fragment_program Ogre/Compositor/HDR/finalLuminence_fp unified { delegate Ogre/Compositor/HDR/finalLuminence_fp/HLSL delegate Ogre/Compositor/HDR/finalLuminence_fp/GL default_params { param_named_auto texelSize inverse_texture_size 0 } } material Ogre/Compositor/HDR/FinalLuminance { technique { pass { lighting off vertex_program_ref Ogre/Compositor/StdQuad_vp { } fragment_program_ref Ogre/Compositor/HDR/finalLuminence_fp { } texture_unit { filtering linear linear linear } } } } // Downsample a 3x3 area and perform a brightness filter pass fragment_program Ogre/Compositor/HDR/brightpass_fp/HLSL hlsl { source hdr/hdr_brightpassFP.glsl target ps_2_a } fragment_program Ogre/Compositor/HDR/brightpass_fp/GL glsl glsles { source hdr/hdr_brightpassFP.glsl default_params { param_named inRTT int 0 param_named inLum int 1 param_named inKey int 2 } } fragment_program Ogre/Compositor/HDR/brightpass_fp/GLSLang glslang { source hdr/hdr_brightpassFP.glsl } fragment_program Ogre/Compositor/HDR/brightpass_fp unified { delegate Ogre/Compositor/HDR/brightpass_fp/HLSL delegate Ogre/Compositor/HDR/brightpass_fp/GLSLang delegate Ogre/Compositor/HDR/brightpass_fp/GL default_params { param_named_auto texelSize inverse_texture_size 0 } } material Ogre/Compositor/HDR/Brightpass { technique { pass { lighting off vertex_program_ref Ogre/Compositor/StdQuad_vp { } fragment_program_ref Ogre/Compositor/HDR/brightpass_fp { } // Scene texture_unit { tex_address_mode clamp filtering none tex_coord_set 0 } // Luminence texture_unit { tex_address_mode clamp filtering none tex_coord_set 0 } // key texture_unit { tex_address_mode clamp filtering none tex_coord_set 0 } } } } // Bloom an area using gaussian distribution fragment_program Ogre/Compositor/HDR/bloom_fp/HLSL hlsl { source hdr_bloom.glsl target ps_2_a } fragment_program Ogre/Compositor/HDR/bloom_fp/GL glsl glsles glslang { source hdr_bloom.glsl } fragment_program Ogre/Compositor/HDR/bloom_fp unified { delegate Ogre/Compositor/HDR/bloom_fp/HLSL delegate Ogre/Compositor/HDR/bloom_fp/GL } material Ogre/Compositor/HDR/GaussianBloom { technique { pass { cull_hardware none depth_check off polygon_mode_overrideable false vertex_program_ref Ogre/Compositor/StdQuad_vp { } fragment_program_ref Ogre/Compositor/HDR/bloom_fp { } // Input texture_unit { tex_coord_set 0 tex_address_mode clamp filtering none } } } } // Perform final tone mapping fragment_program Ogre/Compositor/HDR/finaltonemapping_fp/HLSL hlsl { source hdr/hdr_toneMappingFP.glsl target ps_3_0 } fragment_program Ogre/Compositor/HDR/finaltonemapping_fp/GL glsl glsles { source hdr/hdr_toneMappingFP.glsl default_params { param_named inRTT int 0 param_named inBloom int 1 param_named inLum int 2 param_named inKey int 3 } } fragment_program Ogre/Compositor/HDR/finaltonemapping_fp/GLSLang glslang { source hdr/hdr_toneMappingFP.glsl } fragment_program Ogre/Compositor/HDR/finaltonemapping_fp unified { delegate Ogre/Compositor/HDR/finaltonemapping_fp/HLSL delegate Ogre/Compositor/HDR/finaltonemapping_fp/GLSLang delegate Ogre/Compositor/HDR/finaltonemapping_fp/GL default_params { param_named effectAmount float 0.4 param_named blurAmount float 0.3 param_named gamma float 1.0 } } material Ogre/Compositor/HDR/ToneMapping { technique { pass { lighting off vertex_program_ref Ogre/Compositor/StdQuad_vp { } fragment_program_ref Ogre/Compositor/HDR/finaltonemapping_fp { } // Scene texture_unit { tex_address_mode clamp tex_coord_set 0 } // Bloom texture_unit { tex_address_mode clamp tex_coord_set 0 } // Luminence texture_unit { tex_address_mode clamp tex_coord_set 0 } // Key texture_unit { tex_address_mode clamp tex_coord_set 0 } } } } //debug fragment_program Ogre/Compositor/HDR/copy_fp/HLSL hlsl { source hdr_copy.glsl target ps_2_a } fragment_program Ogre/Compositor/HDR/copy_fp/GL glsl glsles glslang { source hdr_copy.glsl } fragment_program Ogre/Compositor/HDR/copy_fp unified { delegate Ogre/Compositor/HDR/copy_fp/HLSL delegate Ogre/Compositor/HDR/copy_fp/GL } material Ogre/Compositor/HDR/Copy { technique { pass { cull_hardware none depth_check off polygon_mode_overrideable false vertex_program_ref Ogre/Compositor/StdQuad_vp { } fragment_program_ref Ogre/Compositor/HDR/copy_fp { } // Scene texture_unit { tex_coord_set 0 tex_address_mode clamp } } } }