///////////////////////////////////
//			 PASS 0
//		HEAT CASTERS PASS
///////////////////////////////////

vertex_program Fury/HeatVision/HeatCaster_Cg_vp cg
{
   source HeatVision.cg
   entry_point HeatCaster_vp
   profiles vs_4_0 vs_4_0_level_9_1 vs_4_0_level_9_3 vs_1_1 arbvp1
}

fragment_program Fury/HeatVision/HeatCaster_Cg_fp cg
{
   source HeatVision.cg
   entry_point HeatCaster_fp
   profiles ps_4_0 ps_4_0_level_9_1 ps_4_0_level_9_3 ps_2_0 arbfp1
}

vertex_program Fury/HeatVision/HeatCaster_HLSL_vp hlsl
{
   source HeatVision.hlsl
   entry_point HeatCaster_vp
   target vs_4_0 vs_4_0_level_9_1 vs_4_0_level_9_3
}

fragment_program Fury/HeatVision/HeatCaster_HLSL_fp hlsl
{
   source HeatVision.hlsl
   entry_point HeatCaster_fp
   target ps_4_0 ps_4_0_level_9_1 ps_4_0_level_9_3
}

vertex_program Fury/HeatVision/HeatCaster_GLSL_vp glsl glsles
{
   source HeatCasterVp.glsl
}

fragment_program Fury/HeatVision/HeatCaster_GLSL_fp glsl glsles
{
   source HeatCasterFp.glsl
}

vertex_program Fury/HeatVision/HeatCaster_vp unified
{
    delegate Fury/HeatVision/HeatCaster_GLSL_vp
	delegate Fury/HeatVision/HeatCaster_HLSL_vp
    delegate Fury/HeatVision/HeatCaster_Cg_vp
}

fragment_program Fury/HeatVision/HeatCaster_fp unified
{
    delegate Fury/HeatVision/HeatCaster_GLSL_fp
	delegate Fury/HeatVision/HeatCaster_HLSL_fp
    delegate Fury/HeatVision/HeatCaster_Cg_fp
}

material Fury/HeatVision/HeatCaster
{
    technique
    {
        pass
        {
            polygon_mode_overrideable false
            vertex_program_ref Fury/HeatVision/HeatCaster_vp
            {
                param_named_auto eyePosition camera_position_object_space
                param_named_auto worldViewProj worldviewproj_matrix
            }

            fragment_program_ref Fury/HeatVision/HeatCaster_fp
            {
            }
        }
    }
}

///////////////////////////////////
//			 PASS 0
//		HEAT CASTERS PASS
///////////////////////////////////

vertex_program Fury/HeatVision/ColdCaster_Cg_vp cg
{
   source HeatVision.cg
   entry_point ColdCaster_vp
   profiles vs_4_0 vs_4_0_level_9_1 vs_4_0_level_9_3 vs_1_1 arbvp1
}

fragment_program Fury/HeatVision/ColdCaster_Cg_fp cg
{
   source HeatVision.cg
   entry_point ColdCaster_fp
   profiles ps_4_0 ps_4_0_level_9_1 ps_4_0_level_9_3 ps_2_0 arbfp1
}

vertex_program Fury/HeatVision/ColdCaster_HLSL_vp hlsl
{
   source HeatVision.hlsl
   entry_point ColdCaster_vp
   target vs_4_0 vs_4_0_level_9_1 vs_4_0_level_9_3
}

fragment_program Fury/HeatVision/ColdCaster_HLSL_fp hlsl
{
   source HeatVision.hlsl
   entry_point ColdCaster_fp
   target ps_4_0 ps_4_0_level_9_1 ps_4_0_level_9_3
}

vertex_program Fury/HeatVision/ColdCaster_GLSL_vp glsl glsles
{
   source ColdCasterVp.glsl
}

fragment_program Fury/HeatVision/ColdCaster_GLSL_fp glsl glsles
{
   source ColdCasterFp.glsl
}

vertex_program Fury/HeatVision/ColdCaster_vp unified
{
    delegate Fury/HeatVision/ColdCaster_GLSL_vp
	delegate Fury/HeatVision/ColdCaster_HLSL_vp
    delegate Fury/HeatVision/ColdCaster_Cg_vp
}

fragment_program Fury/HeatVision/ColdCaster_fp unified
{
    delegate Fury/HeatVision/ColdCaster_GLSL_fp
	delegate Fury/HeatVision/ColdCaster_HLSL_fp
    delegate Fury/HeatVision/ColdCaster_Cg_fp
}

material Fury/HeatVision/ColdCaster
{
    technique
    {
        pass
        {
            polygon_mode_overrideable false
            vertex_program_ref Fury/HeatVision/ColdCaster_vp
            {
                param_named_auto eyePosition camera_position_object_space
                param_named_auto worldViewProj worldviewproj_matrix
            }

            fragment_program_ref Fury/HeatVision/ColdCaster_fp
            {
            }
        }
    }
}

///////////////////////////////////
//			  PASS 1
//  LIGHT TO HEAT CONVERSION PASS
///////////////////////////////////

fragment_program Fury/HeatVision/LightToHeat_Cg_fp cg
{
   source HeatVision.cg
   entry_point LightToHeat_fp
   profiles ps_4_0 ps_4_0_level_9_1 ps_4_0_level_9_3 ps_2_0 arbfp1
}

fragment_program Fury/HeatVision/LightToHeat_HLSL_fp hlsl
{
   source HeatVision.hlsl
   entry_point LightToHeat_fp
   target ps_4_0 ps_4_0_level_9_1 ps_4_0_level_9_3
}

fragment_program Fury/HeatVision/LightToHeat_GLSL_fp glsl glsles
{
   	source LightToHeatFp.glsl
   	default_params
   	{
   		param_named Input int 0
   		param_named NoiseMap int 1
	   	param_named HeatLookup int 2
   	}
}

fragment_program Fury/HeatVision/LightToHeat_fp unified
{
    delegate Fury/HeatVision/LightToHeat_GLSL_fp
	delegate Fury/HeatVision/LightToHeat_HLSL_fp
    delegate Fury/HeatVision/LightToHeat_Cg_fp
}

material Fury/HeatVision/LightToHeat
{
    technique
    {
        pass
        {
            cull_hardware none
            depth_func always_pass
            polygon_mode_overrideable false

            vertex_program_ref Ogre/Compositor/StdQuad_vp
            {
            }

            fragment_program_ref Fury/HeatVision/LightToHeat_fp
            {
                // these should be *really* random!
                param_named random_fractions float4 0.3 0.7 0 0

                param_named depth_modulator float4 0.6 0 0 0

                // this one can be fixed
                param_named heatBiasScale float4 0.0 1.0 0 0
            }

            // INPUT (from scene, where entities has "Fury/HeatVision/Caster" material for heat emanation)
            texture_unit
            {
                tex_coord_set 0
                filtering linear linear none
                tex_address_mode clamp
            }

            // Noise map
            texture_unit
            {
                texture HeatNoise.tga
                tex_coord_set 0
            }

            // heat conversion texture
            texture_unit
            {
                texture HeatLookup.tga
                tex_coord_set 0
                filtering point point none
            }
        }
    }

}


///////////////////////////////////
//			  PASS 2
//			 BLUR PASS
///////////////////////////////////

fragment_program Fury/HeatVision/Blur_Cg_fp cg
{
   source HeatVision.cg
   entry_point Blur_fp
   profiles ps_4_0 ps_4_0_level_9_1 ps_4_0_level_9_3 ps_2_0 arbfp1
}

fragment_program Fury/HeatVision/Blur_HLSL_fp hlsl
{
   source HeatVision.hlsl
   entry_point Blur_fp
   target ps_4_0 ps_4_0_level_9_1 ps_4_0_level_9_3
}

fragment_program Fury/HeatVision/Blur_GLSL_fp glsl glsles
{
  	source HeatBlurFp.glsl
  	default_params
  	{
  		param_named Input int 0
  	}
}

fragment_program Fury/HeatVision/Blur_fp unified
{
    delegate Fury/HeatVision/Blur_GLSL_fp
	delegate Fury/HeatVision/Blur_HLSL_fp
    delegate Fury/HeatVision/Blur_Cg_fp
}

material Fury/HeatVision/Blur
{
    technique
    {
        pass
        {
            cull_hardware none
            depth_func always_pass
            polygon_mode_overrideable false

            vertex_program_ref Ogre/Compositor/StdQuad_vp
            {
            }

            fragment_program_ref Fury/HeatVision/Blur_fp
            {
                param_named blurAmount float4 0.5 0 0 0
            }

            // INPUT (from previous)
            texture_unit
            {
                tex_coord_set 0
                filtering linear linear none
                tex_address_mode clamp
            }
        }
    }
}