1

I've search around and seems that glBlendEquation has some issues in Android, -GL_MAX/MIN is not even listed in the opengles specs

I need to find a workaround to GL_MIN blendEquation mode. Is that possible? I want to write to a color buffer only if the alpha there is greater than the pixel's alpha i'm trying to write. Is it possible to do it without any extension or using more than 1 texture?

Community
  • 1
  • 1
aacotroneo
  • 2,170
  • 16
  • 22

1 Answers1

0

The dirty solution I was trying to avoid is this. Using Frame Buffer objects and shaders to emulate the color buffer and the blending mode:

Modify existing shaders to blend the scene with an FBO_1, into FBO_2.
Render FBO_2 to the screen.

The next drawing call swap FBO_1 with FBO_2, as FBO_2 equals the color buffer.

An "unintrusive" and more inefficient alternative is to use 3 FBOs and a shader, and make an additional pass.

Render scene to FBO_1 //without any modification to existing shaders
Blend FBO_1 with FBO_2 into FBO_3 //with new shader.
Render FBO_3 to the screen.

The next drawing call swap FBO_2 with FBO_3. The only advantage of this alternative is that i dont have to modify the existing drawing logic.

I really don't like any of this ideas. I'll gladly accept better answers!

aacotroneo
  • 2,170
  • 16
  • 22