- Home /
Trying to run big scenes on mobile devices.
Hello friends I am trying to create big scenes like whole city for mobile devices it works good for PC and I had taken almost all precautions for making it compatible and efficient. But some time in PC its lags fps is low and in mobile devices it gives big issue. So can you please tell me how expert people avoid these issue and create great games for mobile devices as well in unity. If there is any link suggesting some tips and tricks to make games more efficient and should not give performance issues, please help me.
Here is a link that might help you: http://sicklebrick.com/?p=411
Look at your draw calls make sure they're not more than ~100(more or less) on the phone. Check your textures, scripts etc... $$anonymous$$any things affect mobile performance.
This is a very broad question, and it's hard to answer it in one comment. You should take a look at Creating 3D Game Art for the iPhone with Unity, it specifically talks about creating digital assets that will run great on mobile devices.
Answer by Crystalline · Oct 21, 2013 at 08:55 AM
Join as many game objects as possible.(reduces drawcalls).
Instead of per object material use texture atlases, this way you have less materials which also means less drawcalls.
Using advanced shaders like bumped ,specular can really be an issue, make sure you use them only where you REALLY need them.
Watch your polycount ! Delete faces that cant be seen! Ex : a rock fit into ground, the part that is in the ground is not seen , so it doesent need faces.( modeling)
Its for the best to never go pass 1024 resolution for your textures!
Level of detail is your friend ! Object far away dont need all the details since the player cant really see.
You can use fog and decrease the camera view distance! You can save quite a lot of processing power this way.
Make sure you join as much as possible! But do it in "chunks" not whole areas! Merging too many objects will make frustum culling ineficient!
Hope these tips will help you a bit :).
Answer by meat5000 · Oct 21, 2013 at 09:23 AM
Employ this:
http://docs.unity3d.com/Documentation/ScriptReference/Renderer-isVisible.html
in conjunction with this:
http://docs.unity3d.com/Documentation/ScriptReference/Renderer-enabled.html
meat5000: I checked both the links but I am bit confused. Its just like occulusion culling, then why should we go with this and which one is better because in this I need to apply the script for disabling and enabling render on every object then is it good for performance ??
From this thread:
The Unity Profiler (if you have Pro) and System.Diagnostics Stopwatch are great tools to get those types of answers.
Using the Stopwatch and iterating 1 million times over toggling GameObject.SetActive() between True and False took about 1335ms.
Doing the same thing and toggling the Renderer.enabled between True and False took about 84.4ms.
Basically, this can be employed as well as Occlusion Culling. It's a very small routine, to check distance from camera and disable object render. It can be performed at large intervals (every 0.5s? 0.1s?) to reduce the demand, which is ideally placed on each object.
The other similar situation is to disable Animations of objects outside of radius&&isVisible. I have seen this technique used in many commercial games.
Crystalline's suggestions, above, are also quite popular and have good performance advantages.
One more thing I can think of is Texture Atlassing which basically involves grouping textures into 'tiles' of one texture and setting offset depending on which one you want to use. This allows you to recycle the same material for more than one object which offers batching benefits as well as reducing the number of materials. (Just noticed Crystalline mentions this, too.)
Thanks a lot meat :) actually m trying to create whole complex in that user can go n interact but for that is it good to instantiate object n destroy them or just place it already and enable disable their renderers.
It's always best to avoid Instantiate and Destroy, I hear. Some calls are fine but they are a lot slower than pre-instantiate and enable/disable. A lot less overhead. Alas, it's situation dependent.
I assume you have Pro, which means you could perhaps make use of the Additive/Async loading. Async is loading a scene in the background whereas Additive is background loading into the current scene. You can technically create massive levels which load/unload dynamically. This involves splitting levels up into chunks.
Your answer

Follow this Question
Related Questions
Low Android performance / Render.TransparentGeometry gets 90% 1 Answer
Best way of changing material shader properties performance wise 1 Answer
Collision causing performance to drop 0 Answers
Rendering a plane is dropping 10 fps 0 Answers
This settings are good for performance?? (android game) 1 Answer