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 | 44 | batch.setViewportTransform(args->_viewport); |
| 45 | 45 | batch.setStateScissorRect(args->_viewport); |
| 46 | 46 | |
| 47 | − batch.setFramebuffer(primaryFboStencil); | |
| 47 | + /* batch.setFramebuffer(primaryFboStencil); | |
| 48 | 48 | batch.clearFramebuffer( |
| 49 | 49 | gpu::Framebuffer::BUFFER_STENCIL, |
| 50 | 50 | vec4(vec3(0), 1), 1.0, 0.0, true); |
| 51 | − | |
| 51 | + */ | |
| 52 | 52 | batch.setFramebuffer(primaryFbo); |
| 53 | 53 | batch.clearFramebuffer( |
| 54 | 54 | gpu::Framebuffer::BUFFER_COLOR0 | |
| 55 | − gpu::Framebuffer::BUFFER_DEPTH, | |
| 55 | + gpu::Framebuffer::BUFFER_DEPTH | | |
| 56 | + gpu::Framebuffer::BUFFER_STENCIL, | |
| 56 | 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 | 314 | gpu::Shader::makeProgram((*program)); |
| 314 | 315 | |
| 315 | 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 | 319 | state->setColorWriteMask(0); |
| 318 | 320 | |
| 319 | 321 | _opaquePipeline.reset(gpu::Pipeline::create(program, state)); |
| @@ -340,7 +342,7 @@ void DrawStencilDeferred::run(const SceneContextPointer& sceneContext, const Ren · 20 unmodified lines | ||
| 340 | 342 | batch.setStateScissorRect(args->_viewport); |
| 341 | 343 | |
| 342 | 344 | batch.setPipeline(getOpaquePipeline()); |
| 343 | − batch.setResourceTexture(0, primaryDepth); | |
| 345 | + // batch.setResourceTexture(0, primaryDepth); | |
| 344 | 346 | |
| 345 | 347 | batch.draw(gpu::TRIANGLE_STRIP, 4); |
| 346 | 348 | batch.setResourceTexture(0, nullptr); |