wined3d: Use ffp_normalize in shader_glsl_ffp_vertex_lighting_footer.

This commit is contained in:
Petrichor Park 2023-07-20 09:48:49 -05:00 committed by Alexandre Julliard
parent 79b92a6d39
commit 17d64ac1e0

View file

@ -8854,9 +8854,9 @@ static void shader_glsl_ffp_vertex_lighting_footer(struct wined3d_string_buffer
shader_addline(buffer, "diffuse += clamp(dot(dir, normal), 0.0, 1.0)"
" * ffp_light[%u].diffuse.xyz * att;\n", idx);
if (settings->localviewer)
shader_addline(buffer, "t = dot(normal, normalize(dir - normalize(ec_pos.xyz)));\n");
shader_addline(buffer, "t = dot(normal, ffp_normalize(dir - ffp_normalize(ec_pos.xyz)));\n");
else
shader_addline(buffer, "t = dot(normal, normalize(dir + vec3(0.0, 0.0, -1.0)));\n");
shader_addline(buffer, "t = dot(normal, ffp_normalize(dir + vec3(0.0, 0.0, -1.0)));\n");
shader_addline(buffer, "if (dot(dir, normal) > 0.0 && t > 0.0%s) specular +="
" pow(t, ffp_material.shininess) * ffp_light[%u].specular * att;\n",
legacy_lighting ? " && ffp_material.shininess > 0.0" : "", idx);