- Home /
iOS Transparent Texture Question
I'm working on an iOS project and I have a scene that uses one texture as an atlas for lots of objects textures. One of those objects uses transparency.
Is it best to keep it to one texture with a small section which is transparent, or to put the transparent map in a separate texture?
Answer by Eric5h5 · Nov 04, 2013 at 12:12 AM
It doesn't really matter; what actually matters is what shader you're using in the material. If you only use a transparent shader for the object that needs it, that's fine. If you're using a transparent shader for all objects regardless, that's bad.
But wouldnt the shader used be defined by the material? So in an atlas like I described it would be best to separate the transparent sections into their own texture/material?
I was just concerned about increasing draw calls / texture changes.
No...you should use a material with a transparent shader for the transparent object, and a material with a non-transparent shader for the rest. As I said, it doesn't really matter if you separate out the transparent part of the texture. You would be using two materials regardless.
You will get an extra draw call for each material. If you are not worried about fill rate too much then I advise to use just one material and keep it transparent. If you do have a concern about the fill rate then it is best to have two materials as Eric5h5 suggested.
It's 100% guaranteed that making everything transparent will be much worse than just having an extra draw call because of having two materials.
Even on iOS which has fill rate limitations?
Thanks for your advice I appreciate it.
Your answer
Follow this Question
Related Questions
Texture changes brightness at random – why? (on iPhone) 0 Answers
use Alpha from image in Fragment shader 0 Answers
show video frame on texture in ios 1 Answer
transparent background with GUI.DrawTexture 0 Answers
[ problem ] transparent shader !!! 1 Answer