- Home /
Sprite shape culling performance
I'm using Sprite Shape in my project and recently I noticed that culling on those elements takes 20ms each frame. The exact profiler entry is SpriteShapeController.OnWillRenderObject with 4692 calls.
I have a few solutions in mind, but I couldn't find how to implement any of them. I would be grateful for any tips on how to do that, or for any new ideas, maybe they are better than mine.
Turn off culling whatsoever. I wanted to check how my game would preform without culling, but I can't really find a way to turn it off for sprite shapes. My camera has occlusion culling turned off.
Bake sprite shapes. I don't really need my sprite shapes to be dynamic and I guess baking them in some way would improve my performance. Setting the static flag does nothing. I would turn off the controllers, but when I do that, then culled shapes don't show up on the screen. If there is an immediate solution then it would be awesome, but baking all the shapes into a texture is also acceptable. Sadly I don't know how to start with any of those.
SpriteShapeController now has the Bake$$anonymous$$esh() method.
Answer by SimplyNew · Mar 28, 2021 at 01:41 AM
Not sure if it's too late to answer this question. I am putting this anyways.
In editor, when you enable Edit Spline button, one checkbox appears below Enable Tangents. Using that checkbox, you can cache your geometry and avoid run time recreation.
Your answer
Follow this Question
Related Questions
LOD not improving performance as much as it should, see profiler screenshots 0 Answers
Explain the use for Occlusion Area? How is this different from regular Occlusion Culling? 2 Answers
Changing shader at runtime vs multi-purpose shader 1 Answer