Page 1 of 1

Integration breaks existing rendering but renders Noesis elements just fine

Posted: 14 Jul 2020, 19:58
by PixelArtDragon
I have a rendering loop working just fine for my game, but after following the steps in the integration guide, I end up with a couple of interesting problems:
  1. If I merely initialize the Noesis view's renderer, all of my renders stop working, whether or not actually update and render any of the frame-by-frame UI commands.
  2. The Noesis elements are rendering just fine.
  3. In RenderDoc, the first frame I render looks somewhat normal, but the call to SwapBuffers doesn't reflect that (and it's only the first frame).
I know I'm supposed to reset the OpenGL state to a "sane state" after any Noesis rendering call, and I thought I do that (I can provide a list of all the flags and settings I restore each frame), but it looks like what I'm resetting isn't enough. What could be the issue? And what information would help?

In case it matters, I'm using GLFW for window handling.

Re: Integration breaks existing rendering but renders Noesis elements just fine

Posted: 15 Jul 2020, 18:55
by jsantos
Effectively you need to restore all GL states after invoking RenderOffscreen or Render. You have the sources of our GL renderer to analyze all potential state changes. I also recommend using RenderDoc to help with this.

Re: Integration breaks existing rendering but renders Noesis elements just fine

Posted: 15 Jul 2020, 22:08
by PixelArtDragon
Well, upon closer fiddling with specific OpenGL parameters, I've come to the conclusion that the issue is that Noesis is drawing to the whole screen (which is causing the depth everywhere to be zero). This means that if I don't disable GL_DEPTH_TEST, it's the only thing that's rendered, and if I do disable it, I still end up with a weird blending of the clear color and what I'm tring to render (unless I also disable GL_BLEND).

Since I've seen that this can be a problem with the view I'm trying to use, I figured I'd provide it here:
<Grid xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation">
	<Button Content="Button" HorizontalAlignment="Left" Margin="10,10,0,0" VerticalAlignment="Top" Width="75"/>
</Grid>

Re: Integration breaks existing rendering but renders Noesis elements just fine

Posted: 16 Jul 2020, 07:04
by PixelArtDragon
Well, nevermind. It looks like the "depth everywhere is zero" is a result of the depth mask not being re-enabled somewhere in my code after it gets disabled by the Noesis calls. It works now.

Re: Integration breaks existing rendering but renders Noesis elements just fine

Posted: 17 Jul 2020, 12:40
by jsantos
Great! Marking this as solved.