History

REarrange the light stage construction and light frame usage to produce the light clusters

samcake committed 10 years ago

Commit 821072b1 parent 7a7a60a11 files · +128 −50Browse files

Showing the changes to libraries/render-utils/src/DeferredLightingEffect.cpp (1 of 11 files). Show all

Unified · Split

libraries/render-utils/src/DeferredLightingEffect.cpp+8−3
@@ -118,9 +118,7 @@ void DeferredLightingEffect::init() { · 117 unmodified lines
118118
119119 // Light Stage and clusters
120120 _lightStage = std::make_shared<LightStage>();
121− _lightClusters = std::make_shared<LightClusters>();
122− _lightClusters->updateLightStage(_lightStage);
123−
121+
124122 // Allocate a global light representing the Global Directional light casting shadow (the sun) and the ambient light
125123 _allocatedLights.push_back(std::make_shared<model::Light>());
126124 model::LightPointer lp = _allocatedLights[0];
@@ -146,6 +144,7 @@ void DeferredLightingEffect::addLight(const model::LightPointer& light) { · 19 unmodified lines
146144 }
147145 }
148146
147+
149148 void DeferredLightingEffect::addPointLight(const glm::vec3& position, float radius, const glm::vec3& color,
150149 float intensity, float falloffRadius) {
151150 addSpotLight(position, radius, color, intensity, falloffRadius);
@@ -472,6 +471,7 @@ void PreparePrimaryFramebuffer::run(const SceneContextPointer& sceneContext, con · 320 unmodified lines
472471 }
473472 _primaryFramebuffer->resize(frameSize.x, frameSize.y);
474473
474+
475475 primaryFramebuffer = _primaryFramebuffer;
476476 }
477477
@@ -508,6 +508,11 @@ void PrepareDeferred::run(const SceneContextPointer& sceneContext, const RenderC · 30 unmodified lines
508508 // For the rest of the rendering, bind the lighting model
509509 batch.setUniformBuffer(LIGHTING_MODEL_BUFFER_SLOT, lightingModel->getParametersBuffer());
510510 });
511+
512+
513+ // Prepare a fresh Light Frame
514+ auto deferredLightingEffect = DependencyManager::get<DeferredLightingEffect>();
515+ deferredLightingEffect->getLightStage()->_currentFrame.clear();
511516 }
512517
513518

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t