- Home /
Transparency or more Geometry (what's best?)
Hello, we are building our first game and are taking a 2d approach, with many png's on simple planes for all the environment elements.
So my question is when is it better to use a transparent texture as opposed to cutting a few triangles instead?
On many cases such as with trees I suppose its better to leave the alpha channel do the work, but I tested a scene(single object FBX multiplied 48 times) with a building where I found out that 1,6k tris with no transparency was running on 105FPS and the same scene with transparency and 96 tris on 75FPS..
Generally I 'm using large textures 1024 and more often 2048 as we are targeting the iPad 3.
Answer by ScroodgeM · Aug 09, 2012 at 01:05 PM
best way is to use transparent alpha-cutout shaders in this case. then you'll get low poly geometry and non-transparent textures.
alpha cutout renders in one queue with opaque geometry, cause it has no % of transparency. it's only or transparent 100%, or opaque 100%
alpha-cutout! not just alpha 8)
Yes, the cutout has a better performance since it doesn't blend the color with the framebuffer, it just decides "write this fragment / pixel or not".
Although it depends on the platform; on iOS devices alpha is faster than alpha cutout (or at least that used to be the case; not 100% sure if that's still true on the latest hardware).
Really? That's strange, but i don't have an iPhone ;) Your fillrate concerns are of course right.
The PowerVR graphics hardware is quite strange compared to desktop GPUs. But interesting. (Tile-based deferred rendering = cool.)
Yes. This is due of the Hidden Surface Removal technique. There is a topic on imgtec forums: http://www.imgtec.com/forum/forum_posts.asp?TID=1128&title=question-about-alpha-test-performance
Answer by Eric5h5 · Aug 09, 2012 at 02:07 PM
It would be better for fill-rate if you cut out as much transparency as possible, even if it means added geometry. (Within reason of course...if you made vegetation purely through geometry, the billions of polygons might cause issues....)
Yeah that's pretty much what i got from testing too, a few hundreds of tris<1 alpha channel!