Do your volumes overlap? Place a smaller volume, say for example a doorway connecting the two rooms and make sure it touches both volumes so the trace can go from volume to volume, cell to cell.
Occlusion Culling is not working when I set up my own scene. I follow the Unity Website Document on how to set up “view-area” and I place the box in the scene…Still does not work. Also, when I load the Ware-House Tutorial on Culling its works just fine and I’m pleased SAAWWWEEET LOL! …But if I create a new object in the Ware-House Scene, that particular object does not get introduced into the culling. How is the Ware-house tutorial different than the Unity website document set-up for Occlusion Culling? Is there a Hierarchy chain I’m missing? Anything?
I guess I’m just not familiar enough with Unity’s Culling Set-up and Procedures. Can anyone lend a hand?
Have you set the new objects you’re placing in the scene to Static in the Inspector? Are you generating the occlusion again when you add new objects? Do you have the Scene View set to Occlusion?
All these occlusion problems people are having worries me a bit. I think the process is fairly straightforward and that the warehouse project shows how it’s supposed to be set up.
Can anyone out there tell me a “success story” of using the occlusion culling system? Is our demo the only working one out there… that can’t be the case right :?
I was able to get occlusion culling working in a simple example after some trial and error.
I looked at the warehouse demo before trying out occlusion culling but couldn’t really make heads or tails out of it. Visually, there are so many objects in it that I couldn’t (and still can’t) make out the occlusion culling setup.
I don’t think just pointing someone to the warehouse demo is enough. A simple written demo with step by step setup instructions would go along way to helping people get started with this awesome feature.
Step1: Make your stage. Be sure to set all object that are in your stage to “Separate” objects. i.e. like chairs, jumps, railings, barrels and even walls.
Step2: Bring in the View Area Box.
Step3: Align View Area Box to match up your rooms or whatever you need rendered at a given time during play to optimize your “draw calls”.
Step4: Set Cell Size to something reasonable scaled to your objects in your scene. (1-2 seems to be good. I used 1.5.)
Step5: Click on Edit>Generate Occlusion>Preview. Depending on how many “view Area” boxes and Cell Sizes you have it will take some time for the computer to Cache this data in memory.
(you may get errors: be sure to set all objects that you want to go-away to “STATIC”)
Step6: Play and see if it works. You will have to change placements of Area Boxes and Cell Sizes to get the best Draw-Counts vs. See-able objects while in play.
I hope this helps. I just figured it out and I’m so happy I wanted to share it with everyone.
If you are going to send this Occlusion to iPhone be sure when generating Occlusion from the Edit tab you say, “Build Release”. That should do the trick.
If anyone has a better procedure please post! Thanks!
Glad to hear you got it working McKaners… and now this thread goes into the FAQ
@kenlem - I think having a step by step guide for this would be nice, and since it would require no scripting it’s a tutorial I can finish myself for Unity… so it’s on my todo list and will probably get repackaged with the occlusion demo when it’s done.
thanx for the tips, i was in a hurry and there are not many objects in the game, so i managed enabling/disabling objects by script, but i’ll check all the tips on the next project for sure.
ok, now i tried it on my new project, still not getting it to work.
just wondering if i have understood at all what occlusion culling is.
is it supposed to hide objects out of camera sight, or only objects that are hidden behind other objects?
problem is, i have a jump and run, and there are hundreds of diamonds spread over the level (duplicated from the same object) and i want the ones disappear, that are not seen by the camera, but ofcourse there are no rooms hiding other parts of the level, its just one big level - and that is pretty much the situation i had last time when i tried. is occlusion culling supposed at all to be used for such purpose?
occlusion culling hides all objects that are occluded by static objects.
Static objects are flagged as such in the editor and you need to generate the occlusion data afterwards.
moving objects will not occlude anything
but if you have no walls, there won’t be much to cull likely. in your case the normal view frustrum culling and an iso like camera are much more powerfull as anything that is out of view will be culled by default.
unfortunately the default view frustrum culling is not enough, as scripts and physics calculation are still made for all objects, gonna have to go for some scripting work… again
Use the OnBecameVisible and OnBecameInvisible to disable physics, animation and alike for all out of view and reactive it when they become visible again
also depending on what it does you might want to have “active / inactive” states for things that will definitely not be of interest at the moment and then try to combine the geometry of the “uninteresting” stuff to reduce the draw calls
I have tried static objets in and out of the view areas, multiple view areas, different cell sizes, connecting view areas, places with walls, places without walls, places where the camera isn’t in a view area at all, places where the camera is touching one but not all, I have tried all modes of occlusion culling (preview build preview build release…) and I get absolutely no culling.
jump and run really does not need any physics at all.
if you use physics for that you are doing something seriously wrong especially when developing an iphone game.