matrix complete;
matrix world;

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

struct vsoutput
{
    float4 pos				: POSITION;
    float2 bump1			: TEXCOORD0;
    float2 envtex			: TEXCOORD1;
    float3 diffuse			: COLOR0;
};


vsoutput main(vsinput v)
{
	vsoutput o;
		
	o.pos = mul(v.pos, complete); 
	o.diffuse = 1;
	
	o.bump1 = v.tc;
	
	float4 n = mul(normalize(v.pos), world);
	o.envtex.x = 0.5+n.x*0.5;
	o.envtex.y = 0.5+n.z*0.5;	
	
	return o;
}
