occlusion culling help

hi guys, i’ve tried creating occlusion culling by following the unity exampe but its been stuck on sampling pvs for about 50 mins and hasnt even moved. Is there somthing im missing out?

Not exactly answering your question (try less subdivisions?) but - I doubt occlusion culling will have any advantage in such an outdoor scene as there are very few objects that could hide others from view.
I still don’t know if Unity has a usable system for outdoor scenes where only a few objects or terrain humps can occlude others… There is too little info about the included occlusion system.

ok, but still shouldnt it be easyer to bake with smaller amounts? and i’ve created another terrain and placed about 500 objects in there and tried it there also and it won’t bake :S

I really need help with this :confused: Perhaps im setting it up wrong, but after looking at the documentation it seems fairly accurate, unfortunatly the documentation isn’t much of a tutorial itself does anyone know any other resources?? thanks

Ok after playing around for a while i managed to get it to bake. Howerver it lowered my FPS strangly, so im ausuming my settings are still wrong, for a better FPS do i want a higher target resolution? and does stuff like the size of the blue boxes help?

the blue boxes as well as target resolution are related to target areas only. Target areas are areas where dynamic objects are in (if you place such areas they must cover all places dynamic objects are in, otherwise you must ensure to not place target areas at all so the whole world is considered a target area)

that it samples 50 mins is rather well possible, your view are there is massive and has a serious subdivision.

I’m not sure that the area there is really what you wanted, cause the white area is meant to cover the possible areas the camera is in as precisely as possible. But the area you defined there is large enough to nearly do midair combats. Also it has vertical seperation which I’m unsure you need at all unless the camera can move up and down at a rather fine grained granularity (comparable to shooter with crouch, walk and jump)

Firstly, thanks alot for the reply! Im a tad confused though, so your saying i shouldnt make it so tall? at the moment it seems to be rendering stuff that it shouldnt be :S (screenshot below). I just want best optimization as im getting quite low fps if i set the render to extremly high and the veiw cell size to somthing like 10? is lower or higher better :smile:? thanks

the camera is in no why area as far as I see, this means that occlusion culling is disabled. (hard to say though as you enabled visualization for target area but disabled view area ;))

Occlusion culling requires that the camera is within the white area (view area) and the white area you be as small as possible but cover every place the camera can go to.

Also, please keep in mind that the terrain and trees do NOT act as occluders at all! only objects marked as static will act as occluders

:confused: so i cant occlude terrains? it seems to be doing it in my picture, i guess ill look into it further tommorow thanks alot for the support :smile:

You can occlude terrain, but the terrain does not act as an occluder as far as tests so far have shown.
That means stuff thats behind a hill will not get occluded (as your terrain block in the back there shows which is more or less behind hills etc) unless you put a static collision box into the terrain (so out of view technically but still there), yet if a terrain chunk is behind a house it will not be rendered :slight_smile:

I really cant figure this out :(, even after i made the occlusion area bigger i loose even more fps! and i made it not as tall either :frowning: i really don’t know what to do


Well I don’t see any occluders.

As mentioned, the terrain will NOT do any occlusion for you so even if you have 100 hills in front of you, all of them will render unless you place static objects into the hills that act as occluders.

This is a current shortcoming in the Unity occlusion that terrains do not act as occluders (mentioned that above) so something thats behind a hill is handled as if nothing was in front even with occlusion culling enabled.

if you go into that building style thing you have there, given its static, you will see the serious difference when moving out of it towards the large terrain in the back, a lot of stuff will popup and not go away anymore

ok i think i understand :smile: do i have to rebake the map after placing the objects? im ausuming yes but it can’t hurt to ask :smile: I don’t even understand how im loosing alot of fps in my scene yet you get games companys that could run like 4000bn of my citys with uba detail and still hve 60 fps its insane :stuck_out_tongue:

Right you will need to rebake the occlusion if you place / remove static occluders, otherwise it won’t do anything good :slight_smile:

as an easy solution for getting the terrain to occlude: there used to be a script that allows you to export a terrain to an obj file. you then can use that obj file as mesh directly again to use it as occluder :wink:

As for why you lose performance: you have 2 terrains both with foliage and alike, thats some rather decent hit.
at worst you are also running on deferred which will make it only worse as that runs that bad that I wouldn’t touch it for more than experiemtation (I get barely 100 fps on a lightweight scene and thats on a core i7 920 @ 3.2ghz, GTX280, 18GB RAM - to give a comparision scale: I get equal and better framerates with FarCry 2 on ultra settings, even leadwerks runs on full settings with all dynamic on a fairly complex scene with equal and more fps)

Unity has a lot to learn about optimizing the new render path stuff and utilizing the powerfull middleware meaningfull in U3, at the time it runs at 10-20% of what it could run technically if we go by the performance other engines show off for several years now. Due to the price etc I naturally don’t expect it to get those 100% but I expect it to go into the 70% range after all its years after those and the knowledge behind it is well enough known.
already an integration of terrain with occlusion should make a serious enough difference if the foliage and detail finally starts to be occluded correctly and the terrain occludes correctly.

but do you know whats strange? even if i delete the other terrains i only get a 1fps boost… but when i look in the profiler its mostly rendering from the camera, i may have forgot to delete history on a model or somthing :confused: i dont know XD is there a way to find out in the profiler what object is costing the most?

I ve seen this video, and it looks, that umbra works for terrain:

And that terrain looks like standard terrain, not mesh.

I ve just tried very simple scene. Basic terrain 2000*2000, few textures, few buildings. I placed camera behing hill in the direction of buildings. I baked oclusion data (200 cell size, preview mode). Without I had 100k triangles watching through hill, with cca 12k triangels.

http://dropmocks.com/mRT-y

I tried even without meshes, just pure terrain and it works too. There is only one confusing thing, maybe BUG. If I turn off “cull geometry”, player culls anyway (editor stops culling), so it looks, like there is no difference between on and off that culling system is not working. You have to destroy culling data to get “old” performance and then you see quite big difference even on low quality preview mode.