
// full screen quad with camera-to-pixel ray calculations

vertex_program ssao_vs unified
{
	delegate ssao_vs_pCg
	delegate ssao_vs_pCg_sm4
	delegate ssao_vs_pGLSL
	delegate ssao_vs_pGLSLES
}
vertex_program ssao_vs_pCg cg
{
    source ssao.cg
    profiles vs_1_1 arbvp1
    entry_point ssao_vs
    default_params
    {
        param_named_auto wvp worldviewproj_matrix
    }
}
vertex_program ssao_vs_pCg_sm4 cg
{
    source ssao_sm4.cg
    profiles vs_4_0
    entry_point ssao_vs
    default_params
    {
        param_named_auto wvp worldviewproj_matrix
    }
}
vertex_program ssao_vs_pGLSL glsl
{
    source ssao_vs.glsl
    syntax glsl150
    default_params
    {
        param_named_auto worldViewProj worldviewproj_matrix
    }
}
vertex_program ssao_vs_pGLSLES glsles
{
    source ssao_vs.glsles
    syntax glsles
    default_params
    {
        param_named_auto worldViewProj worldviewproj_matrix
    }
}
fragment_program ssao_ps unified
{
	delegate ssao_ps_pCg
	delegate ssao_ps_pCg_sm4
	delegate ssao_ps_pGLSL
	delegate ssao_ps_pGLSLES
}
fragment_program ssao_ps_pCg cg
{
    source ssao.cg
    entry_point ssao_ps
    // will run on anything with pixel shader 2.b and up
    profiles ps_2_x arbfp1
    default_params
    {
    }
}
fragment_program ssao_ps_pCg_sm4 cg
{
    source ssao_sm4.cg
    entry_point ssao_ps
    // will run on anything with pixel shader 2.b and up
    profiles ps_4_0
    default_params
    {
    }
}
fragment_program ssao_ps_pGLSL glsl
{
    source ssao_ps.glsl
    // will run on anything with GLSL 1.50 and up
    syntax glsl150
	default_params
	{
        param_named geomMap int 0
        param_named randMap int 1
    }
}
fragment_program ssao_ps_pGLSLES glsles
{
    source ssao_ps.glsles
    // will run on anything with GLSL 1.50 and up
    syntax glsles
	default_params
	{
        param_named geomMap int 0
        param_named randMap int 1
    }
}
fragment_program ssaoBlurX_ps unified
{
	delegate ssaoBlurX_ps_pCg
	delegate ssaoBlurX_ps_pCg_sm4
	delegate ssaoBlurX_ps_pGLSL
	delegate ssaoBlurX_ps_pGLSLES
}
fragment_program ssaoBlurX_ps_pCg cg
{
    source ssao.cg
    entry_point ssaoBlurX_ps
    profiles ps_2_x arbfp1
    default_params
    {
        param_named_auto invTexSize inverse_texture_size 0
    }
}
fragment_program ssaoBlurX_ps_pCg_sm4 cg
{
    source ssao_sm4.cg
    entry_point ssaoBlurX_ps
    profiles ps_4_0
    default_params
    {
        param_named_auto invTexSize inverse_texture_size 0
    }
}
fragment_program ssaoBlurX_ps_pGLSL glsl
{
    source ssao_blurx_ps.glsl
    syntax glsl150
    default_params
    {
        param_named_auto invTexSize inverse_texture_size 0
        param_named map int 0
        param_named geomMap int 1
    }
}
fragment_program ssaoBlurX_ps_pGLSLES glsles
{
    source ssao_blurx_ps.glsles
    syntax glsles
    default_params
    {
        param_named_auto invTexSize inverse_texture_size 0
        param_named map int 0
        param_named geomMap int 1
    }
}

fragment_program ssaoBlurY_ps unified
{
	delegate ssaoBlurY_ps_pCg
	delegate ssaoBlurY_ps_pCg_sm4
	delegate ssaoBlurY_ps_pGLSL
	delegate ssaoBlurY_ps_pGLSLES
}
fragment_program ssaoBlurY_ps_pCg cg
{
    source ssao.cg
    entry_point ssaoBlurY_ps
    profiles ps_2_x arbfp1
    default_params
    {
        param_named_auto invTexSize inverse_texture_size 0
    }
}
fragment_program ssaoBlurY_ps_pCg_sm4 cg
{
    source ssao_sm4.cg
    entry_point ssaoBlurY_ps
    profiles ps_4_0
    default_params
    {
        param_named_auto invTexSize inverse_texture_size 0
    }
}
fragment_program ssaoBlurY_ps_pGLSL glsl
{
    source ssao_blury_ps.glsl
    syntax glsl150
    default_params
    {
        param_named_auto invTexSize inverse_texture_size 0
        param_named map int 0
        param_named geomMap int 1
    }
}
fragment_program ssaoBlurY_ps_pGLSLES glsles
{
    source ssao_blury_ps.glsles
    syntax glsles
    default_params
    {
        param_named_auto invTexSize inverse_texture_size 0
        param_named map int 0
        param_named geomMap int 1
    }
}

material ssao
{
    technique
    {
        pass
        {
            vertex_program_ref ssao_vs
            {
            }

            fragment_program_ref ssao_ps
            {
            }

            texture_unit geomMap
            {
                tex_address_mode clamp
                filtering bilinear
            }

            texture_unit randMap
            {
                texture random.png
                filtering none
            }
        }
    }
}

material ssaoBlurX
{
    technique
    {
        pass
        {

            vertex_program_ref Ogre/BasicVertexPrograms/AmbientOneTextureWithUV
            {
            }
        
            fragment_program_ref ssaoBlurX_ps
            {
            }

            texture_unit map
            {
                tex_address_mode clamp
                filtering bilinear
            }

            texture_unit geomMap
            {
                tex_address_mode clamp
                filtering bilinear
            }
        }
    }
}

material ssaoBlurY
{
    technique
    {
        pass
        {
            vertex_program_ref Ogre/BasicVertexPrograms/AmbientOneTextureWithUV
            {
            }

            fragment_program_ref ssaoBlurY_ps
            {
            }

            texture_unit map
            {
                tex_address_mode clamp
                filtering bilinear
            }

            texture_unit geomMap
            {
                tex_address_mode clamp
                filtering bilinear
            }
        }
    }
}

material modulate
{
    technique
    {
        pass
        {
            lighting off

            texture_unit
            {
                texture white.bmp
                filtering bilinear
            }

            texture_unit
            {
                texture white.bmp
                filtering bilinear
            }
        }
    }
}
