//
// Project:
//
//   D3D RightMark
//
// Description:
//   Effect file for "Pixel Filling" test.
//
// Effect Version: 
//
//   DirectX 9.0 (Summer 2003 SDK Update)
//
// Shader Profile:
//
//   Pixel Shaders 1.1 ( 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_1

				mov r0 , c1
		       };

		VertexShader = 

		   asm {	
				vs_1_1

				dcl_position    v0
				dcl_normal      v3
				dcl_texcoord    v7

				// position

				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>;

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

		//
		// Shaders
		//

		PixelShader = 
		
		   asm {
				ps_1_1

				tex t0

				mov r0 , t0
		       };

		VertexShader = 

		   asm {	
				vs_1_1

				dcl_position    v0
				dcl_normal      v3
				dcl_texcoord    v7

				// position

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

				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
		//

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

		//
		// Shaders
		//

		PixelShader = 
		
		   asm {
				ps_1_1

				tex t0
				tex t1

				mov r0 , t0
				lrp r0 , c0, r0, t1
		       };

		VertexShader = 

		   asm {	
				vs_1_1

				dcl_position    v0
				dcl_normal      v3
				dcl_texcoord    v7

				// position

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

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

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

		CullMode		 = None;
		AlphaBlendEnable	 = False;
		ZEnable			 = False;
		ZWriteEnable		 = 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
		//

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

		//
		// Shaders
		//

		PixelShader = 
		
		   asm {
				ps_1_1

				tex t0
				tex t1
				tex t2

				mov r0 , t0
				lrp r0 , c0, r0, t1
				lrp r0 , c0, r0, t2
		       };

		VertexShader = 

		   asm {	
				vs_1_1

				dcl_position    v0
				dcl_normal      v3
				dcl_texcoord    v7

				// position

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

				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
		//

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

		//
		// Shaders
		//

		PixelShader = 
		
		   asm {
				ps_1_1

				tex t0
				tex t1
				tex t2
				tex t3

				mov r0 , t0
				lrp r0 , c0, r0, t1
				lrp r0 , c0, r0, t2
				lrp r0 , c0, r0, t3
		       };

		VertexShader = 

		   asm {	
				vs_1_1

				dcl_position    v0
				dcl_normal      v3
				dcl_texcoord    v7

				// position

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

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