matrix complete;
matrix world;
float amt1;
float4 target;
float4 const_mount;
float time;
float alpha;

struct vsinput
{
    float4 pos				: POSITION;
    float4 normal			: NORMAL;
    float2 tc				: TEXCOORD0;
};

struct vsoutput
{
    float4 pos				: POSITION;
    float2 tc1				: TEXCOORD0;
    float2 tc2				: TEXCOORD1;
    float4 diffuse			: COLOR0;
};


vsoutput main(vsinput v)
{
	vsoutput o;
	
	// SINUS-DEFORMERING
	float4 exp1 = v.pos * 0.05 + time * 10;
	float4 exp2 = v.pos * 0.20 + time * 6;
	float4 s = sin(exp1) * 0.1  + sin(exp2) * amt1;
	float4 c = cos(exp1) * 0.15 + cos(exp2) * 0.3;
	
	v.pos += mul(v.pos, s.x) + mul(v.pos, s.y) + mul(v.pos, s.z);
	v.normal += c;
	
		
	// MATRISE-GANGING
	v.normal = mul(normalize(v.normal), world);
	v.pos.w = 1.0;
	o.pos = mul(v.pos, complete); 
	
	// ENVMAP
	o.tc1.x = 0.5 * v.normal.x + 0.5;
	o.tc1.y = 0.5 * v.normal.y + 0.5;

	o.tc2.x = 0.5 * v.normal.z + 0.5;
	o.tc2.y = 0.5 * v.normal.x + 0.5;
	
	o.diffuse = alpha+ 0.5;
		
	return o;	
}