Merge pull request #4545 from samcake/orange

No more FLat global lighting, always use one of the SPherical harmonics presets
This commit is contained in:
Brad Hefta-Gaub 2015-03-31 15:52:49 -07:00
commit b43761a6c1

View file

@ -535,10 +535,13 @@ void DeferredLightingEffect::loadLightProgram(const char* fragSource, bool limit
}
void DeferredLightingEffect::setAmbientLightMode(int preset) {
if ((preset >= -1) && (preset < model::SphericalHarmonics::NUM_PRESET)) {
if ((preset >= 0) && (preset < model::SphericalHarmonics::NUM_PRESET)) {
_ambientLightMode = preset;
auto light = _allocatedLights.front();
light->setAmbientSpherePreset(model::SphericalHarmonics::Preset(preset % model::SphericalHarmonics::NUM_PRESET));
} else {
// force to preset 0
setAmbientLightMode(0);
}
}