Search Unity

Question How to use batching and instancing with 2D Sprite-lit-Default

Discussion in 'Universal Render Pipeline' started by Jawsarn, Dec 10, 2021.

  1. Jawsarn

    Jawsarn

    Joined:
    Jan 12, 2017
    Posts:
    245
    Hello! So we're drawing quite a lot of vegetation I'm trying to optimize by either batching or instance drawing.
    We are using Sprite Renderers with currently the 2D/Sprite-Lit-Default materials.

    1: Is it possible to use instancing with this? I've tried enabling it by the materials but I can't see any difference when looking into frame debugger. So might be related to 2nd question.

    2.Whether I click to enable SRP Batcher, Dynamic Batcher nothing seems to change in the frame debugger. There seems to be some other batching going on as from what I see as "Draw Dynamic" which causes a row of vegetation to be drawn. What is causing these batches?

    3. With the currently "unkown" batcher, fake shadows drawn in a separate layer order it draws like 1/10th of the map in one draw. But with trees it does only one line e.g 1/80th something. Which is interesting as there are still overlap of the trees it draws in one call, so it doesn't seem to be the reason of preventing z fighting. Since these are all quads and there should be same amount of shadows as vegetation, what would be the reason why it could draw more shadows than vegetation here?