//compositor DOF // based on Blur but final pass does depth of field
//{
//    technique
//    {
//        // Temporary textures
//        texture rt0 target_width target_height PF_A8R8G8B8
//        texture rt1 target_width target_height PF_A8R8G8B8
//
//        target rt1
//        {
//            // Render output from previous compositor (or original scene)
//            input previous
//        }
//
//        target rt0
//        {
//            // Start with clear texture
//            input none
//            // Vertical blur pass
//            pass render_quad
//            {
//                // Renders a fullscreen quad with a material
//                material Ogre/Compositor/DOF_Blur0
//                input 0 rt1
//            }
//        }
//
//        target rt1
//        {
//            // Start with clear texture
//            input none
//            // Horizontal blur pass
//            pass render_quad
//            {
//                // Renders a fullscreen quad with a material
//                material Ogre/Compositor/DOF_Blur1
//                input 0 rt0
//            }
//        }
//
//        target_output
//        {
//            // Start with clear output
//            input none
//            // Draw a fullscreen quad
//            pass render_quad
//            {
//                // Renders a fullscreen quad with a material
//                material Ogre/Compositor/DOF_Blend
//                input 0 rt0
//                input 1 rt1
//            }
//        }
//    }
//}

// HDR
compositor HDR
{
	// floating point only for now
	technique
	{
        // Temporary textures
		// Fullsize HDR render target, used as tone mapping source
		texture rt_full target_width target_height PF_FLOAT16_RGB
		// Targets used for luminance evaluation (3x3 downsample, point filtering)
		texture rt_lum0 1 1 PF_FLOAT16_RGB
		texture rt_lum1 4 4 PF_FLOAT16_RGB
		texture rt_lum2 16 16 PF_FLOAT16_RGB
		texture rt_lum3 64 64 PF_FLOAT16_RGB
		texture rt_lum4 128 128 PF_FLOAT16_RGB
		// Bright-pass filtered target (tone mapped)
		texture rt_brightpass 128 128 PF_R8G8B8
		// Bloom filter targets
		texture rt_bloom0 128 128 PF_R8G8B8
		texture rt_bloom1 128 128 PF_R8G8B8


		target rt_full
		{
			// No input, render differently
			input none

			// Use float target HDR material scheme (unclamped shaders)
			material_scheme HDR

			pass clear
			{
			}

			pass render_scene
			{
			}

		}

		// Downsample the original HDR scene to extract luminence value
		target rt_lum4
		{
            input none
            pass render_quad
            {
                // Downsample using a 2x2 filter and convert to greyscale
                material Ogre/Compositor/HDR/Downsample2x2Luminence
                input 0 rt_full
                identifier 994
            }
		}
		target rt_lum3
		{
            input none
            pass render_quad
            {
                // Downsample using a 3x3 filter
                material Ogre/Compositor/HDR/Downsample3x3
                input 0 rt_lum4
                identifier 993
            }
		}
		target rt_lum2
		{
            input none
            pass render_quad
            {
                // Downsample using a 3x3 filter
                material Ogre/Compositor/HDR/Downsample3x3
                input 0 rt_lum3
                identifier 992
            }
		}
		target rt_lum1
		{
            input none
            pass render_quad
            {
                // Downsample using a 3x3 filter
                material Ogre/Compositor/HDR/Downsample3x3
                input 0 rt_lum2
                identifier 991
            }
		}
		target rt_lum0
		{
            input none
            pass render_quad
            {
                // Downsample using a 3x3 filter
                material Ogre/Compositor/HDR/Downsample3x3
                input 0 rt_lum1
                identifier 990
            }
		}


		target rt_brightpass
		{
			input none
			pass render_quad
			{
				// Downsample using a 3x3 filter, hi-pass and tone map
				material Ogre/Compositor/HDR/Downsample3x3Brightpass
				input 0 rt_full
				input 1 rt_lum0
				identifier 800
			}
		}

		target rt_bloom1
		{
			input none
			pass render_quad
			{
				// Blur horizontally
				material Ogre/Compositor/HDR/GaussianBloom
				input 0 rt_brightpass
				identifier 701
			}
		}
		target rt_bloom0
		{
			input none
			pass render_quad
			{
				// Blur horizontally
				material Ogre/Compositor/HDR/GaussianBloom
				input 0 rt_bloom1
				identifier 700
			}
		}


		// Final output combines tone mapping of the original scene, with an
		// exposure setting passed in as a GPU parameter, and an additive bloom
		// effect
		target_output
		{
			input none
			pass render_quad
			{
				material Ogre/Compositor/HDR/ToneMapping
				input 0 rt_full
				input 1 rt_bloom0
				input 2 rt_lum0
			}
		}
	}
}
