Search Unity

Does Android/iOS player option 'Disable Depth and Stencil' disable ZTest?

Discussion in 'General Graphics' started by SM_AF, Sep 14, 2017.

  1. SM_AF

    SM_AF

    Joined:
    Aug 1, 2017
    Posts:
    23
    Hi,

    I recently tried to tick the 'Disable Depth and Stencil' player option. It resulted in instant (and quite big) FPS increase in my case (Android/iOS mobile 3D game). But it made me wonder how is that even possible since my game doesn't use Occlusion Culling at all and this player option should disable ZTest/depth test across the board leading to horrible opaque geometry overdraw, right?
    I understand that generating the depth texture must have some kind of an overhead by itself and that disabling it should lead to less GPU load, but then... my game uses very high resolution textures and is generally bottlenecked by the GPU. It is very hard to render every pixel for my testing device. And by causing insane amount of overhead by disabling the Depth texture generation should destroy my FPS. But nope, it increases it dramatically.
    So maybe I got it all wrong and ticking the aforementioned option doesn't disable the ZTest?
    Or maybe I know nothing, just like John Snow?

    I just don't understand it :D And am starting to doubt that little I know about rendering.

    Could anyone please shed some light on this for me?

    Thanks,
    Stepan
     
    roointan and theANMATOR2b like this.
  2. SM_AF

    SM_AF

    Joined:
    Aug 1, 2017
    Posts:
    23
    Quoting "XScorpion2" who has answered my question in THIS reddit post: "Let me start by saying I'm not a graphic guy. However, that option should only disable the depth and stencil buffers, these buffers are mainly used by post processing effects such as highlighting or ambient occlusion. ZDepth testing is done in each render queue and uses the raw data instead of the buffers. Thus ZDepth test still works with that option disabled."

    Aaah mighty XScorpion2 be praised!
     
    Last edited: Nov 28, 2017
    roointan likes this.