Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. Join us on Thursday, June 8, for a Q&A with Unity's Content Pipeline group here on the forum, and on the Unity Discord, and discuss topics around Content Build, Import Workflows, Asset Database, and Addressables!
    Dismiss Notice

Question Only include keyword when shadow cascades is enabled (Shader Graph OR HLSL)

Discussion in 'Shader Graph' started by DevDunk, Mar 23, 2023.

  1. DevDunk


    Feb 13, 2020
    I have a bug with a shader breaking when shadow cascades is disabled, while I still multi_compile the shadow cascade keyword in the HLSL (or shader graph). Is there a way to only do this when shadow cascades is enabled?
    I cannot find a preprocessor for this, so maybe someone knows here

    #pragma multi_compile _MAIN_LIGHT_SHADOWS_CASCADE