History

Merge with upstream

samcake committed 10 years ago

Commit 6926cd22 parents 8784f70 a49669a356 files · +7490 −3941Browse files

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

Unified · Split

libraries/render-utils/src/DebugDeferredBuffer.cpp+17−1
@@ -237,6 +237,14 @@ DebugDeferredBuffer::DebugDeferredBuffer() { · 236 unmodified lines
237237 CustomPipeline pipeline;
238238 pipeline.info = QFileInfo(QString::fromStdString(CUSTOM_FILE));
239239 _customPipelines.emplace(CUSTOM_FILE, pipeline);
240+ _geometryId = DependencyManager::get<GeometryCache>()->allocateID();
241+}
242+
243+DebugDeferredBuffer::~DebugDeferredBuffer() {
244+ auto geometryCache = DependencyManager::get<GeometryCache>();
245+ if (geometryCache) {
246+ geometryCache->releaseID(_geometryId);
247+ }
240248 }
241249
242250 std::string DebugDeferredBuffer::getShaderSourceCode(Mode mode, std::string customFile) {
@@ -410,6 +418,14 @@ void DebugDeferredBuffer::run(const SceneContextPointer& sceneContext, const Ren · 167 unmodified lines
410418 batch.setResourceTexture(Lighting, deferredFramebuffer->getLightingTexture());
411419 }
412420
421+ auto deferredLightingEffect = DependencyManager::get<DeferredLightingEffect>();
422+ assert(deferredLightingEffect->getLightStage()->getNumLights() > 0);
423+ auto lightAndShadow = deferredLightingEffect->getLightStage()->getLightAndShadow(0);
424+ const auto& globalShadow = lightAndShadow.second;
425+ if (globalShadow) {
426+ batch.setResourceTexture(Shadow, globalShadow->map);
427+ }
428+
413429 if (linearDepthTarget) {
414430 batch.setResourceTexture(LinearDepth, linearDepthTarget->getLinearDepthTexture());
415431 batch.setResourceTexture(HalfLinearDepth, linearDepthTarget->getHalfLinearDepthTexture());
@@ -426,7 +442,7 @@ void DebugDeferredBuffer::run(const SceneContextPointer& sceneContext, const Ren · 10 unmodified lines
426442 const glm::vec4 color(1.0f, 1.0f, 1.0f, 1.0f);
427443 const glm::vec2 bottomLeft(_size.x, _size.y);
428444 const glm::vec2 topRight(_size.z, _size.w);
429− geometryBuffer->renderQuad(batch, bottomLeft, topRight, color);
445+ geometryBuffer->renderQuad(batch, bottomLeft, topRight, color, _geometryId);
430446
431447
432448 batch.setResourceTexture(Albedo, nullptr);

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