Search Unity

How are you meant to include Lighting.hlsl?

Discussion in 'Universal Render Pipeline' started by SgerbwdGwyn, Mar 19, 2021.

  1. SgerbwdGwyn

    SgerbwdGwyn

    Joined:
    Dec 2, 2013
    Posts:
    25
    If you include Lighting.hlsl in the CGINCLUDE block of a shader in URP, you get redefinition errors (Redefinition of _Time, PackHeightmap etc.), but if you include the Lighting cginclude files (AutoLight.cginc, Lighting.cginc, UnityLightingCommon.cginc), you don't have access to anything like the Light struct or the GetMainLight function

    How should I be using Unity's built-in Lighting information in a shader?