- Home /
Using alpha or masks in materials
Hello, everybody!
I need your help. I'm creating a game for iPhone and I need to create texture with transparent parts. In some document about iPhone restrictions i've found following: "alpha is allowed, but not recommended due to performance reasons, better use masks". I didn't found any information about masks in unity. As I understood it's something relative to shaders...
Can you give me some advise or example how can I create transparent texture that will work on iPhone properly?
Answer by Jessy · Dec 23, 2010 at 11:21 PM
That advice you got is from the Shiva manual, and means nothing, at least in English. If something needs to be transparent, then you need to alpha blend it; you can possibly make the blending faster if additive blending is acceptable, instead of alpha blending. Alpha-testing kinds of materials, while fast on other platforms (and used widely on the PlayStation 1 and N64, for example, for that reason), do not play nicely with the deferred rending approach utilized by the POWERVR hardware used in iOS devices. As such, it is generally preferable to use more triangles, instead of alpha testing, unless you have intricate cutout shapes.
Answer by Paulius-Liekis · Dec 23, 2010 at 08:11 AM
I think it is referring to alpha-test. Alpha-test is faster than alpha-blend. Alpha-blend can be performance bottle neck on iPhone, because it can't do much overdraw, but you shouldn't be scared of it, for example you can't really make any decent UI without alpha-blend. So you can use alpha-blend, just don't overuse it.
Alpha blend is faster than alpha test on iPhone as far as I know.
The operation itself? You should always consider that with alpha-test you can write into z-buffer, this way reducing overdraw. Sure, you can write into z-buffer with alpha-blend, but people do not tend to do that. Anyway, I do not claim to be an expert in mobiles.