
float4x4 gWorldViewProj: WORLDVIEWPROJECTION;
float4x4 gWorld: WORLD;

float3 gLightPosObj;
float3 gCameraPosObj;

float gTime: TIME;
float gWaveFactor;
float gYFactor;


struct VsInput
{
	float4 pos    	: POSITION;
	float3 normal	: NORMAL;
};
 
struct VsOutput
{
	float4 pos		: POSITION;
	float3 normal	: TEXCOORD0;
	float3 lightDir	: TEXCOORD1;
	float3 viewDir 	: TEXCOORD2;
};
 

VsOutput waveVS( VsInput input)
{
	VsOutput output= (VsOutput)0;
 	
	input.pos.x += sin(input.pos.y * gYFactor + gTime) * gWaveFactor;
	output.pos = mul(gWorldViewProj, input.pos);
	output.normal 	= input.normal;
	
	output.lightDir	= gLightPosObj - input.pos;
	output.viewDir	= gCameraPosObj - input.pos;
 
	return output;
}

