Flex Settings Helper 

 

Summary 

Lucid uses NVidia Flex libraries to drive its simulations. Flex defines many of its properties as global settings that apply to all simulated objects and particle systems. Some parameters like density as well as structural properties can be specified on object, or even sub-object level, and the rest are specified globally.

Lucid exposes all of the global Flex settings in a 3dsmax helper object present inside each scene. If the helper object is never created default settings will be used instead. Detailed information about various parameters and settings can be found in Flex manual.

 

Inline help 

If you hover over most of these parameters a tool-tip will appear giving you more information about that particular parameter. This is a great way to learn more about each Lucid setting on the spot.

 

Creating Flex settings helper 

There are three ways to modify global Flex settings:
  1. Use the Lucid toolbar Select global Flex settings button. If the helper already exists in the scene it will be selected instead for convenience.
  2. Use 3dsmax Create panel Helpers, Lucid category and click the Flex Settings button to create the helper manually.
  3. Use LucidFlexSettings() MaxScript function in the listener or your custom script.
 

Flex Settings 

 

Display 

 

Show Simulation Stats 

Turn this option on to display information about internal state of the simulation in the corner of the viewport. The information will only be displayed when the simulation is active.

  • First line of statistics shows the name of the video card used at the current CUDA device inside the simulation.
  • Memory line displays the video card RAM (VRAM) memory currently used and the amount of total memory available of the video card.
  • Particles line displays the total number of particles currently inside the simulation. This number includes any foam particles as well as rigid and soft bodies.


Show simulation stats option @4:50

 

Show Viewport Icon 

When this option is on a selectable 3d icon will be displayed inside the viewport to represent the current Flex settings helper.

 

Scale 

 

Resolution 

When Particle Radius parameter is 0 the value of this parameter will be used to automatically set particle radius based on the scale of currently simulated scene objects. Typically, the first object inside the simulation will be measured and its volume is divided by the value of Resolution to get the particle radius. Therefore, the bigger the resolution the smaller will be the particle radius.

For objects which are voxelized during particle generation, such as fluid volumes, rigids, and soft-bodies, the particle size also determines the number of particles generated for the object. Particles are generated to tightly fit together. Therefore, bigger Resolution values will result in more particles in the scene for these objects.

 

Particle Radius 

If this value is 0, Resolution parameter is used to automatically determine particle radius from scene scale. However, setting this parameter to a non-zero value allows you to manually control simulated particle radius. All particles in Lucid simulation have the same radius and this value globally controls this value.

Use larger radius values to simplify, speed up, and improve stability of the simulation at the expense of fewer details. Use smaller values to improve simulation detail at the expense of overall speed.

 

Collisions 

 

Solid Rest % 

This value sets the percentage of particle radius which will be used as a buffer for determining collisions between particles in rigid body (non-fluid) objects. For example, a value of 10% and particle radius of 1 will mean that all particles will not be allowed closer than 0.1 unit to any rigid and soft body in the scene.

 

Fluid Rest % 

Similar to Solid Rest parameter, this value determines the percentage of particle radius that any two fluid particles are allowed to be near to one another. It is important that this value is sufficiently high to ensure simulation stability.

 

Dist. to Shapes % 

Similar to Solid Rest parameter, this value determines the percentage of particle radius that any particle is allowed to be to any collision objects. Increase this value to improve simulation stability. If you reduce this value too much you can risk tunneling effects where particles can penetrate collision objects.

 

Near Particles % 

Increases the radius used during neighbor finding, this is useful if particles are expected to move significantly during a single step to ensure contacts aren't missed on subsequent iterations.

 

Near Shapes % 

Same as Near Particles % parameters but the margin is applied to collision objects instead of particles.

 

Simulation 

 

Sub-Steps 

Determines the number of simulation steps to compute for each frame in the scene. A bigger value here will improve simulation stability and collision results. It can also help remove any tunneling effects of particles. More sub-steps also mean that the overall simulation performance will be slower.

 

Iterations 

Specifies the number of times the scene is evolved at each simulation step. Increasing this value can improve simulation stability.

 

Maximum Particles 

Sets the manual hard limit for the number of allowed particles in the scene. NVidia Flex can cause a video driver crash or reset if it runs out of memory when too many particles are generated. This may depend on your video card and memory size. Therefore, this value acts as a fail-safe to prevent such errors before they happen. If number of particles generated in a simulation exceeds this limit the simulation will stop. Increase this value at your own risk and discretion.

 

Maximum Particle Velocity 

 

Automatic Maximum Particle Velocity 

To improve simulation stability Lucid can limit the maximum speed of particles in the scene. This ensures that any particles undergoing extreme forces will not undermine precision of the simulation. If this option is on the maximum speed at which particles are allowed to travel will be determined on the scene scale and frame sub-step values.

 

Maximum Particle Velocity Speed 

If Automatic Max. Particle Velocity option is off this value will be used to set the maximum speed at which particles are allowed to travel in the scene. Increase this value to make the simulation less bounded at the expense of added instability risks.

 

Meshing 

 

Anisotropy Scale 

Due to particle motion having a direction Lucid can improve meshing by storing information about the particle movement during simulation. This extra information provides better resulting particle mesh. This option controls how much anisotropy is present in resulting ellipsoids for rendering, if zero then anisotropy will not be calculated.

 

Minimum and Maximum Anisotropy 

Clamp the anisotropy scale to this fraction of the radius

 

Smoothing 

Control the strength of Laplacian smoothing in particles for rendering, if zero then smoothed positions will not be calculated.

 

Flex Forces 

These set of parameters determine the intrinsic forces between particles and their environment in the simulation.

 

Forces 

Specifies default gravity and wind forces. If you wish to add more custom forces see the documentation on adding forces.

 

Gravity 

A default gravity force is applied to all particles. You can change the direction and strength of this default gravity using this parameter. Setting it to 0 will remove the default gravity.

 

Wind 

A wind force can be applied to all particles. You can change the direction and strength of this default wind using this parameter. Setting it to 0 will remove the wind.

 

Physics 

 

Dynamic Friction 

Coefficient of friction used when colliding against shapes. Dynamic friction slows down particles while they are moving against a surface of an object.

 

Static Friction 

Coefficient of static friction used when colliding against shapes. Static friction tries to prevent movement of particles when they are still against a surface of an object.

 

Particle Friction 

Coefficient of friction used when colliding particles.

 

Adhesion 

Controls how strongly particles stick to surfaces they hit, default 0.0.

 

Cohesion 

Control how strongly particles hold each other together, default: 0.025

 

Viscosity 

Smoothes particle velocities using XSPH viscosity.

 

Drag 

Drag force applied to particles belonging to dynamic triangles, proportional to velocity^2*area in the negative velocity direction.

 

Lift 

Lift force applied to particles belonging to dynamic triangles, proportional to velocity^2*area in the direction perpendicular to velocity and (if possible), parallel to the plane normal.

 

Plastic Threshold 

Particles belonging to rigid shapes that move with a position delta magnitude > threshold will be permanently deformed in the rest pose.


Using Plastic Threshold and Plastic Creep parameters to simulate denting (Begin at 6:40)
 

Plastic Creep 

Controls the rate at which particles in the rest pose are deformed for particles passing the deformation threshold.

 

Sleep threshold 

Particles with a velocity magnitude less than this threshold will be considered fixed.