noizex
Topic Author
Posts: 11
Joined: 15 Apr 2019, 00:43

Order of rendering - am I missing something?

07 Aug 2019, 20:08

Hello,
I just recently integrated NoesisGUI into my engine, using custon OpenGL renderer which is pretty solid and works with GL4.6. I noticed that Noesis doesn't give much control over geometry at all, instead it sends full data to a mapped buffer (no control over how data is kept in memory) which is fine, as I was able to easily plug it into my ring buffers and it works fine. Then it issues draw calls via DrawBatch(). So far I only implemented simple two types of shaders - solid color and linear gradient. It works well, but today I got, I can say it, trolled by the gui, because on some runs I could only see the background gradient that I set, and sometimes I could see the other GUI elements. Here is how it looked:
gradient_only.PNG
then with other elements (animating and dependent on each other via ChangePropertyAction):
gradient_and_elements.PNG
I was not sure what's going on until I got an idea - I removed the background gradient and put a gradient filled rectangle and found out that from time to time the rectangle would appear in front of my other elements, despite it being "Send to back".
smaller_gradient_elements.PNG
I'm new to XAML and maybe I'm doing something wrong - right now it seems that this is random so sometimes it would appear above, sometimes below. I also noticed that SendToBack does not add any XAML property, so maybe it's just purely Blend-based functionality that has no meaning in how it's rendered? I see there is ZIndex property - should I be using this and if so, how does that split the rendering batches, because I assume that for geometry to be rendered on top of each other, this should be split into separate, ordered draw calls?

Worth noting: I'm not sure but I could not reproduce it for solid rectangle, only gradient-filled. Maybe I was just lucky as it seems random - sometimes it always covers, sometimes it's 50/50. But I never got the solid one to appear in front... Probably due to it being separate draw call from gradient and the ordering of the calls...

Thanks for help, I really like how Noesis looks so far, looking forward to implementing it fully :)
 
noizex
Topic Author
Posts: 11
Joined: 15 Apr 2019, 00:43

Re: Order of rendering - am I missing something?

07 Aug 2019, 20:11

Ok I played with ZIndex and it seems to have no effect - my rectangle sitting on -10 ZIndex still covers anything that's on default (0) one. This is weird.
 
noizex
Topic Author
Posts: 11
Joined: 15 Apr 2019, 00:43

Re: Order of rendering - am I missing something?

07 Aug 2019, 20:19

Ok, I think I found the issue - you can even delete this whole topic because it's not Noesis related. Seems like my UI render queue was mistakenly ordered, and because it was stable sort it was not varying frame by frame but it somehow was changing from app execution to exeuction. I'm now getting consistent results and no random change of order.
 
User avatar
jsantos
Site Admin
Posts: 3905
Joined: 20 Jan 2012, 17:18
Contact:

Re: Order of rendering - am I missing something?

08 Aug 2019, 12:35

Glad you solved it. Anyway, thanks for the time to write the post.

By the way, if you are integrating a new renderer it is really useful to use the XamlPlayer with the D3D11 renderer for example and use a frame debugger, like the one integrated in Visual Studio to visualize all the GPU calls that Noesis generates. Sometimes it is not obvious, for example when using opacity groups, what's going on under the hoods.
 
noizex
Topic Author
Posts: 11
Joined: 15 Apr 2019, 00:43

Re: Order of rendering - am I missing something?

08 Aug 2019, 19:35

Thanks, I will try this, though I'm using OpenGL so the calls will most likely be a bit different. I have one more problem, but I will make separate post - I hit a wall with this, and while I managed to implement all the shader permutations, paint modes - I can't wrap my head around font rendering :( The post is here: viewtopic.php?f=3&t=1782
 
User avatar
jsantos
Site Admin
Posts: 3905
Joined: 20 Jan 2012, 17:18
Contact:

Re: Order of rendering - am I missing something?

08 Aug 2019, 21:52

Thanks, I will try this, though I'm using OpenGL so the calls will most likely be a bit different
You can also launch XamlPlayer with OpenGL.
XamlPlayer --render GL

Who is online

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