Search Unity

Bug Quad output shader with alpha blending not compiling on OpenGL ES, but working on Vulkan (Quest 2)

Discussion in 'Visual Effect Graph' started by canmom, May 11, 2023.

  1. canmom

    canmom

    Joined:
    Nov 6, 2022
    Posts:
    7
    Hi!

    I've come across a bug while attempting to use the VFX graph to create effects in a project targeting the Quest 2.

    What I'm trying: visual effects graphs set to output particles as quads with alpha blending
    Expected result: particles should render
    Actual result: particles do not render when using OpenGL ES.
    However, if the graphics API is switched to Vulkan, these shaders compile and the effects do render properly.

    (Additionally, when running inside the editor over Quest Link, particles render. It's only when I actually build to an APK and run that on the Quest 2 directly that the problem arises.)

    In this example, I've created two barebones visual effects. The red one uses additive blending (which compiles to three shaders), and the blue one uses alpha blending (which compiles to four shaders).

    Scene rendered with OpenGL ES - only the red is visible:
    com.Holonautic.VFXCompilationBugDemo-20230511-024100.jpg

    Same scene rendered with Vulkan - both effects are visible:
    com.Holonautic.VFXCompilationBugDemo-20230511-024403.jpg

    Logcat output:
    Here are some example logcat outputs from two different projects. I'm not sure why one says a variant does not compile, and the other (from a different project) says it failed to link, so I'm including both.

    Logcat output from the above test project:
    logcat-errors-2.png
    Logcat output from a different project:
    logcat-errors.png
    (Some lines of output are missing from the second image since I searched for 'shader'.)

    Unfortunately, we don't have the option to simply switch to Vulkan, since our project is using Entities Graphics which is not performant with Vulkan on the Quest 2.

    I have filed a bug report to go with this forum post [ IN-40783 ] with the minimal example project used to generate the images above.
     
    Last edited: May 11, 2023
  2. PaulDemeulenaere

    PaulDemeulenaere

    Unity Technologies

    Joined:
    Sep 29, 2016
    Posts:
    154
    Hello,

    Thanks for the detailed report.
    The problem is actually known and detailed in this thread.
    To be brief, the default VFX is now requiring too many SSBO entries for GLES, changing between alpha blend and additive will indirectly remove indirect draw and sorting. With Vulkan, on Quest 2, this constraint is higher.
    We are considering to merge some buffers to reduce this limitation but it won't solve all GLES incompatibilities.

    We were aware about ARCore limited to GLES3+ but I'm curious about this performance issue with Entities Graphics on Vulkan, has it been logged somewhere else ?
     
    Vita- likes this.
  3. canmom

    canmom

    Joined:
    Nov 6, 2022
    Posts:
    7
    Hi Paul, thanks for the reply! Glad to know it's a known bug. I hope it does prove possible to fix.

    The Entities Graphics problem has been reported, the issue tracker is here: https://issuetracker.unity3d.com/is...ween-vulkan-and-opengles3-when-built-with-ecs and internally it's bug report IN-32563. I believe it has to do with the types of buffers that Entities Graphics uses to pass data to the GPU being very slow in the Quest 2. If that can be fixed, we can just switch back to Vulkan!