Search Unity

  1. Unity 2019.2 is now released.
    Dismiss Notice

Shader Graph - GetMainLight() Not working

Discussion in 'Shaders' started by Sark_Klimento, Jan 28, 2019.

  1. Sark_Klimento

    Sark_Klimento

    Joined:
    Jan 17, 2019
    Posts:
    9
    I trying to create my shader graph node that returns Light Information. For now i using the example from here https://gist.github.com/bitinn/72922a0a69f6d723d94e94f2fc21230e
    But i have some problem - #ifdef LIGHTWEIGHT_LIGHTING_INCLUDED is always false , also - GetMainLight() not found. So how do i fix it ?
    I'm using Unity 2018.2.3.f1 / Lightweight RP 4.8.0 / Shader Graph 4.8.0 .
     
  2. WooSukChoi

    WooSukChoi

    Joined:
    May 13, 2019
    Posts:
    1
    olemidt1 likes this.
  3. olemidt1

    olemidt1

    Joined:
    Mar 22, 2018
    Posts:
    2
    Thanks, my node finally compiled now. I just added a line at the top of my custom node string
    #include "Packages/com.unity.render-pipelines.lightweight/ShaderLibrary/Lighting.hlsl"