Search Unity

Blend Opaque and Transparent shaders

Discussion in 'Shaders' started by imaewyn, Apr 3, 2017.

  1. imaewyn

    imaewyn

    Joined:
    Apr 23, 2016
    Posts:
    211
    Hello. I have shader with two passes (each works fine separately).
    First of this is opaque (for coloring) and second - transparent.

    Which adjusts I need to change for this passes for using alpha from second pass.
    I've tried to set blend mode for second pass like Blend SrcAlpha OneMinusSrcAlpha but maximum which I have its blending colors without alpha. Result is always nontransparent
     
  2. bgolus

    bgolus

    Joined:
    Dec 7, 2012
    Posts:
    12,343
    The opaque pass will always be opaque, a separate transparent pass cannot make an opaque pass transparent, nor can one pass really have an effect on another pass in the way you are going about it.

    The solution is to use a single pass, not two passes, or much more complex render texture setups.