Fixed tangents/binormal not being normalized

Former-commit-id: 1d2d90bc76ddc590cde07607ac4cf3189d4e365e
This commit is contained in:
Lynix 2013-02-21 02:43:10 +01:00
parent 31be0bdef9
commit 2828ced694
1 changed files with 4 additions and 4 deletions

View File

@ -263,13 +263,13 @@ namespace
sourceCode += "}\n"
"\n";
sourceCode += fragmentColorKW + " = vec4(light, MaterialDiffuse.w)";
sourceCode += fragmentColorKW + " = vec4(light, MaterialDiffuse.a)";
if (flags & nzShaderBuilder_DiffuseMapping)
sourceCode += "*texture2D(MaterialDiffuseMap, vTexCoord)";
if (flags & nzShaderBuilder_SpecularMapping)
sourceCode += " + vec4(si, MaterialDiffuse.w)*texture2D(MaterialSpecularMap, vTexCoord)"; // Utiliser MaterialSpecular.w n'aurait aucun sens
sourceCode += " + vec4(si, MaterialDiffuse.a)*texture2D(MaterialSpecularMap, vTexCoord)"; // Utiliser l'alpha de MaterialSpecular n'aurait aucun sens
sourceCode += ";\n";
}
@ -354,8 +354,8 @@ namespace
{
sourceCode += "\n"
"vec3 binormal = cross(VertexNormal, VertexTangent);\n"
"vLightToWorld[0] = VertexTangent * RotationMatrix;\n"
"vLightToWorld[1] = binormal * RotationMatrix;\n"
"vLightToWorld[0] = normalize(VertexTangent * RotationMatrix);\n"
"vLightToWorld[1] = normalize(binormal * RotationMatrix);\n"
"vLightToWorld[2] = normalize(VertexNormal * RotationMatrix);\n"
"\n";
}