Search Unity

Blend Mode

Discussion in 'Shaders' started by 3DJayC, Nov 24, 2014.

  1. 3DJayC

    3DJayC

    Joined:
    Jul 29, 2014
    Posts:
    33
    Hello !

    I've done some researches but I don't find exactly what I'm searching for.

    It's a problem about "blending mode" as photoshop can do.

    I've got a sphere and I want it to disapear where it's black. But Black, due to the lighting.

    In fact, all surface tends to be black on screen will disapear... I'm not sure to explain my needs corectly.
    It can be like "Lighten" or "Screen" in Photoshop.

    Is there someone to help me with that?

    J
     
  2. tanoshimi

    tanoshimi

    Joined:
    May 21, 2013
    Posts:
    297
    I'm not quite sure I understand the scenario you're after, but "Lighten" overlay mode selects the lighter of either the source or destination colour. You can achieve this effect in a shader by setting:

    BlendOp Max
    Blend One One

    I think "Screen" mode multiplies the inverse of the blend with the base colour. So that would be:

    BlendOp Add (the default)
    Blend OneMinusDstColor Zero