Hi there,
I was wondering if anyone knew what would work best in terms of performance when doing little things like grass or flowers for an Android mobile game. Lets assume that both would look just as good, should I use Sprites with a Sprite Renderer to display them or use a 3d model (from Blender) instead? What would help my performance the most, to get some extra FPS?
Thanks!
Use simple geometry that matches the outline of your textures as closely as possible, and use a fully opaque shader.
Sprite shaders use transparency which can cause “overdraw”. Mobiles have a lot of pixels to shade (as many or more than a typical PC would), and they have weaker GPUs. To do transparency it will need to overdraw each overlapping object which could be a lot if you have a field full of grass. Mobile GPUs can usually barely cope rendering their entire screens with a moderately complex shader; they simply can’t cope with drawing parts of the screen multiple times for transparency.
The edges of your grass will have a hard edge with an opaque shader, but they will be much faster because the renderer can use simple depth-testing to only shade the blade of grass closest to the camera.
An alternate method would be do have a thin strip of geometry around the edge of your objects using a transparent material to softly blend the edges, but then use a fully opaque material for all interior geometry. It might be a few extra draw calls (a little extra work for the CPU) for the material switching, but you would eliminate all the over-draw for the interior of your objects saving your GPU a ton of work.
1 Like
Thank you so much for your answer! Just to make sure I got it right, can you please confirm that the following process would be correct? (I’m kind of new to this type of work)
- Go in Blender or any other modeling program, create a plane and then edit to so it looks like an outline of what my shape would be, such as a leaf, or flower with petals etc…
- UV map it so it uses an actual texture
- Import it in Unity and use it that way
Correct? Again, thank you very much!