Author Topic: Widget transparency  (Read 7550 times)

Alessaint

  • Jr. Member
  • **
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 67
    • View Profile
Widget transparency
« on: October 24, 2012, 08:31:27 AM »
Hi,

we have a problem with color of simple white GUI interface, or more precisely with it's transparency - basically the sprites look slightly different when rendered via Unity GUI Text and NGUI. The NGUI one looks as if there were actually two images rendered over one another and their alpha channels added up (the tint is default white - (255,255,255,255)).

Please take a look at this:

 

Can you think of any reason why is it so / if there's any way how we could make it work better?

Regards,

Ales

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: Widget transparency
« Reply #1 on: October 24, 2012, 04:50:56 PM »
NGUI's default shader is straight up alpha blending. I don't know what shader is used by the GUI.

Alessaint

  • Jr. Member
  • **
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 67
    • View Profile
Re: Widget transparency
« Reply #2 on: October 25, 2012, 04:04:04 AM »
So if I understand correctly NGUI sprites are displayed with the basic builtin shader Unlit/Transparent Colored and are in no way adjusted?

I'm asking because we've tried to place the texture on a plane using this very shader and when compared to the one rendered by NGUI it looks different - it looks the same as the one rendered by Unity GUI system does...

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: Widget transparency
« Reply #3 on: October 25, 2012, 06:43:49 AM »
Unlit/Transparent Colored is a shader that comes with NGUI. It's not built-in.

There is no reason why it would look different when placed on a plane, unless your plane was somehow tinted.

All NGUI does is creates geometry -- geometry that gets drawn like any other mesh using the shader of your choice, specified on the material used by the atlas.

Alessaint

  • Jr. Member
  • **
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 67
    • View Profile
Re: Widget transparency
« Reply #4 on: October 25, 2012, 06:45:38 AM »
I see. Thanks for the reply.