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
1749 return geometry.staticCast<Resource>();1749 return geometry.staticCast<Resource>();
1750}1750}
1751 1751
1752void GeometryCache::useSimpleDrawPipeline(gpu::Batch& batch) {1752void GeometryCache::useSimpleDrawPipeline(gpu::Batch& batch, bool noBlend) {
1753 if (!_standardDrawPipeline) {1753 if (!_standardDrawPipeline) {
1754 auto vs = gpu::ShaderPointer(gpu::Shader::createVertex(std::string(standardTransformPNTC_vert)));1754 auto vs = gpu::ShaderPointer(gpu::Shader::createVertex(std::string(standardTransformPNTC_vert)));
1755 auto ps = gpu::ShaderPointer(gpu::Shader::createPixel(std::string(standardDrawTexture_frag)));1755 auto ps = gpu::ShaderPointer(gpu::Shader::createPixel(std::string(standardDrawTexture_frag)));
@@ -1762,8 +1762,18 @@ void GeometryCache::useSimpleDrawPipeline(gpu::Batch& batch) { · 6 unmodified lines
1762 state->setBlendFunction(true, gpu::State::SRC_ALPHA, gpu::State::BLEND_OP_ADD, gpu::State::INV_SRC_ALPHA);1762 state->setBlendFunction(true, gpu::State::SRC_ALPHA, gpu::State::BLEND_OP_ADD, gpu::State::INV_SRC_ALPHA);
1763 1763
1764 _standardDrawPipeline.reset(gpu::Pipeline::create(program, state));1764 _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);
1765 }1776 }
1766 batch.setPipeline(_standardDrawPipeline);
1767}1777}
1768 1778
1769const float NetworkGeometry::NO_HYSTERESIS = -1.0f;1779const float NetworkGeometry::NO_HYSTERESIS = -1.0f;