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. We have updated the language to the Editor Terms based on feedback from our employees and community. Learn more.
    Dismiss Notice

DrawMeshInstanced and URP not work?

Discussion in 'Universal Render Pipeline' started by Astoret, Jun 21, 2020.

  1. Astoret

    Astoret

    Joined:
    Jan 22, 2020
    Posts:
    7
    Hi All,
    I'm searching a way how optimize my game performance. And some researching I found that
    Graphics.DrawMeshInstanced can bump it to really good level. I tested in on simple project and ensure that it's work for me. But when I tried to apply to my project it stop work.
    The meshes are not creating by Graphics.DrawMeshInstanced and number of verts don't changed, but it works for Graphics.DrawMesh. And no errors in console.
    I tested on new project with URP and was able to reproduce same issue on the project.
    So my question: Is it work for URP?
     
  2. Astoret

    Astoret

    Joined:
    Jan 22, 2020
    Posts:
    7
    Ok, looks like I found why it's did not worked. I selected Render2DData by Default. It cause the issue
     
  3. ShilohGames

    ShilohGames

    Joined:
    Mar 24, 2014
    Posts:
    2,991
    I can confirm that Graphics.DrawMeshInstanced method works with URP 7.4.1 in Unity 2019.4.
     
  4. Astoret

    Astoret

    Joined:
    Jan 22, 2020
    Posts:
    7
    Yes it works. And btw unlit material works with Render2DData.