diff options
author | bunnei <bunneidev@gmail.com> | 2017-09-05 16:00:49 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-09-05 16:00:49 +0200 |
commit | ff4941fb3a1a839033a27d6341d6212cd83de691 (patch) | |
tree | 7987ce9807dbc35b573439407cbe4ebb8e243163 /src/video_core/renderer_opengl | |
parent | Merge pull request #2831 from Subv/uds_auth (diff) | |
parent | pica/lighting: only apply Fresnel factor for the last light (diff) | |
download | yuzu-ff4941fb3a1a839033a27d6341d6212cd83de691.tar yuzu-ff4941fb3a1a839033a27d6341d6212cd83de691.tar.gz yuzu-ff4941fb3a1a839033a27d6341d6212cd83de691.tar.bz2 yuzu-ff4941fb3a1a839033a27d6341d6212cd83de691.tar.lz yuzu-ff4941fb3a1a839033a27d6341d6212cd83de691.tar.xz yuzu-ff4941fb3a1a839033a27d6341d6212cd83de691.tar.zst yuzu-ff4941fb3a1a839033a27d6341d6212cd83de691.zip |
Diffstat (limited to 'src/video_core/renderer_opengl')
-rw-r--r-- | src/video_core/renderer_opengl/gl_shader_gen.cpp | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/src/video_core/renderer_opengl/gl_shader_gen.cpp b/src/video_core/renderer_opengl/gl_shader_gen.cpp index c8fc7a0ff..c536e61e1 100644 --- a/src/video_core/renderer_opengl/gl_shader_gen.cpp +++ b/src/video_core/renderer_opengl/gl_shader_gen.cpp @@ -751,7 +751,8 @@ static void WriteLighting(std::string& out, const PicaShaderConfig& config) { } // Fresnel - if (lighting.lut_fr.enable && + // Note: only the last entry in the light slots applies the Fresnel factor + if (light_index == lighting.src_num - 1 && lighting.lut_fr.enable && LightingRegs::IsLightingSamplerSupported(lighting.config, LightingRegs::LightingSampler::Fresnel)) { // Lookup fresnel LUT value @@ -760,17 +761,17 @@ static void WriteLighting(std::string& out, const PicaShaderConfig& config) { lighting.lut_fr.type, lighting.lut_fr.abs_input); value = "(" + std::to_string(lighting.lut_fr.scale) + " * " + value + ")"; - // Enabled for difffuse lighting alpha component + // Enabled for diffuse lighting alpha component if (lighting.fresnel_selector == LightingRegs::LightingFresnelSelector::PrimaryAlpha || lighting.fresnel_selector == LightingRegs::LightingFresnelSelector::Both) { - out += "diffuse_sum.a *= " + value + ";\n"; + out += "diffuse_sum.a = " + value + ";\n"; } // Enabled for the specular lighting alpha component if (lighting.fresnel_selector == LightingRegs::LightingFresnelSelector::SecondaryAlpha || lighting.fresnel_selector == LightingRegs::LightingFresnelSelector::Both) { - out += "specular_sum.a *= " + value + ";\n"; + out += "specular_sum.a = " + value + ";\n"; } } |