
vertex_program Water/GlassVP cg
{
	source GlassVP.cg
	entry_point glass_vp
	profiles vs_1_1 arbvp1

	default_params 
	{
		param_named_auto worldViewProj worldviewproj_matrix
	}
}


fragment_program Water/GlassFP cg
{
	source GlassFP.cg
	entry_point main_ps
	profiles ps_2_0 arbfp1
}

material Water/Compositor
{
	technique
	{
		pass
		{
			depth_check off
			vertex_program_ref Water/GlassVP
			{
				param_named_auto timeVal time 0.25
				param_named scale float 0.1
			}

			fragment_program_ref Water/GlassFP
			{
				param_named tintColour float4 0 0.35 0.35 1
			}

			texture_unit RT
			{
			        tex_coord_set 0
				tex_address_mode clamp
				filtering linear linear linear
			}

			texture_unit
			{
				texture WaterNormal1.tga 2d
                		tex_coord_set 1
				//tex_address_mode clamp
				filtering linear linear linear
			}
			texture_unit
			{
				texture caustic_0.png 2d
                		tex_coord_set 2
				//tex_address_mode clamp
				filtering linear linear linear
			}
		}
	}
}
vertex_program Water/RefractReflectVP cg
{
	source Example_Fresnel.cg
	entry_point main_vp
	profiles vs_1_1 arbvp1
}
vertex_program Water/RefractReflectVPold cg
{
	source Example_Fresnel.cg
	entry_point main_vp_old
	profiles vs_1_1 arbvp1
}

fragment_program Water/RefractReflectFP cg
{
	source Example_Fresnel.cg
	entry_point main_fp
	// sorry, ps_1_1 and fp20 can't do this
	profiles ps_2_0 arbfp1
}

fragment_program Water/RefractReflectPS asm
{
	source Example_FresnelPS.asm
	// sorry, only for ps_1_4 :)
	syntax ps_1_4

}
material Examples/Water0
{

	technique
	{
		pass 
		{
			//
       			
			depth_write off
			vertex_program_ref Water/RefractReflectVP
			{
				param_named_auto worldViewProjMatrix worldviewproj_matrix
				param_named_auto eyePosition camera_position_object_space
				param_named_auto timeVal time 0.15
				param_named scroll float 1  
				param_named scale float 1 
				param_named noise float 1 
				// scroll and noisePos will need updating per frame
			}
			fragment_program_ref Water/RefractReflectFP
			{
				param_named fresnelBias float -0.1 
				param_named fresnelScale float 0.8 
				param_named fresnelPower float 20  
				param_named tintColour float4 1 1 1 1
				param_named noiseScale float 0.05 
			}
			// Water
			scene_blend alpha_blend
			texture_unit
			{
				
				// Water texture
				texture Water02.jpg
				// min / mag filtering, no mip
				filtering linear linear none
				alpha_op_ex source1 src_manual src_current 0.9
				
			}
			// Noise
			texture_unit
			{
				alpha_op_ex source1 src_manual src_current 0.9
				// Perlin noise volume
				texture waves2.dds
				// min / mag filtering, no mip
				filtering linear linear none
			}
			
		
		}
		
			
	}
	
}

