We are running a survey to help us improve the experience for all of our members. If you see the survey appear, please take the time to tell us about your experience if you can.
Greetings,
I'm currently experimenting OpenGL ES 2.0 with a little tile based 2D game.
After fiddling a bit with rbga5551 transparent textures, I found I had to enable blending in order to make the last transparency bit work.
However, given how blending works and the fact I only need binary transparency (1 bit for alpha → visible/invisible), I'm wondering if it would be better to either :
Since I do not know how to micro-benchmark and measure performance¹ of embedded OpenGL programs, I'm asking this question here :
For binary transparency (visible/invisible) is it better to clip (vertex shader), discard (fragment shader) or just enable blending (rasterisation)
¹ : I tried to use Streamline but I could not install gator since I do not have the kernel sources of either my two Rockchip tablets, nor the kernel sources of my Kirin-based Honor 5 phone.
This might be worth a read in terms of actually getting some performance benefit out of the 3D hardware:
Mali Performance 7: Accelerating 2D rendering using OpenGL ES
If you really want to stick to a simple back-to-front render sequence then use clipping to coarsely get rid of parts which are not visible, and then just use blending for the rest - but this can leave quite a bit of performance on the table.
HTH, Pete
Interesting read.
If I understand your article correctly, given a character sprite with transparency, a tiled-level with transparent tiles and a background, I should :
If I associate clipped coordinates (one-time operation) to the transparent tiles of the level, will it be slightly better or worse ?