Wednesday, October 04, 2006

Back into the dark ages...

I've been experimenting with the OpenGL shadow extension. It can produce very nice shadows, and it is quite easy to implement.

I want to make it usable from QGL, which presents a problem. Speed.

I have to make multiple passes through my scenegraph to render a depth map from the POV of each light in the scene. Each extra pass QGL makes over the scenegraph is going to consume frames per second.

I've previously written a render visitor in Pyrex, which only provided a minimal speed increase. I think this is because the double dispatch pattern I'm using requires a couple of python function calls for each node that is rendered.

It seems that the only way to get around this is to move the entire scenegraph data structure into a C extension, providing an API to allocate and modify C structures from my Python code. This effectively means ditching the current QGL and writing a C render engine, which is not something I intended to do.

No comments:

Popular Posts