I’m made a quite short animation in 3DS Max of a pile of rocks (37 of them to be exact) falling apart. I want to import it into Unity, and the thing is that I need multiple instances of that on my scene, 7 to 10 of them.
As one can imagine, even a single instance results in 74 draw calls (because of lighting), a number not acceptable for mobile devices. Is there any chance of improving my situation, allowing all of my instances to be present of scene?
One trick I could think of (I must say at this point that only ONE pile is going to be animated each time), is create an additional object for each pile, which would consist of a single collapsed object (I would attach all editable polys to a single poly inside 3DS Max, thus resulting to a single draw call) and having all animated objects deactivated, until they need to animate. Then I would deactivate programmatically the static object, activate the animated one and animate it.
Any more ideas?
Export the pile of rock as a single skinned mesh (as if you were exporting a rigged character, every bone of skeleton moving one stone)
Another option: Render rocks as mesh particle system. Not sure about shuriken, but in legacy PS you can instantiate and manipulate individual particles by your own code. This means you can animate their position as GOs, from animation or by physics, and then apply the positions to corresponding particles. You will just need some scripting.
An example: Your paricle system effector (script that creates and manipulates particles) will have a list of gameObjects it tracks. For each one it creates a particle and every lateUpdate sets the particle pos / rot to the GO’s. Then simply animate GOs by your current animation, just remove renderers from them
You could always do Light-map baking then delete the light(s).
Just put a projector above the Rock animation to at least get it it’s own fake shadow.
Lights will kill Unity’s performance before even 100,000 thousand trees on a map. (I had 8 lights on a map and got 5 FPS)
I had 100 K trees and a 12,000 x 12,000 terrain and still got 60 FPS.
So just bake your lights.
Lights are your best friend and worst enemy, I figured that out quickly.
Also you can go to Edit > Project Settings > and change your Pixel light Count and Shadow Distance and the other various settings. That is an alternative…