Code-Highlight

Thursday 29 March 2012

#some research on parallel opengl

After finishing the basic classes for an ingame-GUI-system, I started looking at how I want to multi-thread my program. In general with older OpenGL specifications, it is not easily possible to parallelise the drawing process, but there are certain things, that can be done.
The OpenGL context is bound to a single thread, so the context is inaccessible for other threads, but it is possible to access data at the same time, if for example VBO-data is mapped, this data can be accessed from other threads (useful for optimising CPU-side skinning). Another possibility is to create another context and let the contexts share ressources.
Anyway in the end the best thing is to simply have a drawing thread and handle all the other stuff (like physics, networking etc.) in other threads, so the drawing thread is simply drawing the last state, while the other threads are calculating the next state of the game.

#Parallel OpenGL FAQ
#Intel: Designing the Framework of a Parallel Game Engine