Self transparenting gui on device

its something i noticed and wondered about:
When one draws things using the OnGUI GUI.Label GUI.DrawTexture etc functions and then has several of those things above each other and then tests this on iPhone, the gui elements drawn first “shine through” the ones drawn on top of em, their silhoettes etc are visible through em as if the gui elements had a semi transparent alpha setting.
Just wondred how that comes, any idea? :slight_smile:

there are gui elemtns that are transparent, like GUI.Window or GUI.Box. i think even GUI.Label is transparent, but GUI.DrawTexture should use the images alpha channel.

You can give a GUIStyle as additional parameter to set your own alpha, or use GUILayout (the latter is not recommended for iphone development → sloooow)

Yeah, im usually avoiding the gui stuff as much as i can on iPhone, though in this case i´m working on someone else´s thingy as job and they made most things based on the gui functions.
And yup, there i noticed that various gui objects show textures as if transparent to some degree even if alpha is not set by the user at all or set to 1.
Its hard to see and usually, mostly noticable when certain brighter colored textures are above darker toned ones.
I thought though maybe if one could get around that semi transparency thing maybe that would have positive impact on performance of the gui features (cause i guess processing that transparency costs some performance,too).

Here´s an image, you can see how some things like the ring ropes shine through the character.

141006--5152--$shinethrough_510.jpg

Hi,

Did you use a 16 bit RGBA texture by any chance? I’ve noticed they are slightly transparent. Using a 32 bit texture will probably fix it then (at the cost of 2x the memory of course).

gr.jakko

ay, forgot about this thread…
yeah, you´re right, i just set it to rgba 32 instead of rgba 16 and then its not transparent anymore (where it shouldn´t be transparent :slight_smile: )
Here´s how it looks then:
(no ropes shining through in this case)

Using a rgba 32 bit texture is not really an option with big texture dimensions, its just way too much ressource usage.
Well, i´ll submit a bug report, maybe something can be done about it :slight_smile:

143386--5230--$alpha32looksgood_174.png

Something will definitely be done. Thanks :wink:

:slight_smile: