Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Help  interpolation running despite being off
#1
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
Reply
#2
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).
Reply
#3
(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?
Reply
#4
(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/tutor...modes.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...rmals.html

- RecalculateNormalsAndTangentsFromMesh calls Unity's Mesh.RecalculateNormals and Mesh.RecalculateTangents. Same normals as previous mode, adds tangents. See: https://docs.unity3d.com/ScriptReference...gents.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
Reply
#5
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
Reply