Settings UI: LightManager ShadowOptions now affect all lights.

This commit is contained in:
Philip Rideout
2021-06-30 09:42:00 -07:00
parent fcca62ec6a
commit 86461663d8
10 changed files with 200 additions and 103 deletions
+8 -1
View File
@@ -906,7 +906,7 @@ void applySettings(const MaterialSettings& settings, MaterialInstance* dest) {
}
void applySettings(const LightSettings& settings, IndirectLight* ibl, utils::Entity sunlight,
LightManager* lm, Scene* scene) {
utils::Entity* sceneLights, size_t sceneLightCount, LightManager* lm, Scene* scene) {
auto light = lm->getInstance(sunlight);
if (light) {
if (settings.enableSunlight) {
@@ -924,6 +924,13 @@ void applySettings(const LightSettings& settings, IndirectLight* ibl, utils::Ent
ibl->setIntensity(settings.iblIntensity);
ibl->setRotation(math::mat3f::rotation(settings.iblRotation, math::float3 { 0, 1, 0 }));
}
for (size_t i = 0; i < sceneLightCount; i++) {
auto light = lm->getInstance(sceneLights[i]);
if (lm->isSpotLight(light)) {
lm->setShadowCaster(light, settings.enableShadows);
}
lm->setShadowOptions(light, settings.shadowOptions);
}
}
static LinearColor inverseTonemapSRGB(sRGBColor x) {