//
// Project:
//
//   D3D RightMark
//
// Description:
//   Effect file for "Geometry Processing Speed" test.
//
// Effect Version: 
//
//   DirectX 9.0 (Summer 2003 SDK Update)
//
// Shader Profile:
//
//   Fixed-Function Pixel Shader
//
//   Fixed-Function Vertex Shader
//

//
// Global Variables
//

float4 vLight0Diffuse = { 1.0f, 0.0f, 0.0f, 1.0f };
float4 vLight1Diffuse = { 0.0f, 1.0f, 0.0f, 1.0f };
float4 vLight2Diffuse = { 0.0f, 0.0f, 1.0f, 1.0f };

float4 vLight0Ambient = { 0.0f, 0.0f, 0.0f, 0.0f };
float4 vLight1Ambient = { 0.0f, 0.0f, 0.0f, 0.0f };
float4 vLight2Ambient = { 0.0f, 0.0f, 0.0f, 0.0f };

float4 vLight0Specular = { 1.0f, 1.0f, 1.0f, 1.0f };
float4 vLight1Specular = { 1.0f, 1.0f, 1.0f, 1.0f };
float4 vLight2Specular = { 1.0f, 1.0f, 1.0f, 1.0f };

float  fLight0Attenuation0 = 0.0f;
float  fLight1Attenuation0 = 0.0f;
float  fLight2Attenuation0 = 0.0f;

float  fLight0Attenuation1 = 0.1f;
float  fLight1Attenuation1 = 0.1f;
float  fLight2Attenuation1 = 0.1f;

float  fLight0Attenuation2 = 0.0f;
float  fLight1Attenuation2 = 0.0f;
float  fLight2Attenuation2 = 0.0f;

float  fLight0Range = 500.0f;
float  fLight1Range = 500.0f;
float  fLight2Range = 500.0f;

float3 vLight0Pos;
float3 vLight1Pos;
float3 vLight2Pos;

float4 vMaterialDiffuse  = { 40.0f, 40.0f, 40.0f, 255.0f };
float4 vMaterialSpecular = { 40.0f, 40.0f, 40.0f, 255.0f };
float4 vMaterialAmbient  = {  0.0f,  0.0f,  0.0f, 255.0f };
float4 vMaterialEmissive = {  0.0f,  0.0f,  0.0f, 255.0f };

float  fMaterialPower = 16;

vector vCameraPos;	// Camera Position

matrix mW;		// World Matrix
matrix mV;		// View  Matrix
matrix mP;		// Projection Matrix

matrix mWVP;		// World * View * Projection Matrix

//
// Technique 1: Ambient Lighting
//

technique TAmbient
{   
	pass p0
	{
		//
		// Common States
		//

		CullMode		 = CCW;
		AlphaBlendEnable	 = false;
		ZEnable 		 = true;
		ZWriteEnable		 = true;
		
		ColorOp[ 0 ]             = SelectArg1;
		ColorArg1[ 0 ]           = Diffuse;

		AlphaOp[ 0 ]             = SelectArg1;
	        AlphaArg1[ 0 ] 		 = Diffuse;
        
	        ColorOp[ 1 ]   		 = Disable;
        	AlphaOp[ 1 ]   		 = Disable;

		Lighting		 = false;
		Ambient			 = 0xffffffff;		

		WorldTransform[0]	 = <mW>;
		ViewTransform	 	 = <mV>;
		ProjectionTransform	 = <mP>;
	}
}

//
// Technique 2:  1 Diffuse Per-Vertex Point Light 
//

technique T1Diffuse
{   
	pass p0
	{
		//
		// Common States
		//

		CullMode		 = CCW;
		AlphaBlendEnable	 = false;
		ZEnable 		 = true;
		ZWriteEnable		 = true;

		ColorOp[ 0 ]             = SelectArg1;
		ColorArg1[ 0 ]           = Diffuse;

		AlphaOp[ 0 ]             = SelectArg1;
	        AlphaArg1[ 0 ] 		 = Diffuse;
        
	        ColorOp[ 1 ]   		 = Disable;
        	AlphaOp[ 1 ]   		 = Disable;

		//
 		// Material 
		//

		MaterialDiffuse  = <vMaterialDiffuse>;
	        MaterialSpecular = <vMaterialSpecular>;
        	MaterialAmbient  = <vMaterialAmbient>;
        	MaterialEmissive = <vMaterialEmissive>;
        	MaterialPower    = <fMaterialPower>;

	        DiffuseMaterialSource = Material;
  		SpecularMaterialSource = Material;
  		AmbientMaterialSource = Material;
  		EmissiveMaterialSource = Material;

		//
		// Light 1
		//

		LightType[0]		 = point;
		LightDiffuse[0]		 = <vLight0Diffuse>;
		LightAmbient[0]		 = <vLight0Ambient>;
		LightSpecular[0]	 = <vLight0Specular>;
		LightPosition[0]	 = <vLight0Pos>;
		LightRange[0]	 	 = <fLight0Range>;
		LightAttenuation0[0]	 = <fLight0Attenuation0>;
		LightAttenuation1[0]	 = <fLight0Attenuation1>;
		LightAttenuation2[0]	 = <fLight0Attenuation2>;
		LightEnable[0]	 	 = true;

		//
		// Common States
		//

		Lighting		 = true;
		Ambient			 = 0x00000000;
		SpecularEnable		 = false;

		//
		// Transforms
		//

		WorldTransform[0]	 = <mW>;
		ViewTransform	 	 = <mV>;
		ProjectionTransform	 = <mP>;
	}
}

//
// Technique 3:  2 Diffuse Per-Vertex Point Light 
//

technique T2Diffuse
{   
	pass p0
	{
		//
		// Common States
		//

		CullMode		 = CCW;
		AlphaBlendEnable	 = false;
		ZEnable 		 = true;
		ZWriteEnable		 = true;

		ColorOp[ 0 ]             = SelectArg1;
		ColorArg1[ 0 ]           = Diffuse;

		AlphaOp[ 0 ]             = SelectArg1;
	        AlphaArg1[ 0 ] 		 = Diffuse;
        
	        ColorOp[ 1 ]   		 = Disable;
        	AlphaOp[ 1 ]   		 = Disable;

		//
 		// Material 
		//


		MaterialDiffuse  = <vMaterialDiffuse>;
	        MaterialSpecular = <vMaterialSpecular>;
        	MaterialAmbient  = <vMaterialAmbient>;
        	MaterialEmissive = <vMaterialEmissive>;
        	MaterialPower    = <fMaterialPower>;

	        DiffuseMaterialSource = Material;
  		SpecularMaterialSource = Material;
  		AmbientMaterialSource = Material;
  		EmissiveMaterialSource = Material;

		//
		// Light 1
		//

		LightType[0]		 = point;
		LightDiffuse[0]		 = <vLight0Diffuse>;
		LightAmbient[0]		 = <vLight0Ambient>;
		LightSpecular[0]	 = <vLight0Specular>;
		LightPosition[0]	 = <vLight0Pos>;
		LightRange[0]	 	 = <fLight0Range>;
		LightAttenuation0[0]	 = <fLight0Attenuation0>;
		LightAttenuation1[0]	 = <fLight0Attenuation1>;
		LightAttenuation2[0]	 = <fLight0Attenuation2>;
		LightEnable[0]	 	 = true;

		//
		// Light 2
		//

		LightType[1]		 = point;
		LightDiffuse[1]		 = <vLight1Diffuse>;
		LightAmbient[1]		 = <vLight1Ambient>;
		LightSpecular[1]	 = <vLight1Specular>;
		LightPosition[1]	 = <vLight1Pos>;
		LightRange[1]	 	 = <fLight1Range>;
		LightAttenuation0[1]	 = <fLight1Attenuation0>;
		LightAttenuation1[1]	 = <fLight1Attenuation1>;
		LightAttenuation2[1]	 = <fLight1Attenuation2>;
		LightEnable[1]	 	 = true;

		//
		// Common States
		//

		Lighting		 = true;
		Ambient			 = 0x00000000;
		SpecularEnable		 = false;

		//
		// Transforms
		//

		WorldTransform[0]	 = <mW>;
		ViewTransform	 	 = <mV>;
		ProjectionTransform	 = <mP>;
	}
}

//
// Technique 4:  3 Diffuse Per-Vertex Point Light 
//

technique T3Diffuse
{   
	pass p0
	{
		//
		// Common States
		//

		CullMode		 = CCW;
		AlphaBlendEnable	 = false;
		ZEnable 		 = true;
		ZWriteEnable		 = true;

		ColorOp[ 0 ]             = SelectArg1;
		ColorArg1[ 0 ]           = Diffuse;

		AlphaOp[ 0 ]             = SelectArg1;
	        AlphaArg1[ 0 ] 		 = Diffuse;
        
	        ColorOp[ 1 ]   		 = Disable;
        	AlphaOp[ 1 ]   		 = Disable;

		//
 		// Material 
		//


		MaterialDiffuse  = <vMaterialDiffuse>;
	        MaterialSpecular = <vMaterialSpecular>;
        	MaterialAmbient  = <vMaterialAmbient>;
        	MaterialEmissive = <vMaterialEmissive>;
        	MaterialPower    = <fMaterialPower>;

	        DiffuseMaterialSource = Material;
  		SpecularMaterialSource = Material;
  		AmbientMaterialSource = Material;
  		EmissiveMaterialSource = Material;

		//
		// Light 1
		//

		LightType[0]		 = point;
		LightDiffuse[0]		 = <vLight0Diffuse>;
		LightAmbient[0]		 = <vLight0Ambient>;
		LightSpecular[0]	 = <vLight0Specular>;
		LightPosition[0]	 = <vLight0Pos>;
		LightRange[0]	 	 = <fLight0Range>;
		LightAttenuation0[0]	 = <fLight0Attenuation0>;
		LightAttenuation1[0]	 = <fLight0Attenuation1>;
		LightAttenuation2[0]	 = <fLight0Attenuation2>;
		LightEnable[0]	 	 = true;

		//
		// Light 2
		//

		LightType[1]		 = point;		
		LightDiffuse[1]		 = <vLight1Diffuse>;
		LightAmbient[1]		 = <vLight1Ambient>;
		LightSpecular[1]	 = <vLight1Specular>;
		LightPosition[1]	 = <vLight1Pos>;
		LightRange[1]	 	 = <fLight1Range>;
		LightAttenuation0[1]	 = <fLight1Attenuation0>;
		LightAttenuation1[1]	 = <fLight1Attenuation1>;
		LightAttenuation2[1]	 = <fLight1Attenuation2>;
		LightEnable[1]	 	 = true;

		//
		// Light 3
		//

		LightType[2]		 = point;
		LightDiffuse[2]		 = <vLight2Diffuse>;
		LightAmbient[2]		 = <vLight2Ambient>;
		LightSpecular[2]	 = <vLight2Specular>;
		LightPosition[2]	 = <vLight2Pos>;
		LightRange[2]	 	 = <fLight2Range>;
		LightAttenuation0[2]	 = <fLight2Attenuation0>;
		LightAttenuation1[2]	 = <fLight2Attenuation1>;
		LightAttenuation2[2]	 = <fLight2Attenuation2>;
		LightEnable[2]	 	 = true;

		//
		// Common States
		//

		Lighting		 = true;
		Ambient			 = 0x00000000;
		SpecularEnable		 = false;

		//
		// Transforms
		//

		WorldTransform[0]	 = <mW>;
		ViewTransform	 	 = <mV>;
		ProjectionTransform	 = <mP>;
	}
}

//
// Technique 5:  1 Diffuse + Specular Per-Vertex Point Light
//

technique T1DiffuseSpecular
{   
	pass p0
	{
		//
		// Common States
		//

		CullMode		 = CCW;
		AlphaBlendEnable	 = false;
		ZEnable 		 = true;
		ZWriteEnable		 = true;

		ColorOp[ 0 ]             = SelectArg1;
		ColorArg1[ 0 ]           = Diffuse;

		AlphaOp[ 0 ]             = SelectArg1;
	        AlphaArg1[ 0 ] 		 = Diffuse;
        
	        ColorOp[ 1 ]   		 = Disable;
        	AlphaOp[ 1 ]   		 = Disable;

		//
 		// Material 
		//

		MaterialDiffuse  = <vMaterialDiffuse>;
	        MaterialSpecular = <vMaterialSpecular>;
        	MaterialAmbient  = <vMaterialAmbient>;
        	MaterialEmissive = <vMaterialEmissive>;
        	MaterialPower    = <fMaterialPower>;

	        DiffuseMaterialSource = Material;
  		SpecularMaterialSource = Material;
  		AmbientMaterialSource = Material;
  		EmissiveMaterialSource = Material;

		//
		// Light 1
		//

		LightType[0]		 = point;		
		LightDiffuse[0]		 = <vLight0Diffuse>;
		LightAmbient[0]		 = <vLight0Ambient>;
		LightSpecular[0]	 = <vLight0Specular>;
		LightPosition[0]	 = <vLight0Pos>;
		LightRange[0]	 	 = <fLight0Range>;
		LightAttenuation0[0]	 = <fLight0Attenuation0>;
		LightAttenuation1[0]	 = <fLight0Attenuation1>;
		LightAttenuation2[0]	 = <fLight0Attenuation2>;
		LightEnable[0]	 	 = true;

		//
		// Common States
		//

		Lighting		 = true;
		Ambient			 = 0x00000000;
		SpecularEnable		 = true;

		//
		// Transforms
		//

		WorldTransform[0]	 = <mW>;
		ViewTransform	 	 = <mV>;
		ProjectionTransform	 = <mP>;
	}
}

//
// Technique 6:  2 Diffuse + Specular Per-Vertex Point Lights
//

technique T2DiffuseSpecular
{   
	pass p0
	{
		//
		// Common States
		//

		CullMode		 = CCW;
		AlphaBlendEnable	 = false;
		ZEnable 		 = true;
		ZWriteEnable		 = true;

		ColorOp[ 0 ]             = SelectArg1;
		ColorArg1[ 0 ]           = Diffuse;

		AlphaOp[ 0 ]             = SelectArg1;
	        AlphaArg1[ 0 ] 		 = Diffuse;
        
	        ColorOp[ 1 ]   		 = Disable;
        	AlphaOp[ 1 ]   		 = Disable;

		//
 		// Material 
		//

		MaterialDiffuse  = <vMaterialDiffuse>;
	        MaterialSpecular = <vMaterialSpecular>;
        	MaterialAmbient  = <vMaterialAmbient>;
        	MaterialEmissive = <vMaterialEmissive>;
        	MaterialPower    = <fMaterialPower>;

	        DiffuseMaterialSource = Material;
  		SpecularMaterialSource = Material;
  		AmbientMaterialSource = Material;
  		EmissiveMaterialSource = Material;

		//
		// Light 1
		//

		LightType[0]		 = point;
		LightDiffuse[0]		 = <vLight0Diffuse>;
		LightAmbient[0]		 = <vLight0Ambient>;
		LightSpecular[0]	 = <vLight0Specular>;
		LightPosition[0]	 = <vLight0Pos>;
		LightRange[0]	 	 = <fLight0Range>;
		LightAttenuation0[0]	 = <fLight0Attenuation0>;
		LightAttenuation1[0]	 = <fLight0Attenuation1>;
		LightAttenuation2[0]	 = <fLight0Attenuation2>;
		LightEnable[0]	 	 = true;

		//
		// Light 2
		//

		LightType[1]		 = point;
		LightDiffuse[1]		 = <vLight1Diffuse>;
		LightAmbient[1]		 = <vLight1Ambient>;
		LightSpecular[1]	 = <vLight1Specular>;
		LightPosition[1]	 = <vLight1Pos>;
		LightRange[1]	 	 = <fLight1Range>;
		LightAttenuation0[1]	 = <fLight1Attenuation0>;
		LightAttenuation1[1]	 = <fLight1Attenuation1>;
		LightAttenuation2[1]	 = <fLight1Attenuation2>;
		LightEnable[1]	 	 = true;

		//
		// Common States
		//

		Lighting		 = true;
		Ambient			 = 0x00000000;
		SpecularEnable		 = true;

		//
		// Transforms
		//

		WorldTransform[0]	 = <mW>;
		ViewTransform	 	 = <mV>;
		ProjectionTransform	 = <mP>;
	}
}

//
// Technique 7:  3 Diffuse + Specular Per-Vertex Point Lights
//

technique T3DiffuseSpecular
{   
	pass p0
	{
		//
		// Common States
		//

		CullMode		 = CCW;
		AlphaBlendEnable	 = false;
		ZEnable 		 = true;
		ZWriteEnable		 = true;

		ColorOp[ 0 ]             = SelectArg1;
		ColorArg1[ 0 ]           = Diffuse;

		AlphaOp[ 0 ]             = SelectArg1;
	        AlphaArg1[ 0 ] 		 = Diffuse;
        
	        ColorOp[ 1 ]   		 = Disable;
        	AlphaOp[ 1 ]   		 = Disable;

		//
 		// Material 
		//

		MaterialDiffuse  = <vMaterialDiffuse>;
	        MaterialSpecular = <vMaterialSpecular>;
        	MaterialAmbient  = <vMaterialAmbient>;
        	MaterialEmissive = <vMaterialEmissive>;
        	MaterialPower    = <fMaterialPower>;

	        DiffuseMaterialSource = Material;
  		SpecularMaterialSource = Material;
  		AmbientMaterialSource = Material;
  		EmissiveMaterialSource = Material;

		//
		// Light 1
		//

		LightType[0]		 = point;
		LightDiffuse[0]		 = <vLight0Diffuse>;
		LightAmbient[0]		 = <vLight0Ambient>;
		LightSpecular[0]	 = <vLight0Specular>;
		LightPosition[0]	 = <vLight0Pos>;
		LightRange[0]	 	 = <fLight0Range>;
		LightAttenuation0[0]	 = <fLight0Attenuation0>;
		LightAttenuation1[0]	 = <fLight0Attenuation1>;
		LightAttenuation2[0]	 = <fLight0Attenuation2>;
		LightEnable[0]	 	 = true;

		//
		// Light 2
		//

		LightType[1]		 = point;
		LightDiffuse[1]		 = <vLight1Diffuse>;
		LightAmbient[1]		 = <vLight1Ambient>;
		LightSpecular[1]	 = <vLight1Specular>;
		LightPosition[1]	 = <vLight1Pos>;
		LightRange[1]	 	 = <fLight1Range>;
		LightAttenuation0[1]	 = <fLight1Attenuation0>;
		LightAttenuation1[1]	 = <fLight1Attenuation1>;
		LightAttenuation2[1]	 = <fLight1Attenuation2>;
		LightEnable[1]	 	 = true;

		//
		// Light 3
		//

		LightType[2]		 = point;
		LightDiffuse[2]		 = <vLight2Diffuse>;
		LightAmbient[2]		 = <vLight2Ambient>;
		LightSpecular[2]	 = <vLight2Specular>;
		LightPosition[2]	 = <vLight2Pos>;
		LightRange[2]	 	 = <fLight2Range>;
		LightAttenuation0[2]	 = <fLight2Attenuation0>;
		LightAttenuation1[2]	 = <fLight2Attenuation1>;
		LightAttenuation2[2]	 = <fLight2Attenuation2>;
		LightEnable[2]	 	 = true;

		//
		// Common States
		//

		Lighting		 = true;
		Ambient			 = 0x00000000;
		SpecularEnable		 = true;

		//
		// Transforms
		//

		WorldTransform[0]	 = <mW>;
		ViewTransform	 	 = <mV>;
		ProjectionTransform	 = <mP>;
	}
}

// End of file
