nHair Iterations attribute?


#1

The Maya 2014 documentation makes repeated reference to an Iterations attribute for nHair. I am unable to find such an attribute in the hairSystemShape node.

Am I missing something here? It seems that nCloth has much finer control over the simulation quality than nHair does. What is the workflow for improving nHair simulation accuracy? I see the Max Self Collide Iterations attribute, but I am trying to improve the sim quality for the entire nHair system. Adjusting the nucleus node Substeps attribute is not helping.

I have a feeling that this mystery Iterations attribute exists for classic hair, but was mysteriously removed for nHair, and the docs were not properly updated.

Any help, even a confirmation that the situation is hopeless, would be appreciated.

Thank you,

Aaron


#2

What I have found so far with my workflow in nCloth is the main quality points - other than a good set up of the mesh objects - are the collision flags, which also affect the trapped options, the trapped check and self trapped check, push out value and most important the nucleus solver settings.

The iterations settings are perhaps a deceiving title. From my understanding those are clamp values not a progressive increase of quality.

Max Iterations Specifies the maximum number of iterations per simulation step for the current nCloth objectÂ’s dynamic properties (for example, Stretch Resistance and Bend Resistance). Max Iterations clamps the number of iterations to prevent high level property values or a large number of substeps from locking up the nCloth.

                      An  iteration is a single computation of a single nCloth property by the  Maya Nucleus solver. There are many iterations for                         each dynamic property value per step. The number  of iterations for each dynamic property is automatically set by their  current                         values. Higher dynamic property values generate  larger numbers of iterations.                       

I was not around for classic hair so I am not sure about what it was called if it was substeps or iterations. But I have seen iterations in other apps named so to indicate the same things as sub steps.

Since iterations in this case is a “negative” property, not having the option would mean no clamp on the quality setting rather than the other way around.

For nHair I have found the nucleus solver to have a very small amount of effect on quality issues. I have solved most issues with the settings of the nHair. For instance changing the collision flag to edge among other things.

And in my case had quite a bit of difficulty getting the hair not to stretch. In the docs it said a higher substep value would perhaps help this. And this may be so but I have found that that in conjunction with the stretch value was the only thing what worked. Seems logical. lol

But there was also an issue I had with the hair just dancing all over the place and I was not having any luck at all. My only solution was to apply a small amount of damp value to it. In my case .2 was a nice amount to keep the hair flowing and yet not squirming all over the place which just looked like a quality issue.

There are some setup issues that I also found were the source of some problems. Mainly making the scalp a collision object. This can cause the hair to pop up and keep dancing around. I suspected this was because it was colliding directly with itself as I have seen this in cloth. And the solution seems to be to use another object for collision.

Not sure if any of this will help in your situation but this is my experience so far.

If you describe your problem in detail maybe someone can give you some pointers on a solution.


#3

Thanks for your reply.

My confusion comes from the fact that the documentation repeatedly refers to Iterations for nHair, but apparently the docs are in error.

I am aware of the function of the Iterations attribute for nCloth. It’s a limiting factor and prevents excessive calculations at high values for Stretch Resistance, etc.

I would like to have the same control for nHair. Increase Stretch Resistance to a high value, but clamp the maximum number of iterations for better interactive performance. It seems that the Stretch Resistance must be set to a very high value, at least 50 or more, but the default is only 5. This seems true for scenes built at unity scale, as all of mine are. But high dynamic properties values result in poor viewport performance. nCloth has an elegant solution for this by clamping the maximum iterations for all attributes globally. Dynamic properties converge on a “good enough” solution without incurring massive calculation overhead.

Aaron


#4

Sorry the wording of your first post seemed to indicate you were looking for simulation quality/accuracy not view port performance with accuracy. Though I am tracking with you now, I can not offer a solution other than the ones you probably already know about.

But just the same it sheds some light on some things I did not have a good handle on so thanks.:slight_smile:


#5

I believe the nucleus Max Iterations is the same for nHair as it is after all now in the nucleus family.

I am sure Duncan can give you an answer…


#6

There is no Max Iterations (or Iterations) attribute for nHair. That’s my whole point. Max Iterations for nCloth is a global setting per nClothShape node, it’s found in the Quality Settings section. It limits the number of calculations for Stretch Resistance, etc.

nHair has a Max Self Collide Iterations, that’s not the same thing.

There’s a Max Collisions Iterations attribute in the nucleus node, that’s not the same thing either.

Aaron


#7

The doc is probably in error. I’ll check with our doc guy. The old non-nucleus solver uses a parameter call “iterations” that is important for the solve quality, but this is hidden when you use the nucleus solver. The nucleus solver for nHair relies on substeps on the nucleus node as the primary quality attribute. You may need to also increase bend/stretch/compression and possibly twist resistance depending on what you need. With the old solver increasing iterations affected all of these things, which are more independent of the base iterations in the nucleus solve.


#8

Thanks Duncan, it would be great if in a future release, nHair got some love. A Max Iterations limiter would be really useful.

Aaron


#9

nHair does have iterations limiters… it is just different than when using the old hair solver. (much superior) We are modifying the doc to fix the issues you raised. If you really care a lot of about iterations and how they work with nHair you can read the nucleus white paper. This was done before nHair, but the iterations for nCloth still apply to nHair, which uses the same solve methods.

http://images.autodesk.com/adsk/files/autodeskmaya_nucleus_whitepaper.pdf


#10

Thank you Duncan, after scanning the document I see some useful information that really could have been in the docs, such as what the optimal Substeps and Max Collision Iterations ratios should be relative to Stretch Resistance. This sheds considerable light on the issues that have plagued me with nCloth.

What I’m not clear on is the lack of a Quality Settings section in the hairSystemShape node. For nCloth, I can reduce the Max Iterations per cloth object to clamp the calculations to “good enough” results at high Stretch Resistance, without incurring massive performance overhead. That doesn’t seem possible with nHair. Am I correct in concluding that the nucleus Max Collision Iterations serves the same function, just on a global basis?

Thanks very much for your help.

Aaron


#11

The nucleus maxCollisionIterations attribute is perhaps not well named. It is not really a clamp… collisionIterations might have been a better name.

The maxIterations on the cloth was provided mainly to keep the cloth from locking up in some situations, but really ended up being more of a hindrance. If on cloth you set the scalingRelation to worldspace then the iterations might be very large in some situations… say if the mesh is very high resolution or very small. The default value for scaling relation has the iterations for things like stretch equal to the max of the substeps or the stretch resistance value. Normally it is better to lower the stretch resistance than hit the max iterations value.

We changed the default to a high value so normally it is never hit. It turned out that real world situations often required a higher number of iterations than the original default and most customer failed to realize that the max iterations was kicking in and limiting stretch/bend resistance(or collisiion accuracy). On the hair system it is set to 100,000 internally, so it should never be hit in normal situations.


#12

This thread has been automatically closed as it remained inactive for 12 months. If you wish to continue the discussion, please create a new thread in the appropriate forum.