Created
December 2, 2013 15:16
-
-
Save y-yu/7751010 to your computer and use it in GitHub Desktop.
unko
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
void CalcLambertModel(float outColor[3], const float ViewDir[3], const float Normal[3]) | |
{ | |
float cos = Vec3Dot(g_LightDir, Normal) / ( Vec3Norm(g_LightDir) * Vec3Norm(Normal) ); | |
Vec3Set(outColor, | |
g_AmbientColor[0] + g_LightColor[0] * g_DiffuseColor[0] * cos, | |
g_AmbientColor[1] + g_LightColor[1] * g_DiffuseColor[1] * cos, | |
g_AmbientColor[2] + g_LightColor[2] * g_DiffuseColor[2] * cos); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment