- Home /
One huge mesh or a lots of prefabs
Hi I am making a level with a lot of simple beveled cube, and I don't know if I should use one prefab of the simple beveled cube, build the level in unity with these and use occlusion culling or if I should build the level in blender then export it as one object then use occlusion culling.
Answer by Sirithang · Aug 27, 2012 at 03:30 PM
Occlusion Culling won't work if there is one huge mesh : The Unity occlusion culling use GameObject, it disable them based on their visibility.
So if you have one huge mesh (that is one gameobject in the hierarchy), it won't ever get culled.
I would recommend using different object. The thing that you can do is still use a 3D app (like blender) but make different object in blender. When imported, unity will keep the blender hierarchy (in fbx anyway) and so occlusion culling will work.
Keep in mind this object-thing when deciding what doing as a whole and what spliting. for example each room could be separated, allowing the culling to be done on a per-room basis etc...
More info here :
http://docs.unity3d.com/Documentation/Manual/OcclusionCulling.html
Without Occlusion Culling is it still better to use prefab for each cube and build the level in unity or export the mesh as a single object for the whole level
here is a not to scale plan of a level to help understand http://imgur.com/k7mlN
Depends on what you plan.
Prefabs have the advantage of being versatile : you cna change them, or change a bit of the level without redoing everything.
If you model the whole level, you'll beforced to do it INSIDE the 3D modeler each time you want to made a tiny change.
Now prefab have probleme to : if you plan on building your level from saying, piece of wall you glue together, you could have problem of precision at the joint, especially with lightmapping : tiny shadow appearing at each joint, flickering when too far from the wall etc...
But for your level made entierly of BevelCube that shouldn't be a problem, so I would recommend the GameObject (mark them as static, and Unity will batch them for extra speed. And plus you'll be able to occlusion cull them)
The pipeline I would recommend for piece will one piece walls (not maybe the easier or faster, but so far the "best" I have used in different project) is to build the level from block to playtest and allow tiny change fast. Then once the level is pretty much declare "ok", go model it with plane and a lot fewer polygon, and in one block, in your 3D app.
Your answer
Follow this Question
Related Questions
Mesh Filters randomly self deleted 0 Answers
Apply new complex fbx to saved prefab 0 Answers
Generated mesh not applied to main prefab (2018.3) 0 Answers
Changing a script inside a prefab 1 Answer
Prefab is not changing image in android 0 Answers