About to start a mobile iOS project, curious if anyone knows the perf impact of using alpha for environment objects?
Foliage, mountain mists (cards), water, etc.
When I worked on a Wii game a couple years ago, alpha blend was too expensive for us except in limited ways (water surfaces mostly), alpha test was OK but we had to cut the meshes close in to minimize the amount of tested area (foliage, particles). And even then we had to be careful.
Any insights would be great.
Replies
but well - alpha is just pretty expsensive and overdraw and fillrate are severly limited on mobile if you want to ship on a broad range of devices.
so, in the end just do the regular optimization thingies like keeping drawcalls low, keep overdraw low etc..
Overdraw is a problem for either, but there's something about alpha test that makes the entire til tile need an extra pass.
I've worked with the PVR sdk a little, wondering if Unity takes care of everything, or if it helps to get down n dirty. Like I remember cube maps had seams in PVRTC, needed border padding pre-pro to fix.
Well, I've got a bit of testing to do, will try to share any results.
I'm thinking about foliage mostly, but also decals.
IIRC PVR used to have tile-based sorting, which had virtually no alpha sorting errors. I wonder if the iPhone chipsets still have that?
Ultimately, I think it depends on the type of game you're making and the camera angle. Isometric camera is probably more forgiving given that there are relatively few assets on screen that it would need to sort. First person views of a horizon with foliage would result in lots of overdraw. I suspect that would be problematic using alpha test.
I'd be interested to see what kinds of things you've run into Eric
"Instead of using alpha testing or discard instructions to kill pixels, use alpha blending with alpha set to zero. The color framebuffer is not modified, but the graphics hardware can still use any Z-buffer optimizations it performs. This does change the value stored in the depth buffer and so may require back-to-front sorting of the transparent primitives."
More info in the link under the heading "Use Hidden Surface Removal Effectively"
Regarding a wheat field: looks like you've similar concerns to the wii, but you should have a lot more vertex processing power available.
If you're doing an isometric thing, consider actually making polygon wheat rather than alpha cards. With mesh batching it might wind up faster than dealing with that much overdraw.
can always just whip up a test and profile it.