Search Unity

inconsistent alpha output of opaque built-in shaders

Discussion in 'Shaders' started by roomle_atti, Jan 21, 2015.

  1. roomle_atti

    roomle_atti

    Joined:
    Aug 28, 2014
    Posts:
    1
    Hi folks,

    I'm in the situation that I need to render some things into a RenderTexture including a valid alpha value.

    I would assume that a shader that produces a fully opaque result would also write a 1 (full white) into the alpha channel of the RenderTexture, but some actually write the alpha value of the material's color (even though it has no effect on the RGB output itself) and some simply don't write into the alpha channel at all.

    Feel free to test it and compare "Mobile/VertexLit" versus "Mobile/VertexLit (Only Directional Lights)".

    Looking at the source I see that those two are completely different under the hood, but I still don't know what causes the behaviour or how I could resolve it.

    Any clever hints?