diff -r 10a6298f636f -r b8ad4c12d937 src/gl/partrenderer.cpp --- a/src/gl/partrenderer.cpp Mon Jun 20 19:49:56 2022 +0300 +++ b/src/gl/partrenderer.cpp Mon Jun 20 21:14:17 2022 +0300 @@ -18,6 +18,7 @@ #include #include +#include #include #include #include @@ -461,13 +462,15 @@ const gl::RenderStyle oldRenderStyle = this->renderPreferences.style; this->renderPreferences.style = gl::RenderStyle::PickScene; this->makeCurrent(); + QOpenGLFramebufferObject fbo{this->width(), this->height(), QOpenGLFramebufferObject::CombinedDepthStencil}; + fbo.bind(); this->renderScene(); std::array data; this->checkForGLErrors(); glfunc.glReadPixels(where.x(), where.y(), 1, 1, GL_RGB, GL_UNSIGNED_BYTE, &data[0]); this->checkForGLErrors(); + fbo.release(); this->renderPreferences.style = oldRenderStyle; - this->update(); return gl::idFromColor(data); }