mirror of
https://github.com/HifiExperiments/overte.git
synced 2025-08-04 16:38:56 +02:00
Adding HazeStage
This commit is contained in:
parent
2394d0931c
commit
4d501d6510
5 changed files with 35 additions and 5 deletions
|
@ -52,6 +52,12 @@ void ZoneEntityRenderer::onRemoveFromSceneTyped(const TypedEntityPointer& entity
|
|||
_backgroundStage->removeBackground(_backgroundIndex);
|
||||
}
|
||||
}
|
||||
|
||||
if (_hazeStage) {
|
||||
if (!HazeStage::isIndexInvalid(_hazeIndex)) {
|
||||
_hazeStage->removeHaze(_hazeIndex);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void ZoneEntityRenderer::doRender(RenderArgs* args) {
|
||||
|
@ -95,6 +101,11 @@ void ZoneEntityRenderer::doRender(RenderArgs* args) {
|
|||
assert(_backgroundStage);
|
||||
}
|
||||
|
||||
if (!_hazeStage) {
|
||||
_hazeStage = args->_scene->getStage<HazeStage>();
|
||||
assert(_hazeStage);
|
||||
}
|
||||
|
||||
{ // Sun
|
||||
// Need an update ?
|
||||
if (_needSunUpdate) {
|
||||
|
@ -129,11 +140,22 @@ void ZoneEntityRenderer::doRender(RenderArgs* args) {
|
|||
if (_needBackgroundUpdate) {
|
||||
if (BackgroundStage::isIndexInvalid(_backgroundIndex)) {
|
||||
_backgroundIndex = _backgroundStage->addBackground(_background);
|
||||
} else {
|
||||
}
|
||||
else {
|
||||
|
||||
}
|
||||
_needBackgroundUpdate = false;
|
||||
}
|
||||
|
||||
if (_needHazeUpdate) {
|
||||
if (HazeStage::isIndexInvalid(_hazeIndex)) {
|
||||
_hazeIndex = _hazeStage->addHaze(_haze);
|
||||
}
|
||||
else {
|
||||
|
||||
}
|
||||
_needHazeUpdate = false;
|
||||
}
|
||||
}
|
||||
|
||||
if (_visible) {
|
||||
|
|
|
@ -18,6 +18,7 @@
|
|||
#include <model/Stage.h>
|
||||
#include <LightStage.h>
|
||||
#include <BackgroundStage.h>
|
||||
#include <HazeStage.h>
|
||||
#include <TextureCache.h>
|
||||
#include "RenderableEntityItem.h"
|
||||
#if 0
|
||||
|
@ -60,7 +61,7 @@ private:
|
|||
model::LightPointer editAmbientLight() { _needAmbientUpdate = true; return _ambientLight; }
|
||||
model::SunSkyStagePointer editBackground() { _needBackgroundUpdate = true; return _background; }
|
||||
model::SkyboxPointer editSkybox() { return editBackground()->getSkybox(); }
|
||||
model::HazePointer editHaze() { return editBackground()->getHaze(); }
|
||||
model::HazePointer editHaze() { _needHazeUpdate = true; return _haze; }
|
||||
|
||||
bool _needsInitialSimulation{ true };
|
||||
glm::vec3 _lastPosition;
|
||||
|
@ -79,6 +80,7 @@ private:
|
|||
const model::LightPointer _sunLight{ std::make_shared<model::Light>() };
|
||||
const model::LightPointer _ambientLight{ std::make_shared<model::Light>() };
|
||||
const model::SunSkyStagePointer _background{ std::make_shared<model::SunSkyStage>() };
|
||||
const model::HazePointer _haze{ std::make_shared<model::Haze>() };
|
||||
BackgroundMode _backgroundMode{ BACKGROUND_MODE_INHERIT };
|
||||
HazeMode _hazeMode{ HAZE_MODE_INHERIT };
|
||||
|
||||
|
@ -88,10 +90,14 @@ private:
|
|||
BackgroundStagePointer _backgroundStage;
|
||||
BackgroundStage::Index _backgroundIndex{ BackgroundStage::INVALID_INDEX };
|
||||
|
||||
HazeStagePointer _hazeStage;
|
||||
HazeStage::Index _hazeIndex{ HazeStage::INVALID_INDEX };
|
||||
|
||||
bool _needUpdate{ true };
|
||||
bool _needSunUpdate{ true };
|
||||
bool _needAmbientUpdate{ true };
|
||||
bool _needBackgroundUpdate{ true };
|
||||
bool _needHazeUpdate{ true };
|
||||
|
||||
KeyLightPropertyGroup _keyLightProperties;
|
||||
SkyboxPropertyGroup _skyboxProperties;
|
||||
|
|
|
@ -110,6 +110,6 @@ namespace model {
|
|||
UniformBufferView _parametersBuffer;
|
||||
};
|
||||
|
||||
using HazePointer = std::shared_ptr<Haze>;
|
||||
typedef std::shared_ptr<Haze> HazePointer;
|
||||
}
|
||||
#endif // hifi_model_Haze_h
|
||||
|
|
|
@ -29,8 +29,8 @@ public:
|
|||
static const Index INVALID_INDEX { render::indexed_container::INVALID_INDEX };
|
||||
static bool isIndexInvalid(Index index) { return index == INVALID_INDEX; }
|
||||
|
||||
using HazePointer = model::SunSkyStagePointer;
|
||||
using Hazes = render::indexed_container::IndexedPointerVector<model::SunSkyStage>;
|
||||
using HazePointer = model::HazePointer;
|
||||
using Hazes = render::indexed_container::IndexedPointerVector<model::Haze>;
|
||||
using HazeMap = std::unordered_map<HazePointer, Index>;
|
||||
|
||||
using HazeIndices = std::vector<Index>;
|
||||
|
|
|
@ -13,12 +13,14 @@
|
|||
#include <render/SceneTask.h>
|
||||
#include "LightStage.h"
|
||||
#include "BackgroundStage.h"
|
||||
#include "HazeStage.h"
|
||||
#include <render/TransitionStage.h>
|
||||
#include "DeferredLightingEffect.h"
|
||||
|
||||
void UpdateSceneTask::build(JobModel& task, const render::Varying& input, render::Varying& output) {
|
||||
task.addJob<LightStageSetup>("LightStageSetup");
|
||||
task.addJob<BackgroundStageSetup>("BackgroundStageSetup");
|
||||
task.addJob<HazeStageSetup>("HazeStageSetup");
|
||||
task.addJob<render::TransitionStageSetup>("TransitionStageSetup");
|
||||
|
||||
task.addJob<DefaultLightingSetup>("DefaultLightingSetup");
|
||||
|
|
Loading…
Reference in a new issue