My Qt3DWindow flickers at redraw and it feels as if double buffering is not working properly - is there something I need to do?
I've tried setting the global surface format parameters setSwapBehavior(QSurfaceFormat::DoubleBuffer)
but it does not seem to help. I'm using the default QForwardRenderer which is described as rendering into the backbuffer but I don't seem to be able to control when the buffer swaps
void SimulationWindow::initialiseScene()
{
this->defaultFrameGraph()->setClearColor(m_backgroundColour);
Qt3DCore::QEntity *rootEntity = new Qt3DCore::QEntity();
this->setRootEntity(rootEntity);
Qt3DRender::QRenderSettings *renderSettings = this->renderSettings();
renderSettings->setRenderPolicy(Qt3DRender::QRenderSettings::OnDemand);
}
This is the only customisation I do to the standard Qt3DWindow. Using QRenderSettings::Always makes no difference. My feeling is that there is a setting accessible either through QFrameGraphNode or through QForwardRenderer that ought to fix things, or perhaps there is a way of directly controlling when the back buffer swaps. It certainly does not only happen when I call requestUpdate() which is what I would expect. Or perhaps I need to use something other than QForwardRenderer to get more control.
Edit: I've discovered a things called Qt3DRender::QNoDraw which looks hopeful. The suggestion in the documentation is that it is attached to the QClearBuffers that is part of QForwardRenderer but not publicly accessible.