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. We have updated the language to the Editor Terms based on feedback from our employees and community. Learn more.
    Dismiss Notice
  3. Join us on November 16th, 2023, between 1 pm and 9 pm CET for Ask the Experts Online on Discord and on Unity Discussions.
    Dismiss Notice

Shader blocks separation commands #if #ifdef #if defined #ifndef

Discussion in 'Shaders' started by vladstorm_, Oct 17, 2015.

  1. vladstorm_

    vladstorm_

    Joined:
    Nov 26, 2013
    Posts:
    184
    Hi,

    What is there difference between these commands in unity shaders:
    #if FEATURE
    #ifdef FEATURE
    #if defined(FEATURE)
    and
    #ifndef FEATURE

    ?
    I hope first 3 are equal and the last mean if FEATURE is not defined. but im not sure.
     
  2. colin299

    colin299

    Joined:
    Sep 2, 2013
    Posts:
    176