/*
deal with  mesh like axes in 3d editor
this shader assume camera always look at center of world
so camera distance = abs(translate.z)

*/

float4x4 gView;
float4x4 gProj;
float gCameraDist;
float4 gDiffuse;

struct VsInput
{
	float4 pos    	: POSITION;
};
 
struct VsOutput
{
	float4 pos    	: POSITION;
};
 


VsOutput mainVS(VsInput input) //global definition is always constant, so i need to use uniform gView
{
	
	VsOutput output = (VsOutput)0;
	float4x4 view = gView;
	view[2][3] = -gCameraDist; //fx use right hand 
	
	output.pos = mul( view, input.pos);
	output.pos = mul( gProj, output.pos);
	
	return output;
}
 
float4 mainPS() : COLOR0 //simplelly return gDiffuse
{
	return gDiffuse;
}
