Help with Integrate external GUI in to Panda3D (NoesisGUI) (C++)


#21

I tested, but works only gl-version 3 without 2. No difference.

I created new apitrace file, if it help.
Panda and Noesis2B.7z (2.0 MB)


#22

I wrote problem on Noesis forum, and creator of Noesis post me difference in OpenGL renderer for Noesis. Maybe it help you detect where is problem. Please look at last post from jsantos.

or here is direct link
https://gist.githubusercontent.com/jesusdesantos/4af77aaaa583fff4bf7ed8f55018d331/raw/db6559d02a56229c5d3259cf661a7473899556ef/gistfile1.txt


#23

Well, the apitrace output isn’t really helpful, since Noesis isn’t actually drawing anything in it. If we could find out why Noesis isn’t working under apitrace, that would help with debugging this.

I also can’t really find any obvious changes from the diff. It looks like there are some changes to how vertex buffers are bound (which isn’t obviously related as the problem seems more to do with textures or blending), and some changes to Noesis’ own texture formats, which shouldn’t affect Panda.

Just to make sure, do you have the latest revision of Panda3D?


#24

I have Panda3D-SDK-1.10.0pre-3f91615 version, from SDK uploaded in 2018-11-22T23:23:52Z

I discover there are new uploads, I’ll try test it today in late evening.


#25

I tested latest build, unfortunately it not fix problem.
Maybe new Noesis call something from openGL 3.2+ ?

Will be helpfull when I upload my project and you can look at it what I did?

Btw. sometimes when I run sample, it render grass but some background texture on bilboards (the hills) are black.

And I created video, where you can see, when I resize it to more wide, on screen centre it renders ok, but on left and right it render not ok, it looks like “fog” or something that. As I resize screen back to normal, the grass going slowly back to black.


#26

And I forgot mention that if I add only DisplayRegion without adding it to new scene, it doesn’t make difference, and it is same (I use it in video), but then I got new error in console

Assertion failed: !mat.is_nan() at line 318 of c:\buildslave\sdk-windows-i386\build\panda\src\pgraph\transformState.cxx
Assertion failed: has_mat() at line 461 of c:\buildslave\sdk-windows-i386\build\built\include\transformState.I
Assertion failed: has_mat() at line 461 of c:\buildslave\sdk-windows-i386\build\built\include\transformState.I
Assertion failed: has_mat() at line 461 of c:\buildslave\sdk-windows-i386\build\built\include\transformState.I

Maybe it help.


#27

You should try setting

gl-debug true

in Config.prc and see if you get more useful diagnostics about that error message printed on the console.

If you can’t figure it out, please upload your project in a way I can easily run it.


#28

If I enable it I got this
:display:gsg:glgsg(warning): gl-debug enabled, but NOT supported.

and one more thing, when I run sample, this is what I get:

Known pipe types:
  wglGraphicsPipe
(all display modules loaded.)

I am not sure if wgl is same as OpenGl. wgl looks like Panda3D running in WebGl, or it is same?

I’ll prepare project.


#29

I uploaded project, here is link
https://www.dropbox.com/s/dlynh8oxira8el7/Panda%203D%20Tutorials.7z?dl=1

you can run project without building (is compiled), if you want compile project yourself there are instructions inside “Panda and Noesis Main.cpp” file.

And for reference there is Noesis project for reference how it should be done, and I use Rocket DisplayRegion class as reference inside Panda3D.


#30

I found problem what cause problem!

m_NS_IView->SetIsPPAAEnabled(true);

When I set it to false, Panda3D is rendered correctly without any black object.

EDIT: And I forgot mention, if I turn SetIsPPAEnabled in to false, all errors disappear from console.


#31

This is what I got from Noesis creator what Noesis do if SetIsPPAAEnabled = true

For PPAA we use alpha blending. Could it be that this state is not properly restored when rendering with Panda3D? Is there a way in Panda to save and restore the GL state?


#32

Panda tries its best to restore GL state, but this is tricky to get completely right because of the way OpenGL works. If by “alpha blending” the Noesis author means glBlendFunc we almost certainly are restoring that; given that Noesis isn’t working right under apitrace for you, perhaps the Noesis people could tell us which OpenGL calls they are making when SetIsPPAAEnabled is set?


#33

I got this answer:

All GL state changes happen between BeginRender and EndRender , but those functions call more functions so you need to inspect all GLRenderDevice implementation to track issues. Another option would be implementing a new RenderDevice using Panda3D renderer.

Regarding SetIsPPAAEnabled , that function does not belong to the renderer and it doesn’t make changes to GL. When that flag is enabled, extra geometry is generated to enable cheap antialiasing. That extra geometry is rendered with alpha blending enabled. But that’s not the only path using alpha blending. Just a transparent rectangle should reproduce the same issue, if this is related to alpha blending at all.