Showing the changes to libraries/render-utils/src/DebugDeferredBuffer.cpp (1 of 9 files). Show all
Unified · Split
| @@ -17,6 +17,7 @@ · 16 unmodified lines | ||
| 17 | 17 | #include <ViewFrustum.h> |
| 18 | 18 | |
| 19 | 19 | #include "GeometryCache.h" |
| 20 | +#include "FramebufferCache.h" | |
| 20 | 21 | |
| 21 | 22 | #include "debug_deferred_buffer_vert.h" |
| 22 | 23 | #include "debug_deferred_buffer_frag.h" |
| @@ -33,16 +34,8 @@ const gpu::PipelinePointer& DebugDeferredBuffer::getPipeline() { · 10 unmodified lines | ||
| 33 | 34 | gpu::Shader::BindingSet slotBindings; |
| 34 | 35 | gpu::Shader::makeProgram(*program, slotBindings); |
| 35 | 36 | |
| 36 | − auto state = std::make_shared<gpu::State>(); | |
| 37 | − | |
| 38 | − state->setDepthTest(false, false, gpu::LESS_EQUAL); | |
| 39 | − | |
| 40 | − // Blend on transparent | |
| 41 | − state->setBlendFunction(true, | |
| 42 | − gpu::State::SRC_ALPHA, gpu::State::BLEND_OP_ADD, gpu::State::INV_SRC_ALPHA); | |
| 43 | − | |
| 44 | 37 | // Good to go add the brand new pipeline |
| 45 | − _pipeline.reset(gpu::Pipeline::create(program, state)); | |
| 38 | + _pipeline.reset(gpu::Pipeline::create(program, std::make_shared<gpu::State>())); | |
| 46 | 39 | } |
| 47 | 40 | return _pipeline; |
| 48 | 41 | } |
| @@ -53,6 +46,9 @@ void DebugDeferredBuffer::run(const SceneContextPointer& sceneContext, const Ren · 4 unmodified lines | ||
| 53 | 46 | assert(renderContext->args->_viewFrustum); |
| 54 | 47 | RenderArgs* args = renderContext->args; |
| 55 | 48 | gpu::doInBatch(args->_context, [&](gpu::Batch& batch) { |
| 49 | + auto geometryBuffer = DependencyManager::get<GeometryCache>(); | |
| 50 | + auto framebufferCache = DependencyManager::get<FramebufferCache>(); | |
| 51 | + | |
| 56 | 52 | |
| 57 | 53 | glm::mat4 projMat; |
| 58 | 54 | Transform viewMat; |
| @@ -64,9 +60,11 @@ void DebugDeferredBuffer::run(const SceneContextPointer& sceneContext, const Ren · 5 unmodified lines | ||
| 64 | 60 | |
| 65 | 61 | batch.setPipeline(getPipeline()); |
| 66 | 62 | |
| 63 | + batch.setResourceTexture(0, framebufferCache->getPrimaryNormalTexture()); | |
| 64 | + | |
| 67 | 65 | glm::vec4 color(0.0f, 0.0f, 1.0f, 1.0f); |
| 68 | 66 | glm::vec2 bottomLeft(0.0f, -1.0f); |
| 69 | 67 | glm::vec2 topRight(1.0f, 1.0f); |
| 70 | − DependencyManager::get<GeometryCache>()->renderQuad(batch, bottomLeft, topRight, color); | |
| 68 | + geometryBuffer->renderQuad(batch, bottomLeft, topRight, color); | |
| 71 | 69 | }); |
| 72 | 70 | } |