Thursday, 16 October 2014

Occlusion Faster, Spikes Under The Crosshair

Today I improved the speed of the occluder, added the new occluder sub boxes to The Escape demo entities, and no and behold the saving in drawing less entities to the GPU was EXACTLY the cost of calculating the occlusion. At least it is no more expensive any more!  It also means some levels with enclosed levels will see a performance boost, but you will notice a subtle drop if you have a completely open level with nothing to hide behind (naturally).

Moved onto defeating the two performance spikes when in high combat. I fixed one which was caused by the enemy calculating too many paths, now they spread that work out. And the second I continue to work on this evening, caused by too many raycasts.  Not sure how to solve this, but deciding to spend my brain energy on this rather than a pretty blog.

Better blog Friday, and some nice shots :)  Going to eat now, then back to the code!!


  1. Enjoy your meal Lee,looking forward to the next release.

  2. Lee, you should try the method Unity uses. They pre-bake the occlusion data on static entities and thus there are no calculations at runtime and you only get performance boosts.

  3. Yeah I think the pre baked occlusion culling is called PVS (potentially visible set).

  4. Strangely enough I ended up reading up on the same Unity stuff, lol. I was going to ask if it may be a better idea to calculate it beforehand rather than on the fly. Not sure how that would handle new things popping up on the map, but would be good for set in stone maps, possibly not so much with a more sandbox style game, unless it could add new data in on the fly also.

    1. They have several methods, some of which also include the ability to handle dynamic objects at runtime while retaining the baked static data. This link explains it more.