- Home /
Custom Sprite Renderer - Batching
Ideally I'd like to be able to edit the mesh behind the SpriteRenderer as I wish to distort a sprite. As SpriteRenderer does not give access to it's underlying mesh I have instead used a MeshRenderer along with a MaterialPropertyBlock to set the texture used by the Sprite-Default shader.
This renders correctly however it breaks batching as Unity appears to not batch SpriteRenderers with MeshRenderers, or there's something else breaking the batch. But I have unit scaling on both objects and they are using the same material.
Anything else I should check. Or any chance of being able to edit the mesh in SpriteRenderers?
At the moment I'm facing the prospect of switching all my SpriteRenderers to MeshRenderes using my own script to create the mesh from the Sprite, Any ideas what optimisation the SpriteRenderer gives?
I have noticed that SpriteRenderers will batch even if they have a scale unlike MeshRenderers.