Re: Unwanted repeated / not-cleared rendering of elements in Noesis
Understandable.Yeah, sorry, an executable is not an option. We need one of this:
- A renderdoc capture showing the issue
- A xaml reproducing the issue in XamlPlayer
- A minor modification (patch) to one of our examples reproducing the issue.
I can't remember all of the examples - do any of them feature moving elements? If everything's stationary it might be impossible to see the issue even if I successfully trigger it with a modification as suggested.
Otherwise I shall embark on parring down the main UI to something the player can handle.
-
sfernandez
Site Admin
- Posts: 2997
- Joined:
Re: Unwanted repeated / not-cleared rendering of elements in Noesis
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?
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?
Re: Unwanted repeated / not-cleared rendering of elements in Noesis
Thanks for the tip.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?
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:
Code: Select all
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();
}
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.
-
sfernandez
Site Admin
- Posts: 2997
- Joined:
Re: Unwanted repeated / not-cleared rendering of elements in Noesis
Great to hear you finally get this working, marking this as solved.
Re: Unwanted repeated / not-cleared rendering of elements in Noesis
When we need to render masks, we only render to the stencil buffer. Color buffer is disabled. That explain why your clear was failing. In general, after invoking our Render or RenderOffscreen you cannot assume that any GL state previously set will be preserved.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.
Re: Unwanted repeated / not-cleared rendering of elements in Noesis
I also added a glColorMask call in our IntegrationGLUT example.
Thank for the feedback!
Thank for the feedback!
Who is online
Users browsing this forum: Ahrefs [Bot] and 7 guests