This is not a proposed patch to panda, as its a monster in disguise…its a proof of concept with the intent to write a patch capable of being included
Currently, the hack/patch, enables using a QT window/surface as Panda’s main render window, and using QT OpenGL context as Panda’s context. Technically any apps context could be used, pyglet for example.
It works for me on arch linux(kde/gnome), mint/ubuntu and windows. Can’t check mac.
The example shows geom shaders and tessellation shaders, but I have also generated a texture with a compute shader to test that, although this is not so useful yet in panda.
Will explain the two patches later in post. My arch linux based patch is supplied.
I will do a file diff patch later for your convenience.
<<file uri: 10archfetchpanda.sh>>
<<file uri: 20archpandapatch1.sh>>
<<file uri: 25archpandapatch2.sh>>
<<file uri: 30archpandabuild.sh>>
The butchered qt/c++ sean harmer demo, that I have rewritten in panda3d to test this is just here for a proof of concept. Not sure what the distribution rights are LGPL I think…but dont hold me to that please: ) Just use it to see it in action.
<>
To avoid gotchya’s if you try the butchered SeanHarmer demo supplied you need qt5.1+ opengl version (not angle), pyqt or pyside in your panda python folder…just use pip or easy_install.
This example is just his code, rewritten in python/panda3d with his GL subroutines replaced by individual shaders as subroutines in shaders dont compile in panda at present. I should have done this by now, as I hacked the whole shader code to get compute shaders in lol
This will show Panda3d using tessellation shaders
One very big gotchya is you have to use a GL backward compatibility profile, as new core opengl contexts dont have transforms and stuff. Don’t use core profiles!
You can see I use the 4.3 compatibility context for the butchered demo. Please note the QT debug contexts also work if you need precise timings See timing queries in QT…
Obviously some things in Panda will break when sharing a more advanced context.
What i’ve found is if your panda geom auto-generates shaders, or you supply them, when its displayed they will work fine… where as if you use some of the old multipass?! stuff, they will crash to desktop.
To be honest all nodes should be using some sort of shader if you are planning to use new opengl from what I understand.
Why QT… no reason other than im lazy, it loads all OpenGL functions for use and all events work seamlessly between panda and QT. Pyglet will work too if you use my proposals.