#include "..\..\VertexShader.h" ;------------------------------------------------------------------------------ ; Defines ;------------------------------------------------------------------------------ #define C_EYE_POSITION c10 ;------------------------------------------------------------------------------ ; Diffuse color ;------------------------------------------------------------------------------ ; Compute the normalized vertex to eye vector add rVertexToEye, C_EYE_POSITION, -pPos NormalizeVector(rVertexToEye) ; Dot with vertex normal and take absolute value dp3 rLightCoeff.x, pNormal, rVertexToEye max rLightCoeff.x, rLightCoeff.x, -rLightCoeff.x max rLightCoeff.x, rLightCoeff.x, C_ZERO.x ; Modulate with constant diffuse alpha mov oD0.rgb, C_MATERIAL_COLOR mul oD0.a, rLightCoeff.x, C_MATERIAL_COLOR