//
// Project:
//
//   D3D RightMark
//
// Description:
//   Effect file for "Pixel Filling" test.
//
// Effect Version: 
//
//   DirectX 9.0 (Summer 2003 SDK Update)
//
// Shader Profile:
//
//   Pixel Shaders 1.4 ( Pixel Shader Assembler )
//
//   Vertex Shaders 1.1 ( Vertex Shader Assembler )
//

float4x4 mWVP;
float4   vRot;

float    fFilter;
float    fMipFilter;

float    fAnisotropy;

float4   vOne = { 1.0f, 1.0f, 1.0f, 1.0f };
float4   vTextureFactor = { 0.5f, 0.5f, 0.5f, 0.5f };

technique TFillRate0
{   
	pass p0
	{
		//
		// Common States
		//

		CullMode		 = None;
		AlphaBlendEnable	 = False;
		ZWriteEnable		 = False;
		ZEnable			 = False;

		//
		// Shader Constants
		//

		PixelShaderConstant[ 0 ]  = <vTextureFactor>;
		PixelShaderConstant[ 1 ]  = <vOne>;

		VertexShaderConstant[ 0 ]  = <mWVP>;
		VertexShaderConstant[ 10 ] = <vRot>;

		//
		// Shaders
		//

		PixelShader = 
		
		   asm {
				ps_1_4

				mov r0 , c1
		       };

		VertexShader = 

		   asm {	
				vs_1_1

				dcl_position    v0
				dcl_normal      v3
				dcl_texcoord    v7

				//
				// Position Setup
				//

				mul  r0, v3, c10
				add  r1, v0, r0
				m4x4 oPos, r1, c0
			};
	}
}

technique TFillRate1
{   
	pass p0
	{
		//
		// Common States
		//

		CullMode		 = None;
		AlphaBlendEnable	 = False;
		ZWriteEnable		 = False;
		ZEnable			 = False;

		MinFilter[ 0 ]           = <fFilter>;
		MagFilter[ 0 ]           = <fFilter>;
		MipFilter[ 0 ]           = <fMipFilter>;

		MaxAnisotropy[ 0 ]	 = <fAnisotropy>;

		//
		// Shader Constants
		//

		PixelShaderConstant[ 0 ]  = <vTextureFactor>;
		PixelShaderConstant[ 1 ]  = <vOne>;

		VertexShaderConstant[ 0 ]  = <mWVP>;
		VertexShaderConstant[ 10 ] = <vRot>;

		//
		// Shaders
		//

		PixelShader = 
		
		   asm {
				ps_1_4

				texld r0, t0
		       };

		VertexShader = 

		   asm {	
				vs_1_1

				dcl_position    v0
				dcl_normal      v3
				dcl_texcoord    v7

				//
				// Position Setup
				//

				mul  r0, v3, c10
				add  r1, v0, r0
				m4x4 oPos, r1, c0

				//
				// Texture Coords Setup
				//

				mov oT0.xy, v7.xy
			};
	}
}

technique TFillRate2
{   
	pass p0
	{
		//
		// Common States
		//

		CullMode		 = None;
		AlphaBlendEnable	 = False;
		ZWriteEnable		 = False;
		ZEnable			 = False;

		MinFilter[ 0 ]           = <fFilter>;
		MagFilter[ 0 ]           = <fFilter>;
		MipFilter[ 0 ]           = <fMipFilter>;

		MaxAnisotropy[ 0 ]	 = <fAnisotropy>;

		MinFilter[ 1 ]           = <fFilter>;
		MagFilter[ 1 ]           = <fFilter>;
		MipFilter[ 1 ]           = <fMipFilter>;

		MaxAnisotropy[ 1 ]	 = <fAnisotropy>;

		//
		// Shader Constants
		//

		PixelShaderConstant[ 0 ]  = <vTextureFactor>;
		PixelShaderConstant[ 1 ]  = <vOne>;

		VertexShaderConstant[ 0 ]  = <mWVP>;
		VertexShaderConstant[ 10 ] = <vRot>;

		//
		// Shaders
		//

		PixelShader = 
		
		   asm {
				ps_1_4

				texld r0, t0
				texld r1, t1

				lrp   r0, c0, r0, r1
		       };

		VertexShader = 

		   asm {	
				vs_1_1

				dcl_position    v0
				dcl_normal      v3
				dcl_texcoord    v7

				//
				// Position Setup
				//

				mul  r0, v3, c10
				add  r1, v0, r0
				m4x4 oPos, r1, c0

				//
				// Texture Coords Setup
				//

				mov oT0.xy, v7.xy
				mov oT1.xy, v7.xy
			};
	}
}

technique TFillRate3
{   
	pass p0
	{
		//
		// Common States
		//

		CullMode		 = None;
		AlphaBlendEnable	 = False;
		ZWriteEnable		 = False;
		ZEnable			 = False;

		MinFilter[ 0 ]           = <fFilter>;
		MagFilter[ 0 ]           = <fFilter>;
		MipFilter[ 0 ]           = <fMipFilter>;

		MaxAnisotropy[ 0 ]	 = <fAnisotropy>;

		MinFilter[ 1 ]           = <fFilter>;
		MagFilter[ 1 ]           = <fFilter>;
		MipFilter[ 1 ]           = <fMipFilter>;

		MaxAnisotropy[ 1 ]	 = <fAnisotropy>;

		MinFilter[ 2 ]           = <fFilter>;
		MagFilter[ 2 ]           = <fFilter>;
		MipFilter[ 2 ]           = <fMipFilter>;

		MaxAnisotropy[ 2 ]	 = <fAnisotropy>;

		//
		// Shader Constants
		//

		PixelShaderConstant[ 0 ]  = <vTextureFactor>;
		PixelShaderConstant[ 1 ]  = <vOne>;

		VertexShaderConstant[ 0 ]  = <mWVP>;
		VertexShaderConstant[ 10 ] = <vRot>;

		//
		// Shaders
		//

		PixelShader = 
		
		   asm {
				ps_1_4

				texld r0, t0
				texld r1, t1
				texld r2, t2

				lrp   r0, c0, r0, r1
				lrp   r0, c0, r0, r2
		       };

		VertexShader = 

		   asm {	
				vs_1_1

				dcl_position    v0
				dcl_normal      v3
				dcl_texcoord    v7

				//
				// Position Setup
				//

				mul  r0, v3, c10
				add  r1, v0, r0
				m4x4 oPos, r1, c0

				//
				// Texture Coords Setup
				//

				mov oT0.xy, v7.xy
				mov oT1.xy, v7.xy
				mov oT2.xy, v7.xy
			};
	}
}

technique TFillRate4
{   
	pass p0
	{
		//
		// Common States
		//

		CullMode		 = None;
		AlphaBlendEnable	 = False;
		ZWriteEnable		 = False;
		ZEnable			 = False;

		MinFilter[ 0 ]           = <fFilter>;
		MagFilter[ 0 ]           = <fFilter>;
		MipFilter[ 0 ]           = <fMipFilter>;

		MaxAnisotropy[ 0 ]	 = <fAnisotropy>;

		MinFilter[ 1 ]           = <fFilter>;
		MagFilter[ 1 ]           = <fFilter>;
		MipFilter[ 1 ]           = <fMipFilter>;

		MaxAnisotropy[ 1 ]	 = <fAnisotropy>;

		MinFilter[ 2 ]           = <fFilter>;
		MagFilter[ 2 ]           = <fFilter>;
		MipFilter[ 2 ]           = <fMipFilter>;

		MaxAnisotropy[ 2 ]	 = <fAnisotropy>;

		MinFilter[ 3 ]           = <fFilter>;
		MagFilter[ 3 ]           = <fFilter>;
		MipFilter[ 3 ]           = <fMipFilter>;

		MaxAnisotropy[ 3 ]	 = <fAnisotropy>;

		//
		// Shader Constants
		//

		PixelShaderConstant[ 0 ]  = <vTextureFactor>;
		PixelShaderConstant[ 1 ]  = <vOne>;

		VertexShaderConstant[ 0 ]  = <mWVP>;
		VertexShaderConstant[ 10 ] = <vRot>;

		//
		// Shaders
		//

		PixelShader = 
		
		   asm {
				ps_1_4

				texld r0, t0
				texld r1, t1
				texld r2, t2
				texld r3, t3

				lrp   r0, c0, r0, r1
				lrp   r0, c0, r0, r2
				lrp   r0, c0, r0, r3
		       };

		VertexShader = 

		   asm {	
				vs_1_1

				dcl_position    v0
				dcl_normal      v3
				dcl_texcoord    v7

				//
				// Position Setup
				//

				mul  r0, v3, c10
				add  r1, v0, r0
				m4x4 oPos, r1, c0

				//
				// Texture Coords Setup
				//

				mov oT0.xy, v7.xy
				mov oT1.xy, v7.xy
				mov oT2.xy, v7.xy
				mov oT3.xy, v7.xy
			};
	}
}

technique TFillRate5
{   
	pass p0
	{
		//
		// Common States
		//

		CullMode		 = None;
		AlphaBlendEnable	 = False;
		ZWriteEnable		 = False;
		ZEnable			 = False;

		MinFilter[ 0 ]           = <fFilter>;
		MagFilter[ 0 ]           = <fFilter>;
		MipFilter[ 0 ]           = <fMipFilter>;

		MaxAnisotropy[ 0 ]	 = <fAnisotropy>;

		MinFilter[ 1 ]           = <fFilter>;
		MagFilter[ 1 ]           = <fFilter>;
		MipFilter[ 1 ]           = <fMipFilter>;

		MaxAnisotropy[ 1 ]	 = <fAnisotropy>;

		MinFilter[ 2 ]           = <fFilter>;
		MagFilter[ 2 ]           = <fFilter>;
		MipFilter[ 2 ]           = <fMipFilter>;

		MaxAnisotropy[ 2 ]	 = <fAnisotropy>;

		MinFilter[ 3 ]           = <fFilter>;
		MagFilter[ 3 ]           = <fFilter>;
		MipFilter[ 3 ]           = <fMipFilter>;

		MaxAnisotropy[ 3 ]	 = <fAnisotropy>;

		MinFilter[ 4 ]           = <fFilter>;
		MagFilter[ 4 ]           = <fFilter>;
		MipFilter[ 4 ]           = <fMipFilter>;

		MaxAnisotropy[ 4 ]	 = <fAnisotropy>;

		//
		// Shader Constants
		//

		PixelShaderConstant[ 0 ]  = <vTextureFactor>;
		PixelShaderConstant[ 1 ]  = <vOne>;

		VertexShaderConstant[ 0 ]  = <mWVP>;
		VertexShaderConstant[ 10 ] = <vRot>;

		//
		// Shaders
		//

		PixelShader = 
		
		   asm {
				ps_1_4

				texld r0, t0
				texld r1, t1
				texld r2, t2
				texld r3, t3
				texld r4, t3

				lrp   r0, c0, r0, r1
				lrp   r0, c0, r0, r2
				lrp   r0, c0, r0, r3
				lrp   r0, c0, r0, r4
		       };

		VertexShader = 

		   asm {	
				vs_1_1

				dcl_position    v0
				dcl_normal      v3
				dcl_texcoord    v7

				//
				// Position Setup
				//

				mul  r0, v3, c10
				add  r1, v0, r0
				m4x4 oPos, r1, c0

				//
				// Texture Coords Setup
				//

				mov oT0.xy, v7.xy
				mov oT1.xy, v7.xy
				mov oT2.xy, v7.xy
				mov oT3.xy, v7.xy
				mov oT4.xy, v7.xy
			};
	}
}

technique TFillRate6
{   
	pass p0
	{
		//
		// Common States
		//

		CullMode		 = None;
		AlphaBlendEnable	 = False;
		ZWriteEnable		 = False;
		ZEnable			 = False;

		MinFilter[ 0 ]           = <fFilter>;
		MagFilter[ 0 ]           = <fFilter>;
		MipFilter[ 0 ]           = <fMipFilter>;

		MaxAnisotropy[ 0 ]	 = <fAnisotropy>;

		MinFilter[ 1 ]           = <fFilter>;
		MagFilter[ 1 ]           = <fFilter>;
		MipFilter[ 1 ]           = <fMipFilter>;

		MaxAnisotropy[ 1 ]	 = <fAnisotropy>;

		MinFilter[ 2 ]           = <fFilter>;
		MagFilter[ 2 ]           = <fFilter>;
		MipFilter[ 2 ]           = <fMipFilter>;

		MaxAnisotropy[ 2 ]	 = <fAnisotropy>;

		MinFilter[ 3 ]           = <fFilter>;
		MagFilter[ 3 ]           = <fFilter>;
		MipFilter[ 3 ]           = <fMipFilter>;

		MaxAnisotropy[ 3 ]	 = <fAnisotropy>;

		MinFilter[ 4 ]           = <fFilter>;
		MagFilter[ 4 ]           = <fFilter>;
		MipFilter[ 4 ]           = <fMipFilter>;

		MaxAnisotropy[ 4 ]	 = <fAnisotropy>;

		MinFilter[ 5 ]           = <fFilter>;
		MagFilter[ 5 ]           = <fFilter>;
		MipFilter[ 5 ]           = <fMipFilter>;

		MaxAnisotropy[ 5 ]	 = <fAnisotropy>;

		//
		// Shader Constants
		//

		PixelShaderConstant[ 0 ]  = <vTextureFactor>;
		PixelShaderConstant[ 1 ]  = <vOne>;

		VertexShaderConstant[ 0 ]  = <mWVP>;
		VertexShaderConstant[ 10 ] = <vRot>;

		//
		// Shaders
		//

		PixelShader = 
		
		   asm {
				ps_1_4

				texld r0, t0
				texld r1, t1
				texld r2, t2
				texld r3, t3
				texld r4, t3
                                texld r5, t5

				lrp   r0, c0, r0, r1
				lrp   r0, c0, r0, r2
				lrp   r0, c0, r0, r3
				lrp   r0, c0, r0, r4
				lrp   r0, c0, r0, r5
		       };

		VertexShader = 

		   asm {	
				vs_1_1

				dcl_position    v0
				dcl_normal      v3
				dcl_texcoord    v7

				//
				// Position Setup
				//

				mul  r0, v3, c10
				add  r1, v0, r0
				m4x4 oPos, r1, c0

				//
				// Texture Coords Setup
				//

				mov oT0.xy, v7.xy
				mov oT1.xy, v7.xy
				mov oT2.xy, v7.xy
				mov oT3.xy, v7.xy
				mov oT4.xy, v7.xy
				mov oT5.xy, v7.xy
			};
	}
}
