History

Render the rear view mirror in a separate target and then display it during overlay pass

Sam Gateau committed 11 years ago

Commit a5618741 parent f86c06410 files · +146 −27Browse files

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

Unified · Split

libraries/render-utils/src/GeometryCache.cpp+12−2
@@ -1749,7 +1749,7 @@ QSharedPointer<Resource> GeometryCache::createResource(const QUrl& url, const QS · 1748 unmodified lines
17491749 return geometry.staticCast<Resource>();
17501750 }
17511751
1752−void GeometryCache::useSimpleDrawPipeline(gpu::Batch& batch) {
1752+void GeometryCache::useSimpleDrawPipeline(gpu::Batch& batch, bool noBlend) {
17531753 if (!_standardDrawPipeline) {
17541754 auto vs = gpu::ShaderPointer(gpu::Shader::createVertex(std::string(standardTransformPNTC_vert)));
17551755 auto ps = gpu::ShaderPointer(gpu::Shader::createPixel(std::string(standardDrawTexture_frag)));
@@ -1762,8 +1762,18 @@ void GeometryCache::useSimpleDrawPipeline(gpu::Batch& batch) { · 6 unmodified lines
17621762 state->setBlendFunction(true, gpu::State::SRC_ALPHA, gpu::State::BLEND_OP_ADD, gpu::State::INV_SRC_ALPHA);
17631763
17641764 _standardDrawPipeline.reset(gpu::Pipeline::create(program, state));
1765+
1766+ auto stateNoBlend = std::make_shared<gpu::State>();
1767+ stateNoBlend->setColorWriteMask(true, true, true, false);
1768+ stateNoBlend->setBlendFunction(true, gpu::State::SRC_ALPHA, gpu::State::BLEND_OP_ADD, gpu::State::INV_SRC_ALPHA);
1769+
1770+ _standardDrawPipelineNoBlend.reset(gpu::Pipeline::create(program, stateNoBlend));
1771+ }
1772+ if (noBlend) {
1773+ batch.setPipeline(_standardDrawPipelineNoBlend);
1774+ } else {
1775+ batch.setPipeline(_standardDrawPipeline);
17651776 }
1766− batch.setPipeline(_standardDrawPipeline);
17671777 }
17681778
17691779 const float NetworkGeometry::NO_HYSTERESIS = -1.0f;