/*
 
*/

#preprocessor GLSL_VS

#preprocessor GLSL_PS
		
#preprocessor HLSL_VS

//ModelView
float4x4 mv;
//ModelViewProjection	
float4x4 mvp;
//ModelViewProjectionInverseTranspose
float4x4 mvit;	

float4x4 m_object;	

float4	mat_diffuse;
float4	mat_specular;
float4	mat_ambient;

struct VS_INPUT
{
	float3 position  : POSITION;
	float3 normal    : NORMAL;
	float2 texcoord0 : TEXCOORD0;
};

struct VS_OUTPUT
{
	float4 hposition : POSITION;
	float4 color0    : COLOR0;
	float2 texcoord0 : TEXCOORD0;
};


VS_OUTPUT main( VS_INPUT IN )
{
	VS_OUTPUT OUT;
	
	OUT.color0    = 1.0;
	OUT.texcoord0 = IN.texcoord0;
	OUT.hposition = mul(float4(IN.position.xyz,1.0),mvp);
	
	return OUT;
}

#preprocessor HLSL_PS

struct VS_OUTPUT
{
	float4 hposition : POSITION;
	float4 color0    : COLOR0;
	float2 texcoord0 : TEXCOORD0;
};

struct PS_OUTPUT
{
	float4 color : COLOR;
};

float4 auxiliar;

PS_OUTPUT main( VS_OUTPUT IN )
{
	PS_OUTPUT OUT;
	
	if(auxiliar.x> IN.texcoord0.x)
		OUT.color = float4(float3(0.0,0.0,0.0),1.0);
	else
		OUT.color = float4(float3(0.0,0.0,0.0),0.0);
	
	return OUT;
}

#preprocessor commands

#define BW_VERTEX_POSITION 	1
#define BW_VERTEX_NORMAL 	2
#define BW_VERTEX_UV 		4
#define BW_VERTEX_COLOR 	8

// vertex structure
VertexProfileCreate(3);
VertexProfileSet(0,0,3,BW_VERTEX_POSITION,0);
VertexProfileSet(1,12,3,BW_VERTEX_NORMAL,0);
VertexProfileSet(2,24,3,BW_VERTEX_UV,0);

#end