Fix ambient light on track not updated

This commit is contained in:
Benau 2016-12-02 19:17:55 +08:00
parent acf0ac909f
commit 4fbce474c5
2 changed files with 7 additions and 6 deletions

View File

@ -750,7 +750,7 @@ GLuint ShaderBasedRenderer::getDepthStencilTexture() const
void ShaderBasedRenderer::setAmbientLight(const video::SColorf &light,
bool force_SH_computation)
{
if(!m_spherical_harmonics->has6Textures() || force_SH_computation)
if (force_SH_computation)
m_spherical_harmonics->setAmbientLight(light.toSColor());
}

View File

@ -1819,7 +1819,8 @@ void Track::loadTrackModel(bool reverse_track, unsigned int mode_id)
// ---- Set ambient color
m_ambient_color = m_default_ambient_color;
irr_driver->setAmbientLight(m_ambient_color, false);
irr_driver->setAmbientLight(m_ambient_color,
m_spherical_harmonics_textures.size() != 6/*force_SH_computation*/);
// ---- Create sun (non-ambient directional light)
if (m_sun_position.getLengthSQ() < 0.03f)