tiistai 21. joulukuuta 2010

Using threads in Blender game engine

I just made an experiment of using threads in Blender's game engine. Even though using threads in Python does not necessarily make code any faster (see GIL), in this case using thread(s) has a really big difference.

AFAIK, rendering and execution of python scripts are running sequential in BGE. This is a bad thing if you have to make some heavy lifting in the script. Whole game engine have to wait until the job is done ruining your FPS. By using threads, the heavy lifting can be done parallel (or at least semiparallel) to main rendering loop.

The script can be found from Blenderartists.

Ei kommentteja:

Lähetä kommentti