This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

For binary transparency : Clip, discard or blend ?

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 :

  1. Generate useless coordinates for transparent tiles (i.e. : -45000.0,-45000.0) in order to get them clipped automatically after the vertex shader pass;
  2. Discard transparent pixels in the fragment shader;
  3. Just enable blending.

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.