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.

Question Instancing Support with new Mesh API?

Discussion in 'General Graphics' started by chris_hellsten, Sep 15, 2022.

  1. chris_hellsten

    chris_hellsten

    Joined:
    May 5, 2014
    Posts:
    12
    I'm wondering if it's currently possible to support the Single Pass Instanced rendering path for XR when using the new Mesh API (eg: https://docs.unity.cn/ScriptReference/Mesh.SetVertexBufferData.html). I know how to make my shaders support instancing but I'm not sure how (or even if it's currently possible) to have Unity pass the correct instanceID to my custom vertex layout. There doesn't appear to be any VertexAttribute enum for InstanceID yet so I can't see how Unity could auto-magic this for me.

    Is instancing not supported for the new Mesh API yet?