PDA

View Full Version : Multithread transformation-deformation plugins?



Dennik
05-07-2011, 09:19 PM
I've recently hit a wall with Lightwave trying to add too many motion nodes, or displacement plugins on over 100 objects at once. The more I added the more the scene was crawling. I've noticed that only one core of my 8 cores was working which was just a shame.
I understand its hard to program for multithreading, but I wonder if it was possible to just split the task per number of plugin instances.
Does the SDK allow multithreading? Could it be done this way?
This has caused me tremendous problems with my current project.
I wish so much that multithreading was possible.

nickdigital
05-07-2011, 09:30 PM
This doesn't answer your question but what about baking your deformations to a mdd file.

vfxwizard
05-08-2011, 12:20 AM
Yes, it is possible. Multithreading for displacements was introduced in 9.x or maybe in 10, I can't remember exactly.

Check out Threaded Mesh Eval in Layout's preferences, but don't expect miracles. Optimized threaded displacements are a feature of LW 10.1.

Hope this helps!

evenflcw
05-08-2011, 07:23 AM
The SDK provides classes for multithreading, but you can only perform calculations in those threads. Anything that alters LWs state has to be done in LWs main thread.

"Multithreading for displacement", to my knowledge, is just for bone deformation and maybe to some degree the morph mixer (summing up the displacements per points). It is far from a system wide support. The SDK interface for displacement plugins wasn't built with multithreading in mind and it hasn't been updated either to indicate otherwise. LWs animation architecture remains as naive as always. So no, there is no multithreading support for general displacement, just for bone deformation. Prove me wrong, please.

In general LW evaluates in a predetermined linear order. One item at a time. One thing (motion/displacement etc) at a time. And there is no skipping that queue or multiple queues. LW might reorder or evaluate twice based on some flags but other than that...

As such, all pure calculations nodes could certainly be multithreaded as they don't need access to LW internals (only accessible from main thread). Developers could multithread (some calculations) in individual nodes, but we would be much better of if it was in there to begin with.

vfxwizard
05-09-2011, 02:07 AM
So no, there is no multithreading support for general displacement, just for bone deformation. Prove me wrong, please.


Activating threaded mesh evaluation in LW 10 I was only able to measure and perceive a slight improvement (approx 20%) with bone deformations. I wasn't able to perceive any change with displacement maps nor nodal displacements. Performance wise, I don't consider threaded mesh evaluation in LW 10 a significant improvement.


LW 10.1 can't be discussed outside the beta section, but I think I can say that 10.1 is different, and that I'm quite happy with it. Hence, my previous post. :)