Search Unity

Question How to get URP GPU instancing to work

Discussion in 'Universal Render Pipeline' started by hreintke, Oct 31, 2022.

  1. hreintke

    hreintke

    Joined:
    Jan 6, 2022
    Posts:
    20
    Hi,
    I am trying to get an understanding on SRP batchers and GPU instancing.
    This while working with 2021.3.10f1, 3D/URP.
    What I have now :
    A material, with URP Pipeline/Lit shader, with GPU instancing enabled.
    A cube, with the above material.
    An Universal Pipeline Render Asset with SRP batcher disabled.
    But still there is no GPU instancing.
    In a scene with 1000 of this cubes instantiated, I see no GPU instancing in the debug.

    Am I still missing some steps ?

    If I need to give more info or the full project, I can do that.
     

    Attached Files:

  2. funkyCoty

    funkyCoty

    Joined:
    May 22, 2018
    Posts:
    726
    The URP prefers using the SRP Batcher instead of GPU instancing, when possible. If you REALLY want to use instancing, you can either use the graphics apis directly for it or you can disable SRP batching for that shader.

    Really though, the SRP batcher generally wins out. But if you have a good use case for it (such as LOTS of foliage) there are ways to force it's usage. I wrote a plugin that does exactly this, Corgi Foliage, on the asset store.