diff options
| author | bunnei <bunneidev@gmail.com> | 2015-11-14 23:23:08 -0500 |
|---|---|---|
| committer | bunnei <bunneidev@gmail.com> | 2016-02-05 17:17:30 -0500 |
| commit | bf89870437ebb0d983cfc20c3ac0490169f59f44 (patch) | |
| tree | 8bf0f8121c02e66fd5aeeff8cacb7e288c84ae90 /src/video_core/renderer_opengl/gl_rasterizer.h | |
| parent | e34fa6365ff87af247b0ae8ed880c4032bcb2ed0 (diff) | |
renderer_opengl: Initial implementation of basic specular lighting.
Diffstat (limited to 'src/video_core/renderer_opengl/gl_rasterizer.h')
| -rw-r--r-- | src/video_core/renderer_opengl/gl_rasterizer.h | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/src/video_core/renderer_opengl/gl_rasterizer.h b/src/video_core/renderer_opengl/gl_rasterizer.h index ba0b05802..9e93b8b2f 100644 --- a/src/video_core/renderer_opengl/gl_rasterizer.h +++ b/src/video_core/renderer_opengl/gl_rasterizer.h @@ -87,6 +87,10 @@ struct PicaShaderConfig { res.light_src[light_index].dist_atten_scale = Pica::float20::FromRawFloat20(light.dist_atten_scale).ToFloat32(); } + res.lighting_lut.d0_abs = (regs.lighting.abs_lut_input.d0 == 0); + res.lighting_lut.d0_type = (Pica::Regs::LightingLutInput)regs.lighting.lut_input.d0.Value(); + res.clamp_highlights = regs.lighting.light_env.clamp_highlights; + return res; } @@ -118,6 +122,12 @@ struct PicaShaderConfig { bool lighting_enabled = false; unsigned num_lights = 0; + bool clamp_highlights = false; + + struct { + bool d0_abs = false; + Pica::Regs::LightingLutInput d0_type = Pica::Regs::LightingLutInput::NH; + } lighting_lut; }; }; @@ -231,6 +241,10 @@ private: }; struct LightSrc { + std::array<GLfloat, 3> specular_0; + INSERT_PADDING_WORDS(1); + std::array<GLfloat, 3> specular_1; + INSERT_PADDING_WORDS(1); std::array<GLfloat, 3> diffuse; INSERT_PADDING_WORDS(1); std::array<GLfloat, 3> ambient; @@ -316,6 +330,12 @@ private: /// Syncs the specified light's position to match the PICA register void SyncLightPosition(int light_index); + /// Syncs the specified light's specular 0 color to match the PICA register + void SyncLightSpecular0(int light_index); + + /// Syncs the specified light's specular 1 color to match the PICA register + void SyncLightSpecular1(int light_index); + /// Syncs the remaining OpenGL drawing state to match the current PICA state void SyncDrawState(); |
