mirror of
https://github.com/HifiExperiments/overte.git
synced 2025-08-04 03:53:10 +02:00
Keylight inherit/off/on working
This commit is contained in:
parent
e974cac177
commit
502cac2ac7
2 changed files with 14 additions and 1 deletions
|
@ -165,7 +165,17 @@ void ZoneEntityRenderer::doRender(RenderArgs* args) {
|
||||||
|
|
||||||
if (_visible) {
|
if (_visible) {
|
||||||
// Finally, push the light visible in the frame
|
// Finally, push the light visible in the frame
|
||||||
if (_keyLightMode != BACKGROUND_MODE_INHERIT) {
|
if (_keyLightMode == COMPONENT_MODE_DISABLED && sunOnIndex == NO_STORED_VALUE) {
|
||||||
|
// Just turned off, store previous value before changing
|
||||||
|
sunOnIndex = _sunIndex;
|
||||||
|
_sunIndex = _stage->getSunOffLight();
|
||||||
|
} else if (_keyLightMode == COMPONENT_MODE_ENABLED && sunOnIndex != NO_STORED_VALUE) {
|
||||||
|
// Just turned on, restore previous value before clearing stored value
|
||||||
|
_sunIndex = sunOnIndex;
|
||||||
|
sunOnIndex = NO_STORED_VALUE;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (_keyLightMode != COMPONENT_MODE_INHERIT) {
|
||||||
_stage->_currentFrame.pushSunLight(_sunIndex);
|
_stage->_currentFrame.pushSunLight(_sunIndex);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -95,6 +95,9 @@ private:
|
||||||
indexed_container::Index _shadowIndex{ LightStage::INVALID_INDEX };
|
indexed_container::Index _shadowIndex{ LightStage::INVALID_INDEX };
|
||||||
indexed_container::Index _ambientIndex{ LightStage::INVALID_INDEX };
|
indexed_container::Index _ambientIndex{ LightStage::INVALID_INDEX };
|
||||||
|
|
||||||
|
const int NO_STORED_VALUE { -1 };
|
||||||
|
indexed_container::Index sunOnIndex { NO_STORED_VALUE };
|
||||||
|
|
||||||
BackgroundStagePointer _backgroundStage;
|
BackgroundStagePointer _backgroundStage;
|
||||||
BackgroundStage::Index _backgroundIndex{ BackgroundStage::INVALID_INDEX };
|
BackgroundStage::Index _backgroundIndex{ BackgroundStage::INVALID_INDEX };
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue