|
I'm trying to combine mesh filter LODs with Umbra culling. The LOD is a script that swaps sharedMesh based on camera distance, i.e. very basic:
This works perfectly when the mesh is not static, however as soon as the mesh is set to static for culling calculation, it stops working. By not working, I mean that the hundreds of instances of the mesh's transforms are reset and all are placed at 0,0,0. How can I properly combine mesh LOD with culling?
(comments are locked)
|
|
If you're swapping a mesh then it isn't really static. When you mark objects static you "make a promise" to Unity that your object will be STATIC, i.e. you won't move them around and so on, then Unity can precompute some things (like apply transform to the mesh). I don't think you need make objects static in order to have culling. Culling works in any way. IIRC, depending on Static Unity does static or dynamic batching.
(comments are locked)
|
|
I changed the code to enable / disable the renderer rather than swap out the mesh. I can now set the object to static and use culling with no problems. I have a parent with two gameobjects, (hi and low poly versions), I then place the LOD script on the parent and assign the hi / low versions, set to static then save as prefab. Script: Mark your answer as correct one if it solves your problem ;)
Nov 29 '10 at 02:41 PM
Paulius Liekis
(comments are locked)
|
