Hey all, I was just wondering what are some of your primary tricks for Optimizing your Games Performance?
Probably the most common practice is Reducing Texture Size… but I found that doing this alone does not really do the trick.
One of my current projects I have lots of TGA Texture Files which are huge! so I decided to try converting all the textures to JPG and this actually reduced my Unity Build by 10MB and brought my Frame Rate from 30-40fps, up to 50-60fps and it playback so much more faster/smoother, and this is without Occlusion Culling…
what are some of your common practices to improve performance?
Use the best compression type on bitmaps - like DXT1 or DXT5 if you can.
Use the lowest amount of materials that you can. Sometimes importing models will generate new materials for the same textures. Be careful.
Batch meshes together as much as possible (either using CombineChildren if you are on indie, or set them as static if in Pro).
Have as few lights creating shadows as possible. Preferably only one. If this is an outdoor scene, make a directional light for the sun, and have it create shadows.
That’s not the case; Unity does not use source files in a build. Using JPG for source files is a bad idea because it’s lossy compression, on top of which you will be adding further compression, such as DXT, or if you’re using uncompressed textures, then you’ve just introduced compression artifacts for no reason. Always used uncompressed formats for the source files, and if you’re using Photoshop, just leave them in PSD format since it’s easier to edit compared to exporting a different format. Nor will it have any effect whatsoever on framerate. The only thing that actually makes a difference in file size in a build is what texture settings you’re using in Unity. Using compressed textures will save some bandwidth, but in general this won’t make any real difference to the frame rate. Draw calls/polygon count/etc. is much more important.
Well i have absolute prove of this… so not sure how your saying it won’t make a real difference to frame rate… it took my framerate from 30-40fps to 50-60fps, how is that not a big difference?
I only export my projects to WebPlayer Only… does the DXT Compression work for WebPlayer as well? as i see here: http://docs.unity3d.com/Documentation/Manual/ReducingFilesize.html its showing DXT is only for Desktop Platform? if so then I’m out of luck then for DXT option…
actually whats funny is i have tried to use 512 as my max texture size, but still my webplayer build was around 47MB, when i converted to JPG my Build was now 33MB, big difference… and also big frame rate / performance boost.
here is what even funnier is that on the official Unity Documentation on “Reduce Texture Size” it says…
but that’s not true at all… it does make different… i converted all my TGA to JPG, re-assigned the JPG Textures to my Materials, and i got about a 10MB savings in my Webplayer Build and hug Performance Boost.
Now i’m not saying the Textures will look the best im sure lol, but still im just making the point that it works… and there is inaccurate information here stated by you and on untiy documentation. I just proved it does make a difference…
It’s possible the web player may have a different size, since by using JPG as source you have removed information and thus the textures could very well compress differently after LZMA compression. Indeed that would be worth mentioning in the docs. However, I 100% guarantee that any other build will be exactly the same size since Unity does no post-build compression in that case. DXT is a fixed-size compression format, so (for example) a 512x512 DXT1 texture without mipmaps will always be exactly 128K regardless of what the image looks like.
I also 100% guarantee that there is no performance difference for that reason. The graphics card does not care what the texels look like, only how many of them there are. Regardless of webplayer LZMA compression, that 512x512 DXT1 no-mipmaps texture will always be 128K in memory after it’s loaded, and will perform exactly the same no matter if it’s just a solid color or an intricately detailed texture. Any performance difference you might have seen came from some other reason. For actual proof, use the profiler. Here’s a texture, filling the screen, that came from a PSD source:
Here’s the texture after converting to JPG:
As you can see, identical performance.
Web player is desktop; it doesn’t run on anything else. All you have to do is look at your texture import settings in Unity (switch to Advanced for the texture type so you can see the actual format; otherwise it just says “compressed” or “truecolor”).
thanks for all the info, but im alittle confused what am i missing, why don’t have i have the DXT Compression in my Texture Settings? I am using Unity 4.0 Free, is that the problem?