All the evidence in this post indicates that the problem is from not clearing or rendering anything to the background on each frame, that is why it is not reproducible in a single RenderDoc capture, and you only see it when moving objects.
If I take our HelloWorld example and remove the background from the root Window, then I get something like this:
Are you clearing the background every frame before rendering the UI on top?
Thanks for the tip.
I sent this thread to a friend to get some backup on the RenderDoc capture since I'm not as experienced in that area.
They said that my clear isn't working right.
"clear has color writes off"
"last noesis draw turns off color writes"
So I have added glColorMask to my render loop and it fixed the issue. Here is the code shared earlier with the change marked, which has
fixed the issue:
void ClientUILayer::OnPreUpdate(float dT)
{
World& world = GetActiveWorld();
const float localGameTimeSecs = world.gameTime_;
UpdateGUI(localGameTimeSecs); // Updates the view
RenderGUIOffscreen(); // Calls UpdateRenderTree and RenderOffscreen
glBindFramebuffer(GL_FRAMEBUFFER, 0);
const glm::vec2 windowSize = window_->GetWindowSize();
glViewport(0, 0, GLsizei(windowSize.x), GLsizei(windowSize.y));
glClearColor(0.0f, 0.0f, 0.25f, 0.0f);
glClearStencil(0);
glColorMask(true, true, true, true); // <<<<<<<<<<<< Added this
glClear(GL_COLOR_BUFFER_BIT | GL_STENCIL_BUFFER_BIT);
RenderGUI(); // GetRenderer()->Render();
glfwSwapBuffers((GLFWwindow*)window_->GetNativeWindow());
glfwPollEvents();
}
Thought ya'll might find this useful. I'm just using the GLRenderDevice provided without modifications; not sure what's going on with that last draw call.
Note: the problem did go away before I made this change when I used your tip to change "Background" on my main UI UserControl from "Transparent" to a solid colour.