///////////////////////////////////
//			 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_1_1 arbvp1
}

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

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

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

vertex_program Fury/HeatVision/HeatCaster_GLSLES_vp glsles
{
   source HeatCasterVp.glsles
}

fragment_program Fury/HeatVision/HeatCaster_GLSLES_fp glsles
{
   source HeatCasterFp.glsles
}

vertex_program Fury/HeatVision/HeatCaster_GLSL_vp glsl
{
   source HeatCasterVp.glsl
   syntax glsl150
}

fragment_program Fury/HeatVision/HeatCaster_GLSL_fp glsl
{
   source HeatCasterFp.glsl
   syntax glsl150
}

vertex_program Fury/HeatVision/HeatCaster_vp unified
{
    delegate Fury/HeatVision/HeatCaster_GLSL_vp
    delegate Fury/HeatVision/HeatCaster_GLSLES_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_GLSLES_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_1_1 arbvp1
}

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

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

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

vertex_program Fury/HeatVision/ColdCaster_GLSLES_vp glsles
{
   source ColdCasterVp.glsles
}

fragment_program Fury/HeatVision/ColdCaster_GLSLES_fp glsles
{
   source ColdCasterFp.glsles
}

vertex_program Fury/HeatVision/ColdCaster_GLSL_vp glsl
{
   source ColdCasterVp.glsl
   syntax glsl150
}

fragment_program Fury/HeatVision/ColdCaster_GLSL_fp glsl
{
   source ColdCasterFp.glsl
   syntax glsl150
}

vertex_program Fury/HeatVision/ColdCaster_vp unified
{
    delegate Fury/HeatVision/ColdCaster_GLSL_vp
    delegate Fury/HeatVision/ColdCaster_GLSLES_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_GLSLES_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
///////////////////////////////////

vertex_program Fury/HeatVision/LightToHeat_Cg_vp cg
{
   source HeatVision.cg
   entry_point LightToHeat_vp
   profiles vs_4_0 vs_1_1 arbvp1

    default_params
    {
        param_named_auto flipping render_target_flipping
    }
}

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

vertex_program Fury/HeatVision/LightToHeat_HLSL_vp hlsl
{
   source HeatVision.hlsl
   entry_point LightToHeat_vp
   target vs_4_0

    default_params
    {
        param_named_auto flipping render_target_flipping
    }
}

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

vertex_program Fury/HeatVision/LightToHeat_GLSLES_vp glsles
{
    source LightToHeatVp.glsles

    default_params
    {
        param_named_auto worldViewProj worldviewproj_matrix
    }
}

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

vertex_program Fury/HeatVision/LightToHeat_GLSL_vp glsl
{
    source LightToHeatVp.glsl
    syntax glsl150

    default_params
    {
        param_named_auto worldViewProj worldviewproj_matrix
    }
}

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

vertex_program Fury/HeatVision/LightToHeat_vp unified
{
    delegate Fury/HeatVision/LightToHeat_GLSL_vp
    delegate Fury/HeatVision/LightToHeat_GLSLES_vp
	delegate Fury/HeatVision/LightToHeat_HLSL_vp
    delegate Fury/HeatVision/LightToHeat_Cg_vp
}

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

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

            vertex_program_ref Fury/HeatVision/LightToHeat_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
///////////////////////////////////

vertex_program Fury/HeatVision/Blur_Cg_vp cg
{
   source HeatVision.cg
   entry_point Blur_vp
   profiles vs_4_0 vs_1_1 arbvp1

    default_params
    {
        param_named_auto flipping render_target_flipping
    }
}

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

vertex_program Fury/HeatVision/Blur_HLSL_vp hlsl
{
   source HeatVision.hlsl
   entry_point Blur_vp
   target vs_4_0

    default_params
    {
        param_named_auto flipping render_target_flipping
    }
}

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

vertex_program Fury/HeatVision/Blur_GLSLES_vp glsles
{
    source HeatBlurVp.glsles

    default_params
    {
        param_named_auto worldViewProj worldviewproj_matrix
    }
}

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

vertex_program Fury/HeatVision/Blur_GLSL_vp glsl
{
    source HeatBlurVp.glsl
    syntax glsl150

    default_params
    {
        param_named_auto worldViewProj worldviewproj_matrix
    }
}

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

vertex_program Fury/HeatVision/Blur_vp unified
{
    delegate Fury/HeatVision/Blur_GLSL_vp
    delegate Fury/HeatVision/Blur_GLSLES_vp
	delegate Fury/HeatVision/Blur_HLSL_vp
    delegate Fury/HeatVision/Blur_Cg_vp
}

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

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

            vertex_program_ref Fury/HeatVision/Blur_vp
            {
            }

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

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