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. Dismiss Notice

Feature Request GPU Instancing variables on Shader Graph

Discussion in 'Shader Graph' started by james_unity988, Apr 6, 2019.

  1. james_unity988

    james_unity988

    Joined:
    Aug 10, 2018
    Posts:
    71
    Hi there,

    I am trying to use SRP with Pure ECS. I am building custom shaders in Shader Graph which require per-instance variables to be rendered properly. How can I achieve this? If not possible yet, please let me know how big of a priority it is. If I need to switch back to Classic rendering I will.

    Thanks
    James
     
  2. Kink3d

    Kink3d

    Unity Technologies

    Joined:
    Nov 16, 2015
    Posts:
    45
    Hi,

    Assuming you are talking about `BatchRendererGroup`, I'm afraid this will not work (at least for now). This only supports Model matrices per instance and doesn't support arbitrary per-instance data. Core Graphics team is working on expanding this but I'm afraid I cant offer any real information or timelines.

    When we have the underlying implementation in place, Shader Graph will then need to look at supporting generation of arbitrary constant buffers.
     
    Gekigengar and SubPixelPerfect like this.
  3. james_unity988

    james_unity988

    Joined:
    Aug 10, 2018
    Posts:
    71
    That's great to know! I'll stick with classic render pipeline for now. Thanks!
     
  4. Gekigengar

    Gekigengar

    Joined:
    Jan 20, 2013
    Posts:
    706
    Its 2020, any word on this?
     
  5. SeriouslyNot

    SeriouslyNot

    Joined:
    Nov 24, 2017
    Posts:
    121
    @Kink3d

    How about now?

    There is a "Hybrid Instanced (Experimental)" checkbox under Color and Vector1 in the Blackboard. Is that it?

    Can you please give a feedback.
     
  6. SpaceAgeInteractive

    SpaceAgeInteractive

    Joined:
    Feb 4, 2018
    Posts:
    59
    Any update on this in 2022? I have a Shader Graph material that I'd like to support GPU instancing but I couldn't find much info out there about it.
     
  7. Tudvari

    Tudvari

    Joined:
    Jun 3, 2014
    Posts:
    30
    Bump!
     
    SpaceAgeInteractive likes this.
  8. riaarvr

    riaarvr

    Joined:
    Aug 15, 2018
    Posts:
    2
    bump.. 2022 dude! Whyyyy you can`t... ;(
     
    SpaceAgeInteractive likes this.
  9. kulesz

    kulesz

    Joined:
    Jul 1, 2012
    Posts:
    137
    Bump as it's almost 2023?
     
    SpaceAgeInteractive likes this.
  10. YiboInsane

    YiboInsane

    Joined:
    Jul 22, 2019
    Posts:
    16
    Bumpbump.XD
     
    SpaceAgeInteractive likes this.
  11. Thaina

    Thaina

    Joined:
    Jul 13, 2012
    Posts:
    1,049
    This is somehow very silenced even it was very important
     
  12. LawrenceWin

    LawrenceWin

    Joined:
    Dec 29, 2022
    Posts:
    1
    The InstanceID node can't even work properly in 2022.2... RenderMeshPrimitives can set the
    SV_InstanceID attribute in traditional shader file while InstanceID node in Shader Graph always return 0.
     
    SpaceAgeInteractive likes this.
  13. DJ_Design

    DJ_Design

    Joined:
    Mar 14, 2013
    Posts:
    122
  14. TimRad96

    TimRad96

    Joined:
    Jan 3, 2022
    Posts:
    1
    wow
    No answer