Search Unity

Feedback Final color output node

Discussion in 'Shader Graph' started by Brady, Jan 17, 2020.

  1. Brady

    Brady

    Joined:
    Sep 25, 2008
    Posts:
    2,474
    I've run into several instances where I need to modify the final result of lighting operations, and it seems like it would be a more flexible architecture to, instead of having a handful of special, magical "master" nodes in which all the lighting takes place, have a final output color node that serves as the terminus of the shader. This would mean the lighting nodes such as PBR, Unlit, etc, would have an output that could either feed into this required terminus, or instead could feed into additional logic that processes their output before outputting the final color result.

    Unless I am missing something, as it is, there is no way to add effects onto the result of the lighting. Your custom logic can only process/produce one or more *input* values to PBR, Unlit, etc, but not the output. This is very limiting.

    EDIT: A good example of a common use case of needing to modify the final lighting output is custom fog effects.
     
    Last edited: Jan 17, 2020
  2. neoshaman

    neoshaman

    Joined:
    Feb 11, 2011
    Posts:
    6,493
    THIS
     
    Brady likes this.
  3. oobartez

    oobartez

    Joined:
    Oct 12, 2016
    Posts:
    167
    We're having the same problem with transitioning from built-in to URP in a large project - without it there is no way for example to apply a grayscale filter at the last step.
     
    dog_funtom and Brady like this.
  4. VisualDima

    VisualDima

    Joined:
    May 21, 2020
    Posts:
    19
    Same problem!
    Need something like finalcolor
     
    Brady likes this.
  5. Sinterklaas

    Sinterklaas

    Joined:
    Jun 6, 2018
    Posts:
    93
    I couldn't agree more. Being able to modify the color after lighting has been applied would be an extremely useful feature.

    Furthermore, from what I know about ShaderGraph's internals, I doubt it'd be very hard to implement either. I imagine that the extra nodes that would come after the output node would just get compiled into the bottom of the fragment shader, after the output node calculations, but before the return statement. The only issue I can think of is that it would require an additional output node, which might confuse new users. But I personally feel that the increased flexibility makes it totally worth it.
     
    Brady likes this.
  6. D1234567890

    D1234567890

    Joined:
    Aug 11, 2019
    Posts:
    65
  7. Qriva

    Qriva

    Joined:
    Jun 30, 2019
    Posts:
    1,315
    @ali_mohebali or any unity dev, can you shed some light on "Surface Shaders" feature?
    How exactly it going to be implemented and what does it actually do?
     
  8. Oxeren

    Oxeren

    Joined:
    Aug 14, 2013
    Posts:
    121
    Qriva likes this.
  9. Qriva

    Qriva

    Joined:
    Jun 30, 2019
    Posts:
    1,315
  10. theteadrinker

    theteadrinker

    Joined:
    Jan 6, 2015
    Posts:
    5
    +1 need something like final color in the built in surface shaders
     
    florianBrn likes this.