Search Unity

Help Wanted Can Shader Graph use define toggle?

Discussion in 'Shader Graph' started by sevelee, Aug 7, 2019.

  1. sevelee

    sevelee

    Joined:
    Apr 5, 2017
    Posts:
    18
    In normal Unity shader, we can use [Toggle] to enable or disable a define keyword in shader so that you can control whether a function is on or off in a shader.
    But it seems that shader graph doesn't have a such function.
    Can some one help?
     
  2. A132LW

    A132LW

    Joined:
    Jun 21, 2017
    Posts:
    17
    I think the boolean logic nodes work in place of a [Toggle].
     
  3. alexandral_unity

    alexandral_unity

    Unity Technologies

    Joined:
    Jun 18, 2018
    Posts:
    89
    No, the boolean nodes do not work like keyword definitions, they won't strip parts of your shader based on the toggle. We're currently in the process of implementing keywords properly, and we're hoping to release it soon.
     
    stalker_shin, A132LW and ph_ like this.