fragment_program SSAO/HemisphereMC_fp_cg hlsl cg
{
    source HemisphereMC.cg
    entry_point HemisphereMC_fp
    target ps_3_0 arbfp1
}

fragment_program SSAO/HemisphereMC_fp_glsl glsl
{
	source HemisphereMCFP.glsl
	
	default_params
	{
		param_named sMRT1 int 0
		param_named sMRT2 int 1
		param_named sRand int 2
	}
}

fragment_program SSAO/HemisphereMC_fp unified
{
	delegate SSAO/HemisphereMC_fp_glsl 
	delegate SSAO/HemisphereMC_fp_cg
}

// Monte Carlo Integration of the hemisphere definded by the fragment normal
// lossely based on Ritschel et al. SSDO.
material SSAO/HemisphereMC
{
    technique
    {
        pass
        {
            depth_check off

			vertex_program_ref Ogre/Compositor/StdQuad_vp {}
            fragment_program_ref SSAO/HemisphereMC_fp
            {
                param_named_auto cViewportSize viewport_size
                param_named_auto cFov fov
				
                param_named cSampleInScreenspace float 0
                param_named cSampleLengthScreenSpace float 0.06
                param_named cSampleLengthWorldSpace float 2
                param_named cSampleLengthExponent float 1
				
            }

            texture_unit // normals
            {
                content_type compositor SSAO/GBuffer mrt 0
                tex_address_mode clamp
                filtering none
            }

            texture_unit // view space position
            {
                content_type compositor SSAO/GBuffer mrt 1
                tex_address_mode clamp
                filtering none
            }

            texture_unit
            {
                texture importance4InterleavedSphereHemisphere8x4.png
                tex_address_mode wrap
                filtering none
            }
        }
    }
}
