Sunday, 16 February 2014

Occlusion Prototype Done


Wanted to go to bed three hours ago, but could not let go of this damnable algorithm. It's now 3:15AM, my eyes and head are throbbing, but I finally bashed the HZB occlusion system into a working state and my little box prototype runs with full 'super fast' occlusion.

I created a world with 400 boxes on the floor, and one large central box which I set as an occluder. Without occlusion my frame rate was 160 fps, due to the full textured shader I applied to all of them.  When I switched on automatic occlusion, it jumped up to 350 fps with no change in visuals.  Of course when I ran up to the wall to force full occlusion, it jumped to 1000 fps. Thanks muchly Mr HZB!

I have yet to see how the system handles more objects and more occluders, but as the system is predominantly a GPU operation scaling up should be almost free on higher end graphics cards. Time will tell if this approach to occlusion works on the lower end cards.

I've probably binned half of Monday with my 'burnout' weekend but I think it was worth it, and now I have the theory running well in a prototype, the next step will be to transfer the few occlusion commands to the main engine and see what kind of 'before' and 'after' frame rates I get.  Fingers crossed.

NOTE: I also dealt with a few emails over the weekend too, including one that helped me fix the scaling issue bug causing SCALE entities to lose their scaling when you load them in or save an executable.  A five minute fix, but testing with the R4D5 model was lots of fun!!


  1. Ah, excellent news! So will this help with/completely fix the issue with stuff popping into view? My annoyance with the previous system was not that stuff popped into view one frame late (lots of AAA games do that) but that no matter how slowly you moved the camera, the building still stayed hidden when a corner should have become visible and would wait until you had even more invisible building in view before appearing.

    Again, excellent work, and have a good night's (and morning's, I presume) sleep :)

  2. This has made my day Lee - I'm so glad you've now fixed the entity Scale bug! I can now populate my level with all the 3rd party models (that I've spent a small fortune on!) and be safe in the knowledge that they will have retained their scale properties when I open the level again :-) Cheers Lee!!!

  3. Many thanks for all your hard work Lee,time to recharge I think .

  4. Wow this looks like great news Lee

  5. Sounds good, can't wait to test it! I hope I didn't bug you too much with my mails, especially being the weekend! Then again, it resulted in a minor (but annoying) bug being squashed, so perhaps I should do it more often! ;)