//---------------------------------------------------------------------------
//These materials/shaders are part of the NEW InstanceManager implementation
//Written by Matias N. Goldberg ("dark_sylinc")
//---------------------------------------------------------------------------

//This shader is not instancing related, but is used in the Instancing tests for lighting
//consistency (i.e. the ground)

//--------------------------------------------------------------
// GLSL Programs
//--------------------------------------------------------------
vertex_program Ogre/Instancing/Misc_glsl_vs glsl
{
	source InstancingMisc.vert

	preprocessor_defines DEPTH_SHADOWRECEIVER=1
}

//--------------------------------------------------------------
// GLSL ES Programs
//--------------------------------------------------------------
vertex_program Ogre/Instancing/Misc_glsles_vs glsles
{
	source InstancingMisc.vert

	preprocessor_defines DEPTH_SHADOWRECEIVER=1
}

//--------------------------------------------------------------
// CG Programs
//--------------------------------------------------------------
vertex_program Ogre/Instancing/Misc_cg_vs cg
{
	source InstancingMisc.cg
	entry_point main_vs
	profiles  vs_3_0 vs_2_0 vp40

	compile_arguments -DDEPTH_SHADOWRECEIVER
}

//--------------------------------------------------------------
// Unified CG/GLSL Programs
//--------------------------------------------------------------
vertex_program Ogre/Instancing/Misc_vs unified
{
	delegate Ogre/Instancing/Misc_glsl_vs
	delegate Ogre/Instancing/Misc_glsles_vs
	delegate Ogre/Instancing/Misc_cg_vs

	default_params
	{
		param_named_auto	viewProjMatrix				viewproj_matrix
		param_named_auto	worldMatrix					world_matrix
		param_named_auto	depthRange					shadow_scene_depth_range 0
		param_named_auto	texViewProjMatrix			texture_viewproj_matrix 0
	}
}

abstract material Examples/Instancing/Misc
{
	technique
	{
		pass
		{
			specular	1 1 1 1 50
			vertex_program_ref Ogre/Instancing/Misc_vs
			{
			}

			fragment_program_ref Ogre/Instancing_ps
			{
			}

			texture_unit Diffuse
			{
				texture_alias		DiffuseMap
			}

			texture_unit shadow0
			{
				content_type shadow
				tex_address_mode border
				tex_border_colour 1 1 1 1
			}
		}
	}
}

material Examples/Instancing/Misc/Grass : Examples/Instancing/Misc
{
	set_texture_alias	DiffuseMap	grass_1024.jpg
}
