Showing the changes to libraries/render-utils/src/RenderDeferredTask.cpp (1 of 8 files). Show all
Unified · Split
| @@ -44,15 +44,16 @@ void SetupDeferred::run(const SceneContextPointer& sceneContext, const RenderCon · 43 unmodified lines | |||
| 44 | batch.setViewportTransform(args->_viewport); | 44 | batch.setViewportTransform(args->_viewport); |
| 45 | batch.setStateScissorRect(args->_viewport); | 45 | batch.setStateScissorRect(args->_viewport); |
| 46 | 46 | ||
| 47 | batch.setFramebuffer(primaryFboStencil); | 47 | /* batch.setFramebuffer(primaryFboStencil); |
| 48 | batch.clearFramebuffer( | 48 | batch.clearFramebuffer( |
| 49 | gpu::Framebuffer::BUFFER_STENCIL, | 49 | gpu::Framebuffer::BUFFER_STENCIL, |
| 50 | vec4(vec3(0), 1), 1.0, 0.0, true); | 50 | vec4(vec3(0), 1), 1.0, 0.0, true); |
| 51 | 51 | */ | |
| 52 | batch.setFramebuffer(primaryFbo); | 52 | batch.setFramebuffer(primaryFbo); |
| 53 | batch.clearFramebuffer( | 53 | batch.clearFramebuffer( |
| 54 | gpu::Framebuffer::BUFFER_COLOR0 | | 54 | gpu::Framebuffer::BUFFER_COLOR0 | |
| 55 | gpu::Framebuffer::BUFFER_DEPTH, | 55 | gpu::Framebuffer::BUFFER_DEPTH | |
| 56 | gpu::Framebuffer::BUFFER_STENCIL, | ||
| 56 | vec4(vec3(0), 1), 1.0, 0.0, true); | 57 | vec4(vec3(0), 1), 1.0, 0.0, true); |
| 57 | }); | 58 | }); |
| 58 | } | 59 | } |
| @@ -313,7 +314,8 @@ const gpu::PipelinePointer& DrawStencilDeferred::getOpaquePipeline() { · 254 unmodified lines | |||
| 313 | gpu::Shader::makeProgram((*program)); | 314 | gpu::Shader::makeProgram((*program)); |
| 314 | 315 | ||
| 315 | auto state = std::make_shared<gpu::State>(); | 316 | auto state = std::make_shared<gpu::State>(); |
| 316 | state->setStencilTest(true, 0xFF, gpu::State::StencilTest(STENCIL_OPAQUE, 0xFF, gpu::ALWAYS, gpu::State::STENCIL_OP_REPLACE, gpu::State::STENCIL_OP_REPLACE, gpu::State::STENCIL_OP_REPLACE)); | 317 | state->setDepthTest(true, false, gpu::LESS_EQUAL); |
| 318 | state->setStencilTest(true, 0xFF, gpu::State::StencilTest(STENCIL_OPAQUE, 0xFF, gpu::ALWAYS, gpu::State::STENCIL_OP_REPLACE, gpu::State::STENCIL_OP_KEEP, gpu::State::STENCIL_OP_REPLACE)); | ||
| 317 | state->setColorWriteMask(0); | 319 | state->setColorWriteMask(0); |
| 318 | 320 | ||
| 319 | _opaquePipeline.reset(gpu::Pipeline::create(program, state)); | 321 | _opaquePipeline.reset(gpu::Pipeline::create(program, state)); |
| @@ -340,7 +342,7 @@ void DrawStencilDeferred::run(const SceneContextPointer& sceneContext, const Ren · 20 unmodified lines | |||
| 340 | batch.setStateScissorRect(args->_viewport); | 342 | batch.setStateScissorRect(args->_viewport); |
| 341 | 343 | ||
| 342 | batch.setPipeline(getOpaquePipeline()); | 344 | batch.setPipeline(getOpaquePipeline()); |
| 343 | batch.setResourceTexture(0, primaryDepth); | 345 | // batch.setResourceTexture(0, primaryDepth); |
| 344 | 346 | ||
| 345 | batch.draw(gpu::TRIANGLE_STRIP, 4); | 347 | batch.draw(gpu::TRIANGLE_STRIP, 4); |
| 346 | batch.setResourceTexture(0, nullptr); | 348 | batch.setResourceTexture(0, nullptr); |