After a long search amoung different engines (Irrlicht, Ogre, etc…) I finally decided to start my project with panda3D, since it best combines simplicity, reliability and speed. I think the fact it also has libraries for collisions and interface ready to use is so time saving and intuitive. Plus, python is my favourite programming language. ^^
But then, here’s my question. Messing around with panda, I noticed that when I tried to switch to pandadx8 from pandagl, all the demos which make use of shaders stopped working. I tried to change it to pandadx9 (since i think I have DirectX 9 installed) but with no results. I personally prefer to work with OpenGL rather than DirectX, so it’s not a big problem, but does that mean that shaders are not supported by panda on DirectX? Or there’s a way to solve this issue?
Thanks in advance! ^^
Panda’s DX8 doesn’t support shaders, I believe, while panda’s DX9 does. I’ve heard about some issues with buffers in dx though - I’ll look into the problem soon. But since a lot of people use OpenGL, I guess it never had a high priority.
Microsoft added support for high-level shaders beginning in DirectX9, so in DirectX8 it is not possible to use shaders in the modern sense at all. This is (mostly) why shaders do not work in DirectX8.
Panda’s DirectX9 layer contains the same robust shader support that its OpenGL layer contains. So, I don’t know why your DirectX9 attempt did not work. Are you sure it successfully loaded DirectX9? If your runtime is not up-to-date, it may fail to load DirectX9, and load DirectX8 instead (you will see error messages on the console indicating this has happened). Try downloading the latest DirectX runtime from Microsoft using e.g. dxwebsetup.exe.
Thanks for the fast reply!
I noticed that using pandadx9, demos with advanced shaders do actually work. The problem comes with the demos which make use of the shader generator, in some of them panda notifies that the driver can’t handle the shaders and others (automatic glow) manage to run but look very weird.
So I think the issue comes from the shader generator itself. Maybe it’s because it generates shaders in GLSL or only supported by OpenGL?
Nope, it generates Cg shaders, which should work fine with DX9.
The fact that you get an error saying the driver can’t handle it indicates that something went wrong setting up a buffer. Either there’s a bug, or the shader generator requests a config that the GPU can’t provide.
Hmm, you’re right, there might be some issues with the ShaderGenerator in conjunction with DirectX. And in fact, when I try it myself, I see that it is true. (Though whatever the problem is, it’s not a language issue, because as pro-rsoft points out, Cg is the language used, which is independent of OpenGL and DirectX.)
The team that originally developed the ShaderGenerator was concerned only with OpenGL support, so it doesn’t surprise me if they didn’t get a chance to make sure it also worked under DirectX. However, the ShaderGenerator should still be considered a work-in-progress; presumably these deficiencies will be corrected eventually.
I see. In the meantime I will keep using OpenGL