Eye normals weren't being normalised when lighting was disabled

This commit is contained in:
rdb 2013-02-12 14:30:38 +00:00
parent de92555eee
commit f9b4dad6f9

View File

@ -1015,12 +1015,12 @@ synthesize_shader(const RenderState *rs) {
text << "\t l_eye_normal.xyz *= tsnormal.z;\n";
text << "\t l_eye_normal.xyz += l_tangent * tsnormal.x;\n";
text << "\t l_eye_normal.xyz += l_binormal * tsnormal.y;\n";
text << "\t l_eye_normal.xyz = normalize(l_eye_normal.xyz);\n";
} else {
text << "\t // Correct the surface normal for interpolation effects\n";
text << "\t l_eye_normal.xyz = normalize(l_eye_normal.xyz);\n";
}
}
if (_need_eye_normal) {
text << "\t // Correct the surface normal for interpolation effects\n";
text << "\t l_eye_normal.xyz = normalize(l_eye_normal.xyz);\n";
}
if (_out_aux_normal) {
text << "\t // Output the camera-space surface normal\n";
text << "\t o_aux.rgb = (l_eye_normal.xyz*0.5) + float3(0.5,0.5,0.5);\n";