Why does the cloth simulation doesn't work properly?

   1565   6   1
User Avatar
Member
6 posts
Joined: Feb. 2018
Offline
Attachment Not Found


Hello FXrieds –

Can somebody tell me, why my very simple simulation has these ugly mistakes in it? Some polygons are wrong shaded and seem to pop out like scales.

I really tried everything in the AutoDopNetwork, the values in the Cloth Object as well as values in the sphere (Static Object). I changed the Substeps in the clothsolver to 16 and I changed the resolution of the grid to 200x200 polygons. Finally I reinstalled Houdini. Nothing worked.

So, what else could be the reason?

That's my file:
Attachment Not Found


Thank you very much for help

Attachments:
buggy_blanket.mp4 (1.2 MB)
cloth_test.hipnc (608.6 KB)

User Avatar
Member
1743 posts
Joined: March 2012
Offline
Since the geometry has no normals, the viewport and Mantra have to automatically compute normals. In order to handle geometry that has clear cusps, e.g. the edges of a cube, it defaults to computing vertex normals with a cusp angle of 60 degrees, so if two adjacent polygons have geometric normals that differ by more than 60 degrees, there will be a cusped edge between them.

If you want to explicitly compute N on the geometry, you can use a Normal SOP with “Add Normals to” set to “Points”. Alternatively, in the viewport display options, under Geometry > Normals > Auto Generate, you can select Point Normals. For Mantra, on the object, you can add a rendering parameter “Add Normals To Geometry” (vm_addnormalsto) and select “Point Normals”. If you want vertex normals, but just a larger cusp angle, there are ways to specify that too. I think there's some way to do this all with detail attributes too, but I can't remember what they're called right now.

Another thing that would probably also make this less of an issue would be if you had higher resolution cloth geometry, since then the angles between adjacent polygons would be less, but that might slow things down, so I understand why that wouldn't be an ideal solution.

Hopefully something above is what you were looking for.
Edited by neil_math_comp - April 30, 2018 10:50:50
Writing code for fun and profit since... 2005? Wow, I'm getting old.
https://www.youtube.com/channel/UC_HFmdvpe9U2G3OMNViKMEQ [www.youtube.com]
User Avatar
Member
1743 posts
Joined: March 2012
Offline
Ah, the detail attribute I couldn't remember was vm_cuspangle, matching one of the Mantra property names. You can put @vm_cuspangle = 180;into an Attribute Wrangle with Run Over set to “Detail (only once)”, and it'll give you smooth normals in both the viewport and Mantra. It may or may not be faster to set the viewport and Mantra to compute point normals instead, but this gives a way to manage it at the geometry level without having to explicitly compute normals.
Writing code for fun and profit since... 2005? Wow, I'm getting old.
https://www.youtube.com/channel/UC_HFmdvpe9U2G3OMNViKMEQ [www.youtube.com]
User Avatar
Member
1743 posts
Joined: March 2012
Offline
Oh, right! I forgot to mention that you might alternatively just want to turn on subdivision on the object, by setting Render > Display As to “Subdivision Surface/Curves”, and turning on “Render Polygons As Subdivision (Mantra)”. That'd also fix the remaining weird-looking shadows in Mantra that are due to the low resolution of the cloth.
Writing code for fun and profit since... 2005? Wow, I'm getting old.
https://www.youtube.com/channel/UC_HFmdvpe9U2G3OMNViKMEQ [www.youtube.com]
User Avatar
Member
6 posts
Joined: Feb. 2018
Offline
Wow, that worked!
I added Normals to the points of the grid and turned on subdivision on the object. The cloth looks very nice now in the Render View of Mantra.
Thanks a lot!

I also tried this:
ndickson
You can put @vm_cuspangle = 180;into an Attribute Wrangle with Run Over set to “Detail (only once)”

It worked too, but my computer didn't become faster.
Is it right, that I had to put @vm_cuspangle = 180; into the VEXpression box in the Attribute Wrangle to change the default value 60 to 180?
User Avatar
Member
1743 posts
Joined: March 2012
Offline
TSCHOUNAES
I added Normals to the points of the grid and turned on subdivision on the object.
It'll automatically compute point normals if subdivision is on, so you don't need to explicitly add normals if you don't want to.

TSCHOUNAES
It worked too, but my computer didn't become faster.
Is it right, that I had to put @vm_cuspangle = 180; into the VEXpression box in the Attribute Wrangle to change the default value 60 to 180?
I meant that setting Mantra or the viewport to compute point normals instead of doing that might be faster than that, since computing vertex normals can be slightly slower than computing point normals, though not always. If you turn on subdivision or compute point normals, you don't need to set the cusp angle for vertex normals, since Mantra and the viewport won't be computing vertex normals in those cases.
Writing code for fun and profit since... 2005? Wow, I'm getting old.
https://www.youtube.com/channel/UC_HFmdvpe9U2G3OMNViKMEQ [www.youtube.com]
User Avatar
Member
6 posts
Joined: Feb. 2018
Offline
Thanks for the great help. That really brought me some steps further.
  • Quick Links