## Recommended Posts

Samurai Jack    455
Greetings! I was wondering, has anyone implemented a multi thread scene graph? I was thinking about a thread that would transverse and cull out invisible objects, and a thread that would blend me bone matrices or compute node positions in space. But that seems not reasonable for me, why would i compute sekletal animation frame (all bones of a single character) if the character isn't visible? Okay, maybe for collision, but invisible object might not need souch precise collision. But at time of computing bones, you might not yet know whenever you are visible or not. Any suggestions on this guys? Something about Hyperthreads or Multi core processors: I checked out "Cinebench" on a Pentium P4 3,2 HT and got more than 30% speed up on rendering - two threads were rendering half a screen. Are there any good tips/tutorials on multi thread programing? Thank you in advance!

##### Share on other sites
eq    654
Maybe I misunderstand what you're after, but one way is to do something like this:
Thread 0 -- Processing scene-graphStart/resume thread 1while node != end  if node is a visible skeleton hierarchy node, add the node to the list of skeleton nodes.  process child nodes (if your bone hierarchy is made up by scene graph nodes, skip this step for skeleton hierarchy nodes).while skeleton node list isn't empty  process first node in found in the skeleton node list  remove node from skeleton node list.Stop/pause thread 1Thread 1 -- Processing hierarchiesloop  if list of skeleton nodes is empty, goto loop  process first node in found in the skeleton node list  remove node from skeleton node list.  goto loop