vertex_program AutoTerrainTexture/VP cg
{
	source autoterraintexture.cg
	entry_point main_vp
	profiles vs_2_0 arbvp1
}

fragment_program AutoTerrainTexture/FP cg
{
	source autoterraintexture.cg
	entry_point main_fp
	profiles ps_2_0 arbfp1
}


material AutoTerrainTexture/GrassyKnoll
{
    receive_shadows on
	technique
	{
		pass
		{
			vertex_program_ref AutoTerrainTexture/VP
			{
                param_named_auto worldViewProj      worldviewproj_matrix
                param_named_auto lightDirection     light_direction_object_space 0
               	param_named_auto ambientLight       ambient_light_colour

               	// Config settings are;
               	//     world to texture scale
               	//     rock slope start
               	//     rock slope scale
               	//     ambient light scale factor
               	param_named configSettings float4 0.02 0.95 6.0 0.25

                // Fog settings are;
                //     start
                //     end
                //     scale (e.g. 0.0 to switch off)
               	param_named fogSettings float4 500.0 1000.0 1.0 0.0

                // Fog colour
               	param_named fogColour float4 0.93, 0.86, 0.76 1.0
			}

			fragment_program_ref AutoTerrainTexture/FP
			{
			}

			texture_unit
			{
				texture grass.jpg
				tex_address_mode wrap
			}

			texture_unit
			{
				texture rocks.jpg
				tex_address_mode wrap
			}
		}
	}
	technique
	{
		pass
		{
			//texture_unit
			//{
			//	texture grass.jpg
			//	tex_address_mode wrap
			//}

			texture_unit
			{
				texture rocks.jpg
				tex_address_mode wrap
			}
		}
	}
}

