Q: Threads, Shaders and more

I’m trying to build a python application for VJ’ing and I’m considering using Panda3d for the rendering, in that context I have a few questions.

  1. Threads
    Obviously I can’t ask the audience to close their eyes while I load new textures and objects, so I need to be able to load stuff live (and do some network stuff over OSC). Are there any reasons using threading with Panda couldn’t work?

  2. Shaders
    May be a bit offtopic here, but I can’t seem to figure out how Cg corresponds to the various shader versions (1.1,2,3) Is this a DirectX thing only and will Panda3d give access to all the shader features of my GPU through Cg?

Being able to change “scenes” without significant latency is rather important too.

The setup I’m going for is a dedicated box for rendering, controlled by a laptop (running the gui). All communication will go through Open Sound Control, which will also allow me to use other software for audioanalysis, etc.

Considering all of this, what do you think, would it be reasonable to use Panda3d for my project?

Your thoughts will be much appreciated :slight_smile:

The current version of Panda is single-threaded only. If you try to load a model in a separate thread, you may corrupt some data in your main thread. However, we are working on improving the thread support even now, and the next release will probably include an automatic background loader that takes full advantage of threads.

The shader version is not related to DirectX; there are different levels of shader versions supported by different kinds of hardware, and Cg can compile your code to the appropriate shader version more or less automatically. However, certain features of the language cannot be supported on some earlier shader versions, so if you want your shader to run on some earlier hardware, you have to be judicious in what language features you use. This is true of both OpenGL and DirectX. The exact nature of the language restrictions is all documented in the Cg manual provided by NVidia.

David

Very well, I’ll put off the choice of engine for some time and work on other stuff while I wait and see what you come up with regarding threads. Panda does seem worth the wait.

Thanks for your reply.

Ernst Hot

about the loading stuff. threading might not be necessary.

try to create a object of your choise with a fitting texture, convert the object into BAM and the texture into PNG format.
use the python time module to measure the loading time.

I’d say a normal pc should be able to load single models/textures fast enough to be almost not noticable for any audience (except with a fast moving camera).
same with a whole scene, load single models (not all at once) and build the new scene in the background should be possible.

testing is a good awnser. and provides good information.
i already loaded a model with 130000 triangles and a 512x512 texture in about 0.1 seconds (and i have a somwhat out-dated pc)
give it a try =) 1 model and about 10 lines of code… should be enough to know if you can do it the easy way.