Author Topic: Do NGUI shaders produce an alpha channel?  (Read 6619 times)

Fordeka

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 20
    • View Profile
Do NGUI shaders produce an alpha channel?
« on: October 08, 2012, 10:19:19 AM »
Using the Unlit Transparent Colored shader for my UISprites, will the resulting frame have an alpha channel or will it just be flat blended RGB? For example, when I try to get the source of the camera rendering a UISprite in OnRenderImage and use a shader to render its alpha channel to its red channel the whole screen appears red, suggesting that there is no alpha channel at that point. I looked at the shader itself but I don't know much about how ShaderLab works, just frag/vert so I would appreciate the help.
« Last Edit: October 08, 2012, 10:22:33 AM by Fordeka »

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: Do NGUI shaders produce an alpha channel?
« Reply #1 on: October 08, 2012, 04:35:22 PM »
I think NGUI shaders specify ColorMask RGB. Removing this line will also write alpha.

Fordeka

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 20
    • View Profile
Re: Do NGUI shaders produce an alpha channel?
« Reply #2 on: October 11, 2012, 12:46:07 PM »
Thanks, I will try that.