Download

[4.17] Draw call count not as expected

Hi!

I’m currently developing a game for the Gear VR which means a very limited amount of draw calls every frame. After doing some profiling I have realized that the amount of draw calls we get in the game is double then what we expect including stereo rendering. To reproduce just start a new empty project and remove the skysphere, this leaves just the floor. The draw call should then be 2 if running in VR without instanced stereo rendering but if you write stat SceneRendering in console then the total mesh draw call will be 4. It also doesn’t matter if you use forward or deferred rendering (tried in a empty project) however i’m using Forward rendering since i develop for mobile vr.

Does anyone have any insights to what might be going on? Is this a known issue?

I’m using Unreal Engine version 4.17.2 and an oculus rift cv1 for testing on PC.

Thanks in advance

EDIT: When changing the material for the mesh to be additive blend mode instead of Opaque and then disable Render After DOF I get the expected amount of draw calls but the material must be opaque so this is not a solution. So it seems that all meshes with opaque materials get drawn twice which must mean that Render After DOF is set to true by default and that results in the meshes being drawn in the separate translucency pass aswell? Render after DOF is greyed out when changing to opaque blend mode so not sure how to change it if thats the problem.

What if you just changed the material to unlit, with a basic color plugged into emissive and set to opaque? The default worldmaterial may have something else going on causing an additional draw call?

Hi and thank you for your answer. I have tried that with the same result but after reading up on how the rendering process works in Unreal I think I understand whats going on. It is the early-z pass that is causing the extra draw calls. All meshes with opaque materials first gets drawn in the early z pass however it is only the depth data that gets drawn which means it is cheaper. This is done so that when they get drawn in the main pass the depth test has already been done meaning no unnecessary fragment shaders are run.

I have tried to disable the early-z pass in project settings but after reading up more on this subject I found that you can’t disable it when using Forward Rendering without modifying the engine.