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

DrawMeshInstancedIndirect doesn't draw in OnRenderObject

Discussion in 'Android' started by kankane, Jul 10, 2020.

  1. kankane

    kankane

    Joined:
    Feb 22, 2013
    Posts:
    23
    Preface: This is on Oculus Quest, not Android phone.

    I just spent two days trying to figure out why my procedural instanced rendering wasn't working on Quest while it worked great in the Editor. It started working normally once I moved the DrawMeshInstancedIndirect call to the Update method.
    • I also tried the same with the example from the DrawMeshInstancedIndirect docs page, with same results
    • I tried with Single Pass as well as Multi Pass stereo rendering
    • I also made sure the shaders are explicitly included in the build and not stripped
    • I made sure OnRenderObject is still called (checked by updating a text label)
    • I tried attaching the script to various objects, including a camera
    So what's going on here?
     
  2. icormier

    icormier

    Joined:
    Aug 26, 2021
    Posts:
    16
    Hi @kankane I am experiencing the same issue. Were you able to figure this one out?
     
  3. kankane

    kankane

    Joined:
    Feb 22, 2013
    Posts:
    23
    Hey, I just checked my code and it seems that I ended up running it from the Update method. But honestly, I don't remember ever finding out why it didn't work in OnRenderObject. I think I just accepted that there are some differences between Android and Desktop behaviors.