- Home /
What's more optimized? Diseable an sprite renderer or diseable the GameObject that contains the SpriteRenderer?
I'm making a project that has thousands of sprite renderers of (2 triangles in wireframe each one). And I want to optimize it because it's soo laggy. What should I do? Diseable the sprite renderers of the sprites you can't see or diseable the whole gameObjects that contains the SpriteRenderer components?
Oclussion Culling is not an option :/
Answer by Statement · Oct 21, 2020 at 06:05 PM
This is probably a reply you dont want to hear but it will lead you to an answer.
Try both. Make sure to profile your code before and after each step to get an idea if either works best for you.
Another thing you could consider trying would be to make custom rendering making your own mesh and update it realtime. That mesh could contain 100s of triangles. To make it work with multiple textures you should use a texture atlas. This is a bit more cumbersome way of going about but may help you in the long run. For this to work, look at Mesh, MeshRenderer and MeshFilter.
Your answer
Follow this Question
Related Questions
Changing SpriteRenderer order in script 1 Answer
Outline set of tiled sprites 0 Answers
Collider not resizing with Sprite Shape by Script 2 Answers
Regarding "Sprite Shape" component: Is it possible to get the fill texture to work with 2D lighting? 0 Answers
Sprite cutoff/altered in game view but not scene view 0 Answers