» Back to Documentation

 

DYNAMICS


 

MassFX Dynamics

 

Ornatrix 2.0 Dynamics for 3ds max 2013 and above uses the integrated MassFX dynamics system that is built into 3ds max. This allows for a powerful dynamic simulation that uses the tools you already know from 3ds max. To simulate Ornatrix hair just add the OX Dynamics modifier above your guides and press the MassFX play/simulate button in 3ds max. 

Ornatrix employs a sophisticated physics that simulates many of the real-world properties encountered with hair and stranded structures. The dynamics integration in Ox is done in such a way that the user is only directly concerned with parameters that have an effect on how hair behaves. While it is impractical to simulate every single hair strand in a dense structure due to the large number of strands it is possible to run dynamics on guide level, thus limiting the total number of world parameters greatly. Every guide represents a volume of nearby hairs so the overall look is pleasing and with a proper setup can be very close to real-world dense hair behavior.


[ A braid untangles itself using mutual collisions and gravity ]

Because we are dealing with a physical simulation, the user must try to specify the best parameters for each simulation. Although a wide variety of parameters can be used to represent a vast range of hair types and styles, a simulation can easily become unstable due to a faulty setup. For example, none of the objects in real world can have an mass of 0, or be in two places at once. Simulator stability would probably be the number one problem with animating hair, and here is some information to help you avoid it.


[ External sphere object collides with simulated hair, causing a volumetric disturbance response ]


PREVENTING SIMULATOR INSTABILITY:

1. User error

As mentioned above, it is possible to make the simulator unstable simply by providing extreme or innacurate parameters. The scale of the objects also plays a great role. Something 2 cm, and 2 km long behaves very differently, even if all the other parameters are scaled proportionally. It is recommended to have all hair and collision objects to be scaled at 1.0-100.0 scale to avoid numerical errors, and to provide realistic 'world' scale.

2. Numerical error

Ornatrix, much like the rest of 3dsmax uses floating point format to represent real numbers. Since floating point only takes 4 bytes, its numerical error grows very fast and can easily start affecting the simulation if you use extreme values. As mentioned above, correct scale for objects and forces ensures that numerical instability is kept to the minimum.

3. Integration error

Like all the other physics engines, Ornatrix uses a numerical integrator to simulate how the world changes step by step. In real world these steps are infinitely small and thus there are no singularities or errors (well except maybe black holes). However in computer world we are forced to take finite steps. The size of each step directly influences how accurately the simulator changed the world. Therefore taking small steps makes the simulation more accurate but is slower than taking big steps. For different types of simulations the step size may vary. Sometimes big steps are sufficient, however other times the simulation can 'explode' unless you decrease the size of each step.

4. Constraint/Memory error

In ornatrix all the relationships between objects (hair and external objects), as well as actual strands are governed by constraints. Constraints make strands stick together, and the prevent then from going into objects. A special solver has to be used to solve all of these constraints in one go. When the world is complex the number of constraints can grow exponentially and when the time comes to solve them there might simply not be enough memory to hold them. Fortunately you can control the amount of memory allocated by Ornatrix so that any complex scene is solved, but it is up to you to decide these parameters.


Parameters:

Differential Solver (Integrator):

* Constraint solver
This is the solver used for solving world constraints. There are two variations of constraints available. In most cases you only need to use LCP Reduced solver. This solver requires much less memory than LCP Implicit and on average performs faster than the accurate solver. Only use the non-reduced solver when you don't have any collisions and you must have a completely accurate simulation model.

* Steps per frame
Number of simulation steps taken during every frame, or every refresh (when doing real-time preview). Note that taking 2 steps with 0.5 step size is equivalent to taking two consecutive steps of 0.05 size. Therefore if you would like your step size to remain constant and simply want more steps per frame all you have to do is multiply the step size by number of steps per frame. For example, if you want 8 steps per frame each at 0.05 step size you set the steps parameter to 8 and step size parameter to 0.4. This is useful when you want to speed up the hair animation while retaining precision.

* Iterations
When using reduced solver this parameter adds additional control over the precision of simulation. Number of iterations relationship to simulation time is inverse square meaning that setting a higher number doesn't mean that simulation will slow down linearly. Usually 20-40 iterations are sufficient.

* Stack size
As mentioned previously, Ox solves all of its constraints at once. When there are too many collisions (mutual or external) there are a lot of constraints. Ox needs enough space to store them and with this parameter you allocate the space that Ox is allowed to use. If there isn't enough space you will get a simulation error. 10 MB is usually enough, but just in case you run out you should know about this parameter.

* Timeout
Whenever an error occurs in simulation Ornatrix simulator 'freezes'. Using this parameter you can set how long does Ox wait before it considers that an error has occurred. If, during a simulation, you feel that its not going anywhere you have to wait until the timeout elapses at which point you can resume your work. Default value is 15 but if your scene computes relatively fast 1-5 seconds will also do.


Simulation Control:

* Compute simulation
Use this option to start computing a 'hard' simulation. All of the changes to the hair will be keyed and committed within the specified time interval.

* Real-time preview
Sometimes it is convenient to have a fiddle with your hair interactively before you do actual simulation. This option uses all of the exact same procedures that actual simulator does but instead of keying changes it simply updates the viewport. You can interact by moving your objects manually or scrolling through the time slider. All of the parameters can be adjusted and previewed in real-time. If the guides below in the stack are edited the simulation will automatically restart. The system performs much faster when it doesn't need to check for collisions. Therefore turning off all collisions (external, mutual, per-strand) will result in a speed increase.

* Start time
Controls which frame the simulation is started at. Should always be greater than end time parameter.

* End time
Controls which frame the simulation is ended at. Should always be less than start time parameter.

* Key step
Controls how many frames are passed without encountering a keyframe. 1 meaning that hair is keyframed every hair. 2 means that hair is keyframed every 2'nd frame, and so on.

* Start segment
This tells the simulator which segment from root in every strand should be the first in the strand chain. When the hair is attached to a surface, for example, simulating the very first (root) segment will result in constant collision of that segment with the surface. Setting this parameter to 1 will skip the first segment of every strand and will start simulating from 2 segment(s) thus preventing any collision trouble.


Physical Properties:

* Global scale
Not currently implemented

* Mass
Controls the mass/weight of every strand of hair.

Internal forces:

* Damping
This is analogous to air (medium) friction. Any velocity that a strand has is simply 'dragged' or pushed in opposite direction with a force to stop it eventually.

* Flexibility
This controls how much each strand is allowed to bend from its original shape. For example, if a strand was in a form of a curl (spiral) before simulation and flexibility is low then the hair will always try to preserve its curly state despite the forces acting on it. This in effect introduces the springiness into the hair. A value of 0 should not be used at it might make simulation unstable.

External Forces:

* Gravity
Sets a global force in -Z direction with a specified magnitude. This force is to resemble Earth's gravitational pull.

* Multiplier
Whenever using external Max's forcefields (spacewarps) this parameter will act as a global multiplier for every such force.

Mutual Forces:

* Auto-generate wisps
When this option is on Ox will look at the relative positions of strands to each other and determine the optimal/biggest wisp radii such that no two guides collide initially at the root. The use of this option is not always recommended as it might introduce instability in some cases (for example when tips of two guides are closer than their roots).

* Global wisp radius
When above option is off this parameter sets the global wisp radii manually. Using very small radius for a wisp isn't a good idea since it might introduce spatial errors.

* Wisp scale
This is simply a multiplier for above two parameters so they can be scaled down from their original values.

* Use strand self-collision
If option is on every strand will collide with itself as well as other strands. This is sometimes necessary when simulating chains or hair tied into knots.

* Segment skip step
If above option is on this one prevents two consecutive segments to collide with each other.

* Use mutual collisions
Use this option when you want hairs to collide with each other. This is necessary to make each guide simulate a volume of strands around it. This option will prevent wisps from coming too close to each other, yet it will not introduce any forces to make them 'stick'.

* Orientation dependent
Not implemented (yet)

* Softness
Whenever strands collide this parameter sets how soft the wisps are. Softer wisps will stop gradually, while hard ones are stopped right away. Using softer wisps can prevent instability as well as provide more realistic results.

* Bounce
When two wisps collide this parameter controls how fast (if at all) they bounce away from each other. This is analogous to the coefficient of restitution.

* Friction
If this parameter is 0 then wisps will slide freely when they collide. If it is more than 999 then any sliding is prohibited. Anything in between controls how much friction is introduced between hair wisps.


Collision Surfaces:

* Use collision response
If on then hair will be tested for collisions against externally specified objects.

* Use collision primitives
Internal dynamics system used by Ox can perform collisions much faster with parametric primitives such as spheres, boxes, capsules, etc. When this option is on Ox will see if the object specified is a Max sphere or a box and automatically convert them to the internal representation of same primitive thus improving collision tests.

* Surface friction
If this parameter is 0 then colliding hairs will slide freely along the surface that they collide with. If it is more than 999 then any sliding is prohibited. Anything in between controls how much friction is introduced by each surface. If you are using surface velocity then this parameter must be above 0 to let surface 'grip' on the hairs.

* Surface bounce
When hairs and a surface collide this parameter controls how fast (if at all) the hairs bounce away from the surface. This is analogous to the coefficient of restitution. A value of 1 introduces an reverse-inertial bounce, while a value of 0 swallows any energy the hair had when going towards the object.

* Minimum bounce velocity
This extra parameter lets you control how fast the hair has to be moving towards the surface for bouncing to occur.

* Surface softness
Controls how soft/hard surfaces are. A value of 0 will stop the hair right away to prevent inter-penetration. Higher values will let hair pass into the object a little before stopping it. Using a non-zero value is a good idea to prevent instabilities.

* Surface velocity (U,V)
This extra parameter lets you specify how fast the surface itself is moving along its tangential direction. For example, if a hair falls onto a stream of water that is moving quickly then the hair is dragged along with the water since water surface is moving. Note that for this parameter to take effect you have to specify a non-zero friction.


 

 
Comments
 

i've had ornatrix for years but have never been able to get the dynamics to work "have you installed the phys engine?" error msg after I installed it many times. Now it just crashes max 2013. It seems like it would be a great product if it worked.

mhouse777 wrote:

i've had ornatrix for years but have never been able to get the dynamics to work "have you installed the phys engine?" error msg after I installed it many times. Now it just crashes max 2013. It seems like it would be a great product if it worked.

Hello,

The new MassFX dynamics should solve this issue because it uses what 3ds max has installed for MassFX. No other PhysX engines or plugins need to be or should be installed. This way there is not miss match with other plugins or the system PhysX. If you are having a crash with 2013 please let us know the steps to reproduce it and we will look at it ASAP.

Thanks

Michael

Me too cannot achieve to make masffx dynamics work with ornatrix hair.

A simple tutorial or a sample scene would be so nice.