Search Unity

Shader graph questions about reusing node

Discussion in 'Shaders' started by L-Tyrosine, May 5, 2020.

  1. L-Tyrosine

    L-Tyrosine

    Joined:
    Apr 27, 2011
    Posts:
    305
    Hi!

    Is there any effect on performance if I repeat a node in shader graph? For example, to create 2 scene depth (both eye space). I want to believe that it "reuses" the code, right?

    Tks
     
  2. bgolus

    bgolus

    Joined:
    Dec 7, 2012
    Posts:
    12,342
    There shouldn’t be, no.

    I don’t believe Shader Graph itself is smart enough to reuse code, but that’s fine. Most shaded compilers will merge repeated code.
     
    L-Tyrosine likes this.