Showing the changes to libraries/render-utils/src/DebugDeferredBuffer.cpp (1 of 356 files). Show all
Unified · Split
| @@ -237,6 +237,14 @@ DebugDeferredBuffer::DebugDeferredBuffer() { · 236 unmodified lines | ||
| 237 | 237 | CustomPipeline pipeline; |
| 238 | 238 | pipeline.info = QFileInfo(QString::fromStdString(CUSTOM_FILE)); |
| 239 | 239 | _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 | + } | |
| 240 | 248 | } |
| 241 | 249 | |
| 242 | 250 | std::string DebugDeferredBuffer::getShaderSourceCode(Mode mode, std::string customFile) { |
| @@ -410,6 +418,14 @@ void DebugDeferredBuffer::run(const SceneContextPointer& sceneContext, const Ren · 167 unmodified lines | ||
| 410 | 418 | batch.setResourceTexture(Lighting, deferredFramebuffer->getLightingTexture()); |
| 411 | 419 | } |
| 412 | 420 | |
| 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 | + | |
| 413 | 429 | if (linearDepthTarget) { |
| 414 | 430 | batch.setResourceTexture(LinearDepth, linearDepthTarget->getLinearDepthTexture()); |
| 415 | 431 | batch.setResourceTexture(HalfLinearDepth, linearDepthTarget->getHalfLinearDepthTexture()); |
| @@ -426,7 +442,7 @@ void DebugDeferredBuffer::run(const SceneContextPointer& sceneContext, const Ren · 10 unmodified lines | ||
| 426 | 442 | const glm::vec4 color(1.0f, 1.0f, 1.0f, 1.0f); |
| 427 | 443 | const glm::vec2 bottomLeft(_size.x, _size.y); |
| 428 | 444 | const glm::vec2 topRight(_size.z, _size.w); |
| 429 | − geometryBuffer->renderQuad(batch, bottomLeft, topRight, color); | |
| 445 | + geometryBuffer->renderQuad(batch, bottomLeft, topRight, color, _geometryId); | |
| 430 | 446 | |
| 431 | 447 | |
| 432 | 448 | batch.setResourceTexture(Albedo, nullptr); |