Download

(Culling) Camera sees through walls on Android but not PC?

Engine version 4.12.5. I’m doing some profiling for a VR game I’m developing for mobile (Target platform is Samsung Galaxy S7/Gear VR), and I’ve been using the in-editor setting “Preview Rendering Level->Mobile/Html 5->Android Preview” to get a basic idea of how things will look on Android without having to constantly redeploy.

Recently, I noticed the number of draw calls was unusually high when they should be quite low, as the camera was just pointing at the corner of a wall. I deduced that whenever I looked towards another part of the level with lots of objects in it (even though it’s all behind a wall) the draw calls shot up. Here is a screenshot of the camera staring at a corner, while running in “Android Preview” mode:

If I change my “Preview Rendering Level” back to shader model 5, I see a much more reasonal number of draw calls:

I can confirm that when I run on the actual target platform, I’m also seeing the very high number of draw calls. As well, I can visually see the framerate drop as I spin part that corner, so I have no reason to doubt that the number of draw calls the stats are showing are accurate. This seems to indicate that culling isn’t working, but only on Android? Objects that should be getting occluded are not, but I’m not sure why this would happen on one platform and not another. What could be causing things to dispatched even though they’re clearly not visible by the camera, and aren’t dispatched on the desktop?

TL;DR - Dynamic occlusion is not handled on mobile. You will want to use Precomputed Visibility Volumes around your playable areas.

Got an answer via reddit:

Also linked to this other post which answers the problem:
https://answers.unrealengine.com/questions/212106/occlusion-or-visibility-culling-not-working-on-mob.html