diff options
| author | bunnei <bunneidev@gmail.com> | 2015-11-19 19:00:42 -0500 |
|---|---|---|
| committer | bunnei <bunneidev@gmail.com> | 2016-02-05 17:18:36 -0500 |
| commit | 781b0465795fb80404e2790be2d10bfb1f7149aa (patch) | |
| tree | 33dc7c84f56ff9dc86aaf88aa4869812ee0f9643 /src/video_core/renderer_opengl | |
| parent | 3d89dacd56064c3c49cd1ae9482a0221f1912f56 (diff) | |
gl_shader_gen: Add support for D0 LUT scaling.
Diffstat (limited to 'src/video_core/renderer_opengl')
| -rw-r--r-- | src/video_core/renderer_opengl/gl_rasterizer.h | 4 | ||||
| -rw-r--r-- | src/video_core/renderer_opengl/gl_shader_gen.cpp | 2 |
2 files changed, 4 insertions, 2 deletions
diff --git a/src/video_core/renderer_opengl/gl_rasterizer.h b/src/video_core/renderer_opengl/gl_rasterizer.h index 2042be786..72ded8f22 100644 --- a/src/video_core/renderer_opengl/gl_rasterizer.h +++ b/src/video_core/renderer_opengl/gl_rasterizer.h @@ -90,6 +90,7 @@ struct PicaShaderConfig { res.lighting.lut_d0.enable = regs.lighting.lut_enable_d0 == 0; res.lighting.lut_d0.abs_input = regs.lighting.abs_lut_input.d0 == 0; res.lighting.lut_d0.type = (Pica::Regs::LightingLutInput)regs.lighting.lut_input.d0.Value(); + res.lighting.lut_d0.scale = regs.lighting.lut_scale.GetScale(regs.lighting.lut_scale.d0); res.lighting.clamp_highlights = regs.lighting.clamp_highlights != 0; return res; @@ -130,7 +131,8 @@ struct PicaShaderConfig { bool enable = false; bool abs_input = false; Pica::Regs::LightingLutInput type = Pica::Regs::LightingLutInput::NH; - } lut_d0; + float scale = 1.0f; + } lut_d0, lut_d1, lut_fr; } lighting; }; }; diff --git a/src/video_core/renderer_opengl/gl_shader_gen.cpp b/src/video_core/renderer_opengl/gl_shader_gen.cpp index a2770cc6e..9044a3813 100644 --- a/src/video_core/renderer_opengl/gl_shader_gen.cpp +++ b/src/video_core/renderer_opengl/gl_shader_gen.cpp @@ -412,7 +412,7 @@ static void WriteLighting(std::string& out, const PicaShaderConfig& config) { std::string d0_lut_value = "1.0"; if (config.lighting.lut_d0.enable) { std::string d0_lut_index = GetLutIndex(light_config.num, config.lighting.lut_d0.type, config.lighting.lut_d0.abs_input); - d0_lut_value = GetLutValue(Regs::LightingSampler::Distribution0, d0_lut_index); + d0_lut_value = "(" + std::to_string(config.lighting.lut_d0.scale) + " * " + GetLutValue(Regs::LightingSampler::Distribution0, d0_lut_index) + ")"; } // Compute secondary fragment color (specular lighting) function |
