From 2039f496912216e36b69951f0c3980b21bf2fc59 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fernando=20Garc=C3=ADa=20Li=C3=B1=C3=A1n?= Date: Sun, 1 Aug 2021 08:34:49 +0200 Subject: [PATCH] Add missing call to glReadBuffer() when doing depth-only FBOs --- simgear/scene/viewer/CompositorPass.cxx | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/simgear/scene/viewer/CompositorPass.cxx b/simgear/scene/viewer/CompositorPass.cxx index aca50056..0b047b61 100644 --- a/simgear/scene/viewer/CompositorPass.cxx +++ b/simgear/scene/viewer/CompositorPass.cxx @@ -395,8 +395,10 @@ PassBuilder::build(Compositor *compositor, const SGPropertyNode *root, // Explicitly let OpenGL know that there are no color buffers attached. // This is required on GL <4.2 contexts or the framebuffer will be // considered incomplete. - if (!color_buffer_present) + if (!color_buffer_present) { camera->setDrawBuffer(GL_NONE); + camera->setReadBuffer(GL_NONE); + } } return pass.release();