I want to render 2 overlapping, transparent sprites. But even where they overlap, the resulting color should not be different compared to the resulting color of one rendered sprite. I read about blending in OpenGL and i think, glBlendEquation(GL_MAX) is what i need. Here is my LibGdx example:

From your description, to me it sounds like you don't want blending enabled at all. Obviously I've got that wrong but perhaps you could explain a little more clearly or with a picture of what you want to be happening. Or perhaps it is just me being thick and everyone else will understand.

func = the function set by glBlendEquation(). This defaults to addition, in which case func() is a function that takes in two values and adds them together. GL_MAX = max() instead of addition.sourceColor = the raw color you're writing (RGBA).sourceFactor = the first argument to glBlendFunc().destinationColor = the color already in the framebuffer.destinationFactor = the second argument to glBlendFunc().

If you change the alpha value of the source color, the resulting RGB values are completely unaffected. To me it sounds like you want to multiply the source RGB values by the source alpha, which means you need to call glBlendFunc() with these arguments:

According to the OpenGl documentation, GL_MAX ignores the source and destination factors and only uses the rgba values.

But I figured it out by myself yesterday. I just did not fully understand how blending actually works when I opened this thread. I draw the sprites with glBlendEquation(GL_MAX) to an empty framebuffer now. Then I draw the framebuffer with glBlendEquation(GL_FUNC_ADD) and glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA) to the screen. It works like a charm now.

java-gaming.org is not responsible for the content posted by its members, including references to external websites,
and other references that may or may not have a relation with our primarily
gaming and game production oriented community.
inquiries and complaints can be sent via email to the info‑account of the
company managing the website of java‑gaming.org