Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

Question _CameraNormalsTexture OpenGL ES feature needed?

Discussion in 'Universal Render Pipeline' started by Captain_Flaush, May 2, 2023.

  1. Captain_Flaush

    Captain_Flaush

    Joined:
    Apr 20, 2017
    Posts:
    65
    Hello,

    I have activated SSAO on our game, visually it's a really nice touch but the performance results are extreme

    One Plus 6T - Before SSAO - 60FPS / After SSAO - 60 FPS
    Huawei P9 Lite - Before SSAO - 60 FPS / After SSAO - 5 FPS

    To me, it looks like _CameraNormalTexture needs a OpenGL ES feature. Is that the case?
    It would help me filter the phones that don't support such feature in order to disable by default SSAO.
    If it's not the case I will find a different approach.

    Thanks a lot!
     
  2. wwWwwwW1

    wwWwwwW1

    Joined:
    Oct 31, 2021
    Posts:
    761
    Hi, Scene Normals ("_CameraNormalTexture") renders the scene twice. (Check DepthNormalsPrepass in FrameDebugger) This may be expensive on low end mobiles.

    However, SSAO Depth mode reconstructs Scene Normals from Scene Depth ("_CameraDepthTexture"). When After Opaque is checked, URP will do a depth copy rather than enqueuing DepthPrepass (unless it's on GL ES + MSAA).

    I'd suggest making a development build and test it on them. The GPU Profiler can provide detailed performance stats. If DepthNormalsPrepass costs the most, you can try switching to "Depth Mode" and check "After Opaque".
     
  3. Captain_Flaush

    Captain_Flaush

    Joined:
    Apr 20, 2017
    Posts:
    65
    Both SSAO options have the same huge performance impact.
    On the P9 Lite the post processing effects (bloom and color correction) seem to have very little impact on the performance and it continues at 60FPS, but SSAO drops the FPS to 5. It seems like a bug or a missing hardware feature.
     
  4. wwWwwwW1

    wwWwwwW1

    Joined:
    Oct 31, 2021
    Posts:
    761
    I don't think that URP SSAO requires a OpenGL extension which is slow when device doesn't have it.

    Have you tried the GPU Profiler in Unity Editor? It should tell you how much time (in ms) does SSAO cost.

    If you'd like to filter out these old devices, one simple way is to detect the frame rate and disable SSAO if it's low.
     
  5. Captain_Flaush

    Captain_Flaush

    Joined:
    Apr 20, 2017
    Posts:
    65
    I switched to HBAO and it's faster.