I have an issue which I don’t know how to solve.
I have two overlapping polygons which are alpha blended. The problem is that the place they overlap eachother is much darker than the rest.
Is there any way to avoid it and have the same alpha even there they overlap?
Well, the usual way color alpha-shadding is calculated is basically
FinalColor = Color1alpha1 + (1-alpha1)Color2alpha2 + [other polygons] + (1-alpha1)(1-alpha2)*BackgroundColor
This being the case, if you only have one polygon, your color values will always be lower than if there is an overlap, since you then don’t have all those other additions.
What is your blend func ?
It looks like this:
And i want it to look like this:
this is the function i use to achieve transparency.
How do i do that?
//Sorry but i’m completly new in OpenGL
Search for opengl stencil tutorials, that should get you started.
When you ask for a stencil buffer, it will store a number for each pixel, and can test for specific values to restrict drawing to some pixels.
What you want to do is similar to :