- Home /
Texture type -> Advanced -> Mesh type: how it works?
I'm optimizing a 2D platformer game with a paralax scroll, I already optimized the scene, physics and scripts. On the PC it now runs close to 1000FPS, however on my Android phone I have trouble to keep the frame rate near 60FPS.
Because of the paralax scrolling, there's a lot of overdrawing (since I have 7 layers)... Accoring to what I've read so far, the main problem is that the alpha channel that makes parts of the sprite's rectangle transparent have to be rendered anyway, so in my case there is a lot of pixels that are overwriten up to 6 times. What they say is that the best way to avoid this is to replace the sprite with a mesh, that way you can cut away all the alpha stuff and grately reduce overdrawing...
I've also read from people that seem to be doing this on Unity 5 by setting the Texture type to Advanced and then Mesh type to Tight... and supposedly Unity will create a mesh from the sprite for you, but no clear example is given.
I already tried this but nothing seems to happen, if I replace the sprite render with a mesh filter I expect to see the newly created mesh on the "Select Mesh" window, but I just can see the standard mesh filters... so can anyone explain to me how this works???
Answer by Eric5h5 · Jul 21, 2015 at 02:33 AM
You don't replace the sprite renderer with anything, and you don't do anything other than set the mesh type to tight. That's it. There's no access to sprite meshes and nothing you have to do. The engine handles it for you. You can see the difference if you use shaded wireframe as the scene view rendering mode.
Thanks, it was not very clear. Perfomance improved, but not as much as I expected.
Said something wrong, sorry about that (Deleted the post to avoid confusion).
It indeed works fine, and can be seen with wireframe display turned on (Assu$$anonymous$$g you do use "Sprite Renderer" component).
Your answer
Follow this Question
Related Questions
Tilemap: Resizing Tiles? 1 Answer
Generate collision mesh from 2d texture? 0 Answers
loading sprite from atlas in script 4 Answers
Unity Adds Antialiasing to Texture 2 Answers
Black boarder on transparent sprites 2 Answers