glsl_shader_fs_gen: Apply shadow before ambient light (#7404)

This commit is contained in:
GPUCode
2024-01-31 23:29:39 +02:00
committed by GitHub
parent 63feac6bb3
commit 480604ec72
2 changed files with 15 additions and 14 deletions

View File

@@ -810,8 +810,8 @@ void FragmentModule::WriteLighting() {
// Compute primary fragment color (diffuse lighting) function
out += fmt::format(
"diffuse_sum.rgb += (({}.diffuse * dot_product) + {}.ambient) * {} * {}{};\n",
light_src, light_src, dist_atten, spot_atten, shadow_primary);
"diffuse_sum.rgb += (({}.diffuse * dot_product{}) + {}.ambient) * {} * {};\n",
light_src, shadow_primary, light_src, dist_atten, spot_atten);
// Compute secondary fragment color (specular lighting) function
out += fmt::format("specular_sum.rgb += ({} + {}) * clamp_highlights * {} * {}{};\n",