diff options
author | wwylele <wwylele@gmail.com> | 2017-08-27 06:33:27 +0200 |
---|---|---|
committer | wwylele <wwylele@gmail.com> | 2017-09-03 07:22:03 +0200 |
commit | 12fbc8c8dff3265b03cffdd5bb5e6dd6537cd824 (patch) | |
tree | 522b5aee2b1f8ca487923c4a8f7d7da2d561bf2b /src/video_core/renderer_opengl/gl_shader_gen.cpp | |
parent | Merge pull request #2891 from wwylele/sw-bump (diff) | |
download | yuzu-12fbc8c8dff3265b03cffdd5bb5e6dd6537cd824.tar yuzu-12fbc8c8dff3265b03cffdd5bb5e6dd6537cd824.tar.gz yuzu-12fbc8c8dff3265b03cffdd5bb5e6dd6537cd824.tar.bz2 yuzu-12fbc8c8dff3265b03cffdd5bb5e6dd6537cd824.tar.lz yuzu-12fbc8c8dff3265b03cffdd5bb5e6dd6537cd824.tar.xz yuzu-12fbc8c8dff3265b03cffdd5bb5e6dd6537cd824.tar.zst yuzu-12fbc8c8dff3265b03cffdd5bb5e6dd6537cd824.zip |
Diffstat (limited to 'src/video_core/renderer_opengl/gl_shader_gen.cpp')
-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 3f390491a..b5f359da6 100644 --- a/src/video_core/renderer_opengl/gl_shader_gen.cpp +++ b/src/video_core/renderer_opengl/gl_shader_gen.cpp @@ -750,7 +750,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 @@ -759,17 +760,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"; } } |