// need heade

#include "Core/Asura.h"
#include "Rendering/Asura_Direct3D_Shaders.h"

static const char* g_szShaderCode =
{
	"ps.1.1				\n"
	"tex t0				\n"
	"tex t1				\n"

	// r0 = Saturated dot product of normal map with interpolated normal from vertex shader
	"dp3_sat r0, t0_bx2, v1_bx2		\n"
	
	// r1 = r0^16
	"mul r1, r0, r0 \n"
	"mul r1, r1, r1 \n"
	"mul r1, r1, r1 \n"
	"mul r1, r1, r1 \n"

	// r0 = r0 * diffuse texture map + r0^16 (specular component is not multiplied by diffuse map)
	"mad r0, r0, t1, r1 \n"

	//"add r0, t1, r1 \n"

	// Final colour multiplied by interpolated SH lighting colour from vertex shader 
	"mul_x2 r0, r0, v0 \n"
};


static Asura_Direct3D_PixelShader xNormalMappedSkinShader(ASURA_D3D_PS_NORMALMAPPEDSKIN, g_szShaderCode);
