14-08-2019, 05:30 PM
(This post was last modified: 14-08-2019, 05:42 PM by josemendez.)
(14-08-2019, 04:48 PM)cubrman Wrote: The only thing I am baffled about is this: why don't you just let me try and see for myself? Just tell me the best case scenario the best way to do what I want to do and let me fail on my own. Maybe then I will have other ideas. Flipping normals in the shader isn't hard for me - I am worried about cloth mesh jumping into colliders after flip though.

The "clothMesh" property of ObiCloth contains the deformed mesh, just grab it and modify it in any way you want. Assuming your solver is updating the simulation in FixedUpdate, you can grab the results in Update, which is called by Unity always after FixedUpdate. Like:
Code:
void Update()
{
Mesh mesh = cloth.clothMesh;
// modify the mesh here
}
Quote:Flipping normals in the shader isn't hard for me - I am worried about cloth mesh jumping into colliders after flip though.If you flip the normals in the shader, you cannot affect the simulation in any way if that's what you're worried about, only rendering. So the mesh won't jump into colliders or anything, if you only modify its shader.
Of course you could also flip the normals in Update as well (or scale the vertices of the mesh directly, one by one), but it would be staggeringly slow compared to using the vertex shader. (Note Obi performs mesh deformation in native code for performance reasons).