Futile
Futile copied to clipboard
Optional mesh double buffering
Should implement mesh double buffering for a performance boost.
Hmm, pretty sure double buffered meshes are no longer recommended/needed anymore in Unity because of the introduction of MarkDynamic().
After Unity's mesh updates were optimized, double buffering will still perform faster than a single mesh, but the difference will not be as noticeable as before. Still, having a spare millisecond per frame could be nice for big meshes. Double mesh buffering is still recommended in the docs.
MarkDynamic() should be made configurable because it degrades performance on some devices.
According to Unity, the key with MarkDynamic() is that they will continuously optimize it specifically for different platforms, so doing workarounds for it seems counterproductive, as it will improve over time and probably overcome the performance of double buffering or any other hacks. It's worth noting that those tests were done on a single device, the performance on other devices could be vastly different depending on Unity's internal optimizations.
Also, something being recommended in the Unity docs has to be taken with a grain of salt, because those docs are often really old and don't get updated.
That's a valid point. At least MarkDynamic() works wonders for my target.
However, I think that mesh double buffering can still be a valid optimization.
Yeah that's fair, I'll look into implementing it as an option as long as I don't discover too many tradeoffs with it.