Search Unity

  1. Unity 2019.2 is now released.
    Dismiss Notice

Feature Request Custom lighting and Simple lighting master node

Discussion in 'Shader Graph' started by TheTalkingBoot, May 24, 2019.

  1. TheTalkingBoot

    TheTalkingBoot

    Joined:
    Nov 24, 2017
    Posts:
    33
    Hello!

    I think we are many in this situation: reproduce toon shading in shader graph!
    There is some tricks to achieve this but, for those who don't have the necessary knowledge, it can be insurmountable...

    So, are these template under consideration for a future update?

    Thanks!
     
    ph_ likes this.
  2. ph_

    ph_

    Joined:
    Sep 5, 2013
    Posts:
    127
    Hi there,
    I've created a plugin on the asset store which you can use to create any kind of custom lighting model (and there's a "toon lighting" provided).
    ShaderGraph Essentials on the asset store
    This particular feature requires Unity 2019.1+, the latest ShaderGraph package (5.13 at the moment) and is limited to LWRP. If you want to modify the toon lighting that I provide (as there are many way to do toon lighting), then you'll have to code a bit of HLSL too.
    There's a detailed showcase of how this feature work in this video:



    (this part starts around 3:00), but don't hesitate if you have any question.
     
  3. TheTalkingBoot

    TheTalkingBoot

    Joined:
    Nov 24, 2017
    Posts:
    33
    Thank you for your answer, your plugin looks cool but it's precisely the HLSL part that I would like to avoid.
    Currently I am looking to convert my toon shading from Amplify Shader.
    It is very particular and needs me to do NdotL myself.
     
    ph_ likes this.
  4. ph_

    ph_

    Joined:
    Sep 5, 2013
    Posts:
    127
    Yes to do any custom lighting in my plugin it uses the "Custom function node" introduced by Unity in 5.13, and so requires HLSL.
    If you want to do everything in SG, then all tutorials I've seen (like this famous one https://connect.unity.com/p/zelda-inspired-toon-shading-in-shadergraph) use an Unlit master. It will work for scenes with simple lighting, but receiving shadows and being affected my multiple lights will be very difficult to achieve.
     
  5. Battey

    Battey

    Joined:
    Nov 12, 2016
    Posts:
    2
    Hello,

    can we pls get an answer from dev team if this is planned or will never happen?
     
    Last edited: Jun 1, 2019
  6. MrKilljoy

    MrKilljoy

    Joined:
    Aug 19, 2015
    Posts:
    8
    Would like that as well. Being forced to input light data (not provided by builtin nodes) into the Emission field feels more like a hack than a proper way to approach the problem.
     
  7. Battey

    Battey

    Joined:
    Nov 12, 2016
    Posts:
    2
    well i guess we will not get a reply from dev team here....
     
  8. pbritton

    pbritton

    Joined:
    Nov 14, 2016
    Posts:
    14
    Is there any updates to this because rely on external scripts for data such as LightPosition, Direction, Color, Intensity and Attenuation seems rather redundant especially since the data is already in the shader somewhere.
     
  9. alexanderameye

    alexanderameye

    Joined:
    Nov 27, 2013
    Posts:
    923
  10. pbritton

    pbritton

    Joined:
    Nov 14, 2016
    Posts:
    14
    Thank you but unfortunately I need it for HDRP. :(