Search Unity

Question Shadergraph and BatchRendererGroup

Discussion in 'Graphics for ECS' started by Epineurien, Apr 16, 2023.

  1. Epineurien

    Epineurien

    Joined:
    Mar 9, 2013
    Posts:
    45
    How do you make something with ShaderGraph that's actually compatible with BatchRendererGroup?
    I can get it to work with Unity's Universal Lit shader.
    I can get it to work with Amplify Shader Editor (just tick "Dots Instancing" in the output node properties).
    I can't find how to get it to work in ShaderGraph (basic transform matrices work but all other data set in GraphicsBuffer seems to be ignored, despite using the exact same names than the ASE version).

    I see some people just writing their shader manually to insert #pragma multi_compile _ DOTS_INSTANCING_ON, is that really the proper way?
    I'm on 2022.2.12 URP, with the latest Entities/ShaderGraph package, in case it matter.
     
  2. DreamingImLatios

    DreamingImLatios

    Joined:
    Jun 3, 2017
    Posts:
    4,271
    Here's what a custom "_Color" property looks like. Key things are that the "Reference" is your actual shader variable name. The Override Property Declaration checkbox exposes the Shader Declaration which needs to be set appropriately. I hope that helps!

    upload_2023-4-16_19-45-31.png
     
    BelkinAlex likes this.
  3. Epineurien

    Epineurien

    Joined:
    Mar 9, 2013
    Posts:
    45
    Perfect, it's working now.
    Thanks - it must be the 3rd or 4th time one of your post is what unstuck my project.