Obi Official Forum
Help interpolation running despite being off - Printable Version

+- Obi Official Forum (https://obi.virtualmethodstudio.com/forum)
+-- Forum: Obi Users Category (https://obi.virtualmethodstudio.com/forum/forum-1.html)
+--- Forum: Obi Cloth (https://obi.virtualmethodstudio.com/forum/forum-2.html)
+--- Thread: Help interpolation running despite being off (/thread-2850.html)



interpolation running despite being off - zagoalie - 07-04-2021

Here in the screenshot, you can see I have turned off interpolation for the obi solver yet there is still a high cost for interpolation that is going on under obi.

is there somewhere else I need to turn it off? 
[Image: e26150f6a01749beea520a6d1d8897b7.png]

https://gyazo.com/e26150f6a01749beea520a6d1d8897b7


RE: interpolation running despite being off - josemendez - 07-04-2021

The "Interpolate" function call does two things: interpolate particles if needed (which is extremely cheap btw), then trigger the rendering callback.

So all cloth mesh updating / rendering will appear under the "interpolate" call in the profiler. Unfolding the "interpolate" call will show these.

In your case, 5ms spent there means the cost of updating mesh vertices/normals/tangents is quite high. Maybe you can use a cheaper tangent update mode in your cloth mesh renderer component.

Also keep in mind that you're not actually using Burst, as the warning in the solver is telling you. You don't have the required dependencies installed, so the simulation will fall back to the native backend (Oni).


RE: interpolation running despite being off - zagoalie - 07-04-2021

(07-04-2021, 11:15 AM)josemendez Wrote: The "Interpolate" function call does two things: interpolate particles if needed (which is extremely cheap btw), then trigger the rendering callback.

So all cloth mesh updating / rendering will appear under the "interpolate" call in the profiler. Unfolding the "interpolate" call will show these.

In your case, 5ms spent there means the cost of updating mesh vertices/normals/tangents is quite high. Maybe you can use a cheaper tangent update mode in your cloth mesh renderer component.

Also keep in mind that you're not actually using Burst, as the warning in the solver is telling you. You don't have the required dependencies installed, so the simulation will fall back to the native backend (Oni).

Great advice thank you, i had no idea tangent space had such a huge impact saved me a solid 30%.

I couldn't find any documentation advising me what are the benefits of each mode? seems like copy normals from sim and recalculate normals from mesh are both running about the same performance-wise, is there any logic I should use to pick which is better for my use case?


RE: interpolation running despite being off - josemendez - 07-04-2021

(07-04-2021, 11:35 AM)zagoalie Wrote: I couldn't find any documentation advising me what are the benefits of each mode? seems like copy normals from sim and recalculate normals from mesh are both running about the same performance-wise, is there any logic I should use to pick which is better for my use case?

You should only need tangents if your shader is using them (for instance if you use normal maps, which are expressed in tangent space).

These modes aren't documented anywhere, will add them asap (edit: docs updated with this info, see http://obi.virtualmethodstudio.com/tutorials/clothrenderingmodes.html). They should be pretty self explanatory though:

- CopyNormalsFromSimulation: copies the normal of each particle to the affected vertices. It's basically a loop copying data from one array to another, pretty cheap.

- RecalculateNormalsFromMesh: calls Unity's Mesh.RecalculateNormals. Moderately expensive, results in slightly higher-quality normals. See: https://docs.unity3d.com/ScriptReference/Mesh.RecalculateNormals.html

- RecalculateNormalsAndTangentsFromMesh calls Unity's Mesh.RecalculateNormals and Mesh.RecalculateTangents. Same normals as previous mode, adds tangents. See: https://docs.unity3d.com/ScriptReference/Mesh.RecalculateTangents.html

- TransformNormalsAndTangents: Most expensive mode, best quality. Calculates a per-vertex matrix that transforms the mesh's rest normals/tangents to the deformed tangent space. Use if your mesh contains hand-crafted normal seams or tangents that you don't want to change

Let me know if I can be of further help Sonrisa


RE: interpolation running despite being off - zagoalie - 07-04-2021

Thanks! that's very helpful to know. you solved all my issues for now, ill probably be back with more optimization questions in the future Sonrisa