Instant Occlusion Culling - for all versions of Unity

Good Evening Gentlemen,
I would like to share with You some fancy idea I’m currently working on, “Instant Occlusion Culling”.
Let me explain what I mean:
“Instant” means zero baking time, no pre-process needed, works like a charm on mobile (tested on iPhone 3GS :slight_smile: ) and best of all, it’s compatible with the free/basic versions of Unity. All you need is colliders for your Models (need them anyway…)
It is a fully dynamic Occlusion Culling solution, so it works perfectly fine with moving objects too :smile:

So, concept web player is here, would love some precious feedback from You! Would You like it on the Asset Store?
(The minimap shows all the houses been drawn by the engine with and without Instant OC)

more then 10X performance boost on my MacBookPro (Core i5 - GeForce GT330M)
insanely awesome on the iPhone 3GS!!! (the same scene is absolutely unusable without Instant OC on the 3gs and with it, it performs pretty acceptable ~ 16-20 fps)

UPDATE 1

  • added LOD (2 levels of details, but will add more in final version)
  • demo scene is now a little bit more tweakable, you can generate randomly up to 10.000 Houses and adjust LOD distance
  • added “Belvedere” in demo scene :wink:
  • various little optimizations and bug fixes

Concept Web Player

NOW AVAILABLE ON THE ASSET STORE - GET IT NOW!

NEW THREAD HERE

ZOMG! Wow, you have a real gem here sir, I’m quite jealous. If this was in the asset store, I would pick it up in a heartbeat. And not to pry, so if it reveals to much, say no more, but I’m wondering how you managed this. Since it requires colliders, are raycasts involved at all?

Interesting. Can you make a demo with units arranged in a 3D cube?

It definitely runs a heck of a lot faster when the optimization is on. Presumably this would work great with any scene that has a tonne of occlusion. For me it was like 3fps versus 50fps. You’d think something like this should be a built-in part of Unity.

I presume you’re doing some kind of ray-casts for visibility or something against all those colliders out there in game land, and then switching those objects off that don’t get a collision?

Haha. Its funny I was just brainstorming about a completely dynamic occlusion culling solution. Is this a grid system?

This is great! I went from about 5 FPS without OC to a stable 60 with. Nice job.

I’d imagine that’s what’s going on, but there’s got to be some optimization, otherwise wouldn’t all of those raycasts reduce performance?

Yes, I’d like to see that as well.

Very impressive; really good.

Definitely interested.

Very very nice, i was thinking about doing this and the way i thought of doing it was disabling all the objects for rendering then doing a raycast and when the ray hit something it would enable that object and stop the ray. But to me it seemed like it would of caused too much lag for each render.

I jumped off the edge and looked up a the houses, I could see almost 1/4 of the houses on the mini-map but the fps stayed about 50fps.

Anyway, yeah put it on the asset store.

What you have here is insane. The good kind of insane.

I see their is no Colliders attached to the houses? I think that might make them be a bit slower to “turn on”?

I did something similar with a grid based system not as nice however. But similar. The models I used were pretty high tris and had many objects and colliders. I had to add a delay to enable them otherwise you’d get a studder as well as only activating colliders for the player when he was in a certain range… Otherwise the fps would drop like crazy.

does each thing being culled need to be inside a grid cell? can you supply a demo where the positions are randomised with a button?

This is very good work. There was a huge difference when OC was off than when it was on.

This is EXACTLY what i need for my game :slight_smile:

Optimisation rate is perfect, but there is very visible poping up of occluded buildings. Maybe if you can you should decrease “loading time” of object when occluded or not.

Thank You so much for all your precious, delightful feedback!
…currently working on an update with (hopefully) some more juice :slight_smile:

That is the only thing that bothered me honestly… and btw how much is this tool?

Its clearly based on some partial raycasting based on screen pixels, which also explains why it sometimes takes a split second to show a house. For many games this is fully acceptable and it does provide a significant boost in performance.

However I noticed that while standing still and looking down a road the houses would pop in and out of view quite frequently. You should add a delay before items gets hidden to remove these random artifacts where a house gets “hidden” just because its impact is very small in the current view frustrum.