Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. Dismiss Notice

Can't get Graphics.DrawMeshInstancedIndirect to work with URP 12.1

Discussion in 'Universal Render Pipeline' started by spajus, Dec 22, 2021.

  1. spajus

    spajus

    Joined:
    Jun 10, 2015
    Posts:
    43
    Hey. I've tried the code example from docs - the example seems unchanged from Unity 5.x days, and it does work perfectly with built-in legacy renderer, shows thousands of rotating meshes, but in URP it won't work at all. I tried with 2021.1.28, 2021.2.7 and 2022.1 alpha - same result. Only a static single pink square is visible in editor, and in the build it's just blank.

    SRP batcher is disabled, shader doesn't show that it supports it either.

    I've read anything I could find about GPU instancing in official docs, nothing helps. Is there a way around this, or maybe a working example anywhere? Preferably of Graphics.DrawMeshInstancedIndirect without using any UNITY_INSTANCING_* macros, just raw shader + C# script.

    I submitted a repro project in case 1390210
     
  2. LANKA

    LANKA

    Joined:
    Sep 5, 2014
    Posts:
    1
    me too
     
  3. spajus

    spajus

    Joined:
    Jun 10, 2015
    Posts:
    43
    Solution for this is in the incorrect LightMode tag. URP has different light mode tags, find out which one works and the rest of the example is fine.