HateDread
Topic Author
Posts: 71
Joined: 06 Feb 2020, 10:27

Re: Unwanted repeated / not-cleared rendering of elements in Noesis

11 Jan 2022, 17:41

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.
Understandable.

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.
 
User avatar
sfernandez
Site Admin
Posts: 2983
Joined: 22 Dec 2011, 19:20

Re: Unwanted repeated / not-cleared rendering of elements in Noesis

12 Jan 2022, 11:21

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:
Image

Are you clearing the background every frame before rendering the UI on top?
 
HateDread
Topic Author
Posts: 71
Joined: 06 Feb 2020, 10:27

Re: Unwanted repeated / not-cleared rendering of elements in Noesis

12 Jan 2022, 15:03

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:
Image

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.

Image
"clear has color writes off"

Image
"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.
 
User avatar
sfernandez
Site Admin
Posts: 2983
Joined: 22 Dec 2011, 19:20

Re: Unwanted repeated / not-cleared rendering of elements in Noesis

12 Jan 2022, 19:11

Great to hear you finally get this working, marking this as solved.
 
User avatar
jsantos
Site Admin
Posts: 3905
Joined: 20 Jan 2012, 17:18
Contact:

Re: Unwanted repeated / not-cleared rendering of elements in Noesis

13 Jan 2022, 17:33

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.
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.
 
User avatar
jsantos
Site Admin
Posts: 3905
Joined: 20 Jan 2012, 17:18
Contact:

Re: Unwanted repeated / not-cleared rendering of elements in Noesis

17 Jan 2022, 12:59

I also added a glColorMask call in our IntegrationGLUT example.

Thank for the feedback!

Who is online

Users browsing this forum: Ahrefs [Bot], Bing [Bot], Google [Bot] and 60 guests