//predefined vs constant
void defVS(
	inout float4 pos: POSITION,
	uniform float4x4 gWorld,
	uniform float4x4 gWorldView,
	uniform float4x4 gWorldViewProj,
	uniform float4x4 gView,
	uniform float4x4 gProj,
	uniform float4x4 gViewProj,
	uniform float4 gCameraPos,  //world
	uniform float4 gCameraPosObj, //object
	uniform float4 gLightPos,
	uniform float4 gLightPosObj,
	uniform float gTime
	) 
{
	//"use" constant
	pos +=    gCameraPos; 
	pos += 	  gCameraPosObj;
	pos +=    gLightPos;
	pos +=    gLightPosObj;
	pos.x += gTime;

	pos = mul( gWorld			 , pos );
	pos = mul( gWorldView		 , pos );
	pos = mul( gWorldViewProj	 , pos );
	pos = mul( gView			 , pos );
	pos = mul( gProj			 , pos );
	pos = mul( gViewProj		 , pos );


}

void defPS(
	inout float4 colour: COLOR,
	uniform float4 gAmbient,
	uniform float4 gDiffuse,
	uniform float4 gSpecular,
	uniform float gSpecShine
	) //simplelly return gDiffuse
{
	colour += gAmbient;
	colour += gDiffuse;
	colour += gSpecular;
	colour.x += gSpecShine;
}

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

*/

void axesVS(
	inout float4 pos: POSITION,
	uniform float4x4 gView ,
	uniform float4x4 gProj ,
	uniform float gCameraDist) //global definition is always constant, so i need to use uniform gView
{
	
	float4x4 view = gView;
	view[2][3] = -gCameraDist; //fx use right hand 
	
	pos = mul( view, pos);
	pos = mul( gProj, pos);
}
 
float4 axesPS(uniform float4 gDiffuse: COLOR) : COLOR //simplelly return gDiffuse
{
	return gDiffuse;
}
