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

Bug VFX stop working when update 2021.3.16f1 to 2022 or 2023

Discussion in 'Visual Effect Graph' started by AlbertoVP, Dec 22, 2022.

  1. AlbertoVP

    AlbertoVP

    Joined:
    Dec 6, 2016
    Posts:
    42
    The VFX was working perfectly on the mobile devices we were using for testing until we tried to change the project to 2022. Then on two of the devices (curiously the most powerful, modern and GLES3.2 supported) it stopped working, except for a couple of VFX that are completely broken now. The only thing I get from the console is:

    Shader warning in '[FX_explosion] [sockwave] Update Particle': Buffer count exceeding default GL_MAX_SHADER_STORAGE_BUFFER_BINDINGS. Shader might not work on all hw. Consider combining separate buffers into one containing struct elements. at kernel CSMain (on gles3)

    I get this same warning in all VFX, no matter how simple they are.

    I've tried to force GLES3 only, vulkan only, change android APIs... nothing seems to work. And just to try I have tried in 2023 and it happens the same, so I think that maybe it is some new limitation? any clue where I have to investigate?
     
  2. AlbertoVP

    AlbertoVP

    Joined:
    Dec 6, 2016
    Posts:
    42
  3. PaulDemeulenaere

    PaulDemeulenaere

    Unity Technologies

    Joined:
    Sep 29, 2016
    Posts:
    146
    Hello,
    Sorry for the late answer, as stated in documentation, the requirement for the support of the VFXGraph is:
    - SystemInfo.supportsComputeShaders is true
    - SystemInfo.maxComputeBufferInputsVertex > 0

    However, using 2023.2.0a1, if you look at the generated code for the vertex output of the default visual effect asset, you will notice five buffers as input:
    upload_2023-1-31_11-51-52.png

    The number of buffers of the default VFX system has been increased from 21.3 to 22.2, on GLES 3.1+, the GL_MAX_VERTEX_SHADER_STORAGE_BLOCKS is often 4 (this value is reflected by SystemInfo.maxComputeBufferInputsVertex) and makes this effect won't render on some Android devices.

    We are working on improving the runtime and editor feedbacks about this kind of limitation and potential incompatibilities.

    You can reduce the buffer count switching the default particles system from alpha to opaque, it will disable the sorting.

    That is why we recommend the usage of Vulkan while targeting Android devices and why the compilation is warning about `GL_MAX_SHADER_STORAGE_BUFFER_BINDINGS` (in your message, it's a compute kernel).

    Can you check what is the value returned by SystemInfo.maxComputeBufferInputsVertex on your device ?
    Additionally, you can double check the SystemInfo.maxComputeBufferInputsCompute but it's generally higher.
    I would expect Vulkan mostly working on high end devices. Can you share the specs of the problematic device ?
     

    Attached Files:

  4. newguy123

    newguy123

    Joined:
    Aug 22, 2018
    Posts:
    1,248
    The problem with that though is that ARCore does not support Vulkan so we're stuck with GLES3+
     
  5. AlbertoVP

    AlbertoVP

    Joined:
    Dec 6, 2016
    Posts:
    42
    Hi Paul

    Make VFX opaques don't changes nothing. We have checked the values, the three phones give the same values, but the VFX only works in one (Xiaomi M11 Lite 5G)

    SystemInfo.supportsComputeShaders = True
    SystemInfo.maxComputeBufferInputsVertex = 524288
    SystemInfo.maxComputeBufferInputsCompute = 524288

    (Except in OpenGLES3 that vertex value is 4)

    The phones are
    Xiaomi M11 Lite 5g (VFX works)
    SnapDragon 778G (SM7325)
    (4x ARM Cortex-A55 and 4xARm Cortex-A78)
    Adreno 642L

    Poco Phone F2 Pro
    Snapdragon 865 (SM8250)
    4x Kryo 585 silver
    4x ARM Cortex-A77
    Adreno 650

    One Plus Nord
    Snapdragon 765G (SM7250-AB)
    6x Kryo 475 Silver and 2x Kryo475 Gold
    Adreno 620
     
    PaulDemeulenaere likes this.
  6. PaulDemeulenaere

    PaulDemeulenaere

    Unity Technologies

    Joined:
    Sep 29, 2016
    Posts:
    146
    Thanks for the information, so, I think it's related to this issue (the GLES part is independent from the Vulkan issue).

    By the way, I would like to emphasize that Visual Effect Graph does not support all platform supported by URP. As mentioned in the documentation: "The Visual Effect Graph supports every platform that HDRP supports".
    We are actively working on increasing the support for mobile but the current quality isn't satisfying for our standards so far.
     
    AlbertoVP likes this.
  7. AlbertoVP

    AlbertoVP

    Joined:
    Dec 6, 2016
    Posts:
    42
    I understand that VFX does not support as much as URP and is still under development, this is something that we accepted when developing the project and that not all phones could support. But not that the phones where it works are a lottery. If they have vulkan and meet the requirements it should work on them.
     
  8. PaulDemeulenaere

    PaulDemeulenaere

    Unity Technologies

    Joined:
    Sep 29, 2016
    Posts:
    146
    I feel your pain, the mobile market fragmentation doesn't really help mobile developers to deliver a consistent experience.

    About this specific issue on Vulkan, we recently tested on a Quest 2 which shares a close specification with the Poco Phone F2 Pro and didn't reproduce the issue. It makes me think we are recently relying on some undefined behavior with Vulkan Android, I can't confirm without more debugging, we are going to investigate.
     
    LooperVFX and AlbertoVP like this.
  9. AlbertoVP

    AlbertoVP

    Joined:
    Dec 6, 2016
    Posts:
    42
    The values received by the vertex buffer is normal?
     
  10. PaulDemeulenaere

    PaulDemeulenaere

    Unity Technologies

    Joined:
    Sep 29, 2016
    Posts:
    146
    Yes, on Vulkan, maxComputeBufferInputsVertex relies on maxPerStageDescriptorStorageBuffers while it depends on GL_MAX_VERTEX_SHADER_STORAGE_BLOCKS in GLES 3.1. The main difference between these two specifications is about the write capabilities on these buffers, in GLES there isn't a distinction for readonly.

    Here a Vulkan report for the POCO F2 Pro, in reality, I think you will be limited by maxPerStageDescriptorInputAttachments but it should be 8 on device you listed (as far as I know, this value isn't available in SystemInfo but I could be wrong)
    upload_2023-2-2_11-3-5.png

    Here on GLES on the POCO F2 Pro
    upload_2023-2-2_11-4-37.png