Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

Preprocessor issue with #if and #include

Discussion in 'Shaders' started by KarlosZafra, May 4, 2017.

  1. KarlosZafra

    KarlosZafra

    Joined:
    Sep 8, 2016
    Posts:
    18
    Is this the expected behaviour of the preprocessor?

    I have this in my shader:


    Code (CSharp):
    1.  CGINCLUDE
    2.         #undef FOO
    3.         #ifdef FOO
    4.                 #include "foobar.cginc"
    5.         #endif
    6. ENDCG
    then in the Editor I get this error.