cesium-unreal icon indicating copy to clipboard operation
cesium-unreal copied to clipboard

Physics meshes require a lot more memory after metadata styling changes

Open kring opened this issue 3 years ago • 0 comments

In #698, we changed our physics meshes generation code to include an additional option: bSupportUVsAndFaceRemap. The discussion about it at the time was:

I think users have to enable UV results from line traces as a project wide setting and then it shows up as part of the HitResult struct. If the above option is set to true and if the project wide setting is set to true, then I think the physX cooking saves the UV coordinates for line traces later. This will take up more CPU memory, but I doubt it should affect cook time

However, this does not appear to be true. UV and face remap data appears to get generated regardless of the project setting, probably because we're short-circuiting the process and explicitly asking PhysX to generate this data.

This new data caused a memory leak (fixed in #873), but even with that fixed it means we're using significantly more memory for physics meshes than we used to. Some ideas for improving this situation:

  • Honor that project setting flag, rather than forcing PhysX to always generate this data.
  • Do we need UV info for every set of texture coordinates? We only actually use it for picking (not styling) with feature ID textures, right?
  • Can we make this optional so that users only need to pay for it when they use it?

Also for consideration: what changes (if any) are needed for Chaos / UE5?

kring avatar Jun 10 '22 01:06 kring