- Home /
Occlusion Culling on Prefabs Instantiated at Runtime
So I'm working on an iPad project where I have up to 500 identical prefabs (336 verts each) and I'm looking for ways to increase performance.
Current draw calls on average (400): I've had a look at draw call batching and it sounds like it is only really useful for meshes with less than 100 verts because a draw call batch is only up to 300 verts anyway. I could probably reduce my model to be below 300 but that would still mean I can only fit one mesh per batch, which is pointless right?
The two remaining options that I can see are Occlusion Culling and MeshCombining.
I've got Occlusion Culling working on non instantiated prefabs (prefabs that are already in the scene) but because all of the "box" prefabs in my project are created dynamically I ran into some problems. Is it possible to apply Occlusion Culling to lots of identical prefabs created at run time?
Mesh Combining seems promising. I only have 1 question here: When I combine all of my meshes, do they need to be children of the same gameobject? At the moment each "box" also has an additional "box shelf" mesh. Does this mean I need one gameobject to hold the combined "box" meshes and another to hold the "box shelf" meshes? This would be kind of a pain as my code uses the parent-child relationship in a lot of it's logic.
Thanks for reading!
Lukas
Ok here is some info that may help :
1) you can normally get away with upto 180 verts for batching to work, sometimes higher it has several aspects that affect it. Try to get you boxes down to within 180. You can split the mesh up into smaller chunks to achieve this.
2) I have no idea why occlusion culling is not working for the instantiated boxes. This is a camera setting for Unity Pro. Are you using pro, if not then that is why it is not working. You can sometimes simulate it with layer cull distance, but I don't think this will work for you.
3) As far as I know mesh combing is just that. Combing all your meshes in your 3D modeling package into one big mesh object. This sounds like it might not work for your setup. There was a combine children script, but I have not seen it for a while. If it does still exist then maybe it can do some magic for you...?
On the whole I would look at option 1...
Great thanks for the tips $$anonymous$$rSoad! I did number 1 and it improved frame rate a ton. I also did frustrum culling which helped as well, although I couldn't get proper culling working.
Cheers!
Your answer
Follow this Question
Related Questions
iPhone Controller Asset 0 Answers
Screen.sleepTimeout works when application runs in background on iOS (iPad) 0 Answers
Specifying a high quality background image for iPad 1 Answer
Keyboard triggered animation not showing on IOS device 0 Answers
App crash when using siri dictation to replace text on iOS 0 Answers