History

FIxing the rear view mirror issue with background and fooling around with Lighting equations

samcake committed 11 years ago

Commit a2ca1c01 parent f0b76228 files · +38 −24Browse files

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

Unified · Split

libraries/render-utils/src/RenderDeferredTask.cpp+7−5
@@ -44,15 +44,16 @@ void SetupDeferred::run(const SceneContextPointer& sceneContext, const RenderCon · 43 unmodified lines
4444 batch.setViewportTransform(args->_viewport);
4545 batch.setStateScissorRect(args->_viewport);
4646
47− batch.setFramebuffer(primaryFboStencil);
47+ /* batch.setFramebuffer(primaryFboStencil);
4848 batch.clearFramebuffer(
4949 gpu::Framebuffer::BUFFER_STENCIL,
5050 vec4(vec3(0), 1), 1.0, 0.0, true);
51−
51+ */
5252 batch.setFramebuffer(primaryFbo);
5353 batch.clearFramebuffer(
5454 gpu::Framebuffer::BUFFER_COLOR0 |
55− gpu::Framebuffer::BUFFER_DEPTH,
55+ gpu::Framebuffer::BUFFER_DEPTH |
56+ gpu::Framebuffer::BUFFER_STENCIL,
5657 vec4(vec3(0), 1), 1.0, 0.0, true);
5758 });
5859 }
@@ -313,7 +314,8 @@ const gpu::PipelinePointer& DrawStencilDeferred::getOpaquePipeline() { · 254 unmodified lines
313314 gpu::Shader::makeProgram((*program));
314315
315316 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));
317319 state->setColorWriteMask(0);
318320
319321 _opaquePipeline.reset(gpu::Pipeline::create(program, state));
@@ -340,7 +342,7 @@ void DrawStencilDeferred::run(const SceneContextPointer& sceneContext, const Ren · 20 unmodified lines
340342 batch.setStateScissorRect(args->_viewport);
341343
342344 batch.setPipeline(getOpaquePipeline());
343− batch.setResourceTexture(0, primaryDepth);
345+ // batch.setResourceTexture(0, primaryDepth);
344346
345347 batch.draw(gpu::TRIANGLE_STRIP, 4);
346348 batch.setResourceTexture(0, nullptr);