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 error .. operator must have matching types

Discussion in 'Shaders' started by Griffo, Mar 14, 2015.

  1. Griffo

    Griffo

    Joined:
    Jul 5, 2011
    Posts:
    698
    Hi,

    I've just installed Unity 5 and now are getting an error in a shader, the problem line is ..

    o.Emission = res < 0 ? 0 : res;

    And the error is ..

    Shader error in 'Effects/Dissolve': second and third operands of ?: operator must have matching types at line 38 (on metal)

    Can someone tell me how to correct this please, thanks..
     
  2. WhiteSkullDev

    WhiteSkullDev

    Joined:
    Mar 14, 2015
    Posts:
    8
    have you tried changing the 0 to 0.0 ?
     
  3. Griffo

    Griffo

    Joined:
    Jul 5, 2011
    Posts:
    698
    WhiteSkullDev thanks for the input, the developer got back to me with a new shader that works ..