Search Unity

Question GPU instancing not working correctly with URP

Discussion in 'Universal Render Pipeline' started by upsidedawnstudios, Nov 26, 2020.

  1. upsidedawnstudios

    upsidedawnstudios

    Joined:
    Nov 25, 2020
    Posts:
    2
    So I've been trying to use GPU instancing with in my project (WebGL 2.0 with unity 2020.1) and couldn't seem to figure out what was the problem. I had a simple scene with various meshes (forming a city block as figure below) duplicated n times, all using the same material (URP/UNLIT). upload_2020-11-26_12-23-49.png upload_2020-11-26_12-24-51.png upload_2020-11-26_12-27-2.png
    As you can see the by the image above there was no batching going on. I experimented a variety of solutions from other forum posts but nothing seemed to work, until I tried to disable the SRP batching (in the pipeline asset) and it reduced the batches by a lot. Absolute bonkers!
    upload_2020-11-26_12-27-42.png
    Is this a bug, or does the SRP batcher has better performance in other specific case scenarios?
     

    Attached Files:

  2. peterbay

    peterbay

    Unity Technologies

    Joined:
    Nov 2, 2017
    Posts:
    100
    The SRP batcher optimizes the draw call cost, so the batch count can't really be used to compare the performance of the two. Notice that the overall performance is better in your screenshot with the SRP batcher turned on. You can read more about how the SRP batcher works here: https://docs.unity3d.com/Manual/SRPBatcher.html
     
  3. Yashiz

    Yashiz

    Joined:
    Jul 9, 2015
    Posts:
    11
    GPU instancing and SRP batcher are mutually exclusive.
    To your statistics window, we can see SRP batcher is the winner regarding performance of your scene.
     
    xiangshushu likes this.