» Back to Documentation

 

SPEEDING UP DYNAMICS (OFFLINE AND REALTIME)


Dynamics in Ornatrix are highly flexible and depend on a very large amount of factors. Therefore speed, precision , and desired effects can all be tweaked. There are a couple of things that are important to keep dynamics running fast and efficient.


1. Apply dynamics to guide strands, not dense hair.

Although Ox allows you to simulate any strand-based object, it is always a good idea to apply it to the 'backbone' of your hair structure. Simulating 100 strands and 10,000 strands can make a big difference in the computation time. Also, since hair is a volume-based entity, every strand doesn't deform on its own but rather with the volume of nearby hair and therefore simulating a small amount of guides can be sufficient to achieving a pleasant overall look for the dense hair.


2. If you are using collisions, try to specify low-res models as collision objects.

Same as with strands, detecting collision with 1000 faces and with 100,000 can make a world of difference. Normally most of your objects will be meshsmoothed at one point or another. It is a common practice to leave a meshsmooth modifier on and supply that object for collisions. However, you can significantly decrease simulation time by referencing a low-res non-meshsmoothed version of your objects and supplying them for collision detection.


3. Turn off any modifiers above the strand dynamics mod.

While computations are made, it could be nice to see the final result while the dynamics are being computed. However if you don't care about it, turning off all unnecessary modifiers above dynamics can speed up the process. Ornatrix starts at the bottom of the stack and evaluates it for every simulated frame. Since dynamics don't depend on anything above them in the stack, that becomes a waste of cpu time.


4. If possible, collapse the stack before applying dynamics.

As mentioned above, for every frame of computation the whole modifier stack gets re-evaluated (this is especially noticeable in real-time dynamics). Lets say your stack looks something like this:

Ox Hair from Guides
Ox Strand Dynamics
Noise
Ox Edit Guides
Ox Guides from Surface
----------------
Sphere01 (source mesh)

Every time dynamics are recomputed the process has to take Sphere01, extract guide root info from it, create guides, process the created guides with an edit guides modifier, change guides with a noise modifier, apply dynamics, and use simulated guides to generate hair. Now imagine that you have collapsed the stack and now it looks like this:

Ox Hair from Guides
Ox Strand Dynamics
----------------
Ox Baked Guides

The process becomes significantly faster. Now all that is being done becomes- guides are evaluated, dynamics are updated, and hair is generated. 6 steps become only 1 step without any loss of detail. Before collapsing the stack ensure that you don't depend on any parameters that change guides.


 
Comments
 

Collapsing the stack down to Ox Baked Guides, geds rid of the skin wrap modifier that connects the hairs to the animated geometry. Also turning off all modifiers above the Ox Dynamics and simulating I get this error 

nvpx.SetSimulationState(gPxSimulationPreparing) Its in the fn PxForceCreatePhysXScene block of code.

Once I get this error, I have to restart max cause I can not get it to simulate anything after that. Some times even restart the computer. I have searched the internet to find out what causes this error and I got nothing. Any help on this will be greatlly apreciated. 

Hi,

I have tried to reproduce this error but it seems to be working well here, I'm using Max 2016.

Jeordanis Figuereo (Product Designer. EPHERE Inc.)