Search Unity

Help Wanted Converting shader graphs to editable, usable shader code?

Discussion in 'Shader Graph' started by Haeferlkaffee, Jul 11, 2019.

  1. Haeferlkaffee

    Haeferlkaffee

    Joined:
    Dec 2, 2013
    Posts:
    9
    I'm trying to make a gradient-lighting/banded-lighting shader that actually uses per-pixel lighting to determine which "band" of illumination to fall into (pretty much just cel shading). I have old shader code from another engine that simply rounds the illumination value to the nearest band, but obviously this is only doable directly in the shader after the lighting is calculated.

    Is there a way I can compile my shader graph to a usable, editable shader of some kind?
     
  2. alexandral_unity

    alexandral_unity

    Unity Technologies

    Joined:
    Jun 18, 2018
    Posts:
    124
    On the master node, you can right click and select "Show Generated Code" and save the output to a regular shader file. The format will be different than usual shader lab shaders so I recommend checking the documentation for whichever render pipeline you're using.
     
  3. Haeferlkaffee

    Haeferlkaffee

    Joined:
    Dec 2, 2013
    Posts:
    9
    Thanks, I'll try this
     
unityunity