From d85205212aa5960147b8338519a47c7457884f4f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fernando=20Garc=C3=ADa=20Li=C3=B1=C3=A1n?= Date: Sat, 24 Jul 2021 19:19:44 +0200 Subject: [PATCH] Compositor: Attach color and depth render buffers by default --- simgear/scene/viewer/CompositorPass.cxx | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/simgear/scene/viewer/CompositorPass.cxx b/simgear/scene/viewer/CompositorPass.cxx index 78049fc8..1270f1d1 100644 --- a/simgear/scene/viewer/CompositorPass.cxx +++ b/simgear/scene/viewer/CompositorPass.cxx @@ -199,7 +199,7 @@ PassBuilder::build(Compositor *compositor, const SGPropertyNode *root, std::stringstream att_ss; std::string att_bit; // No implicit attachments by default - att_ss << root->getStringValue("implicit-attachment-mask", ""); + att_ss << root->getStringValue("implicit-attachment-mask", "color depth"); while (att_ss >> att_bit) { if (att_bit == "color") implicit_attachments |= osg::DisplaySettings::IMPLICIT_COLOR_BUFFER_ATTACHMENT; else if (att_bit == "depth") implicit_attachments |= osg::DisplaySettings::IMPLICIT_DEPTH_BUFFER_ATTACHMENT; @@ -394,6 +394,11 @@ public: camera->setViewMatrix(osg::Matrix::identity()); camera->setProjectionMatrix(osg::Matrix::ortho2D(0, 1, 0, 1)); + // Do not automatically add a depth buffer + camera->setImplicitBufferAttachmentMask( + osg::DisplaySettings::IMPLICIT_COLOR_BUFFER_ATTACHMENT, + osg::DisplaySettings::IMPLICIT_COLOR_BUFFER_ATTACHMENT); + float left = 0.0f, bottom = 0.0f, width = 1.0f, height = 1.0f, scale = 1.0f; const SGPropertyNode *p_geometry = root->getNode("geometry"); if (p_geometry) {