mirror of
https://github.com/lubosz/overte.git
synced 2025-04-24 09:23:17 +02:00
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:
commit
b43761a6c1
1 changed files with 4 additions and 1 deletions
|
@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue