Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Help  Artifacts on simulated cloth but not original mesh (something to do with normals)
#3
(04-05-2026, 09:39 AM)josemendez Wrote: Hi!

By the looks of it, I'd say normals are the culprit too (specially since unlit shaders don't exhibit the issue). Would it be possible for you to bake the simulated mesh (right click on ObiClothRenderer, "BakeMesh" on the context menu - or, "BakeMesh" button on the component itself if you're using an older version of the asset) and share both the original and the exported simulation meshes so that I can take a closer look at them?

During simulation, the mesh deforms. Both the deformed mesh vertex positions and normals are calculated by linear blend skinning the original mesh data (ClothRenderingJobs.cs, UpdateClothMeshJob). There's 3 things that can go wrong:
- Original mesh data is incorrect.
- Bind poses are incorrect.
- Current particle poses during simulation are incorrect. These are calculated in the RenderableOrientationFromNormals job at the end of each frame, by simply deriving a quaternion from each normal. Normals are a simple area-weighted cross product sum (UpdateTriangleNormalsJob). This assumes triangle winding order is consistent throughout the original mesh: if some triangles have opposite winding order, the normals will be flipped during simulation. This is consistent with what you're getting, so I'd look here first.

kind regards,

Whoops, forgot to update earlier! I ended up figuring it out myself, turns out some of the original vertex positions were pretty horribly mangled, and the strict skin constraints on some parts of the generated mesh meant those parts weren't able to flatten out naturally. Since the meshes are procedurally generated, I had to make some tweaks to the generation code, to ensure that some changes were applied with less intensity.
Honestly there's not much interesting stuff I can say without giving away NDAs, but I appreciate the response anyway. The thing about the triangle winding order is interesting, but the normals at those regions seemed totally fine anyway before the simulation started.

Thanks!
Reply


Messages In This Thread
RE: Artifacts on simulated cloth but not original mesh (something to do with normals) - by CptnFabulous - 04-05-2026, 09:51 AM