Login  Register

Rendering transparent triangles with opengl...

Posted by ManuelBrotz on May 22, 2015; 10:47am
URL: https://forum.jogamp.org/Rendering-transparent-triangles-with-opengl-tp4034507.html

Hello

I am new to opengl and have a problem.
I want to render some semi-transparent, overlapping triangles using opengl. The rendering works, but the triangles don't look right.

What do i have to do, to make them look the way i want?

I have attached an eclipse project with the source i used to render both images below.
Triangles.zip

Please note, that you will only see the difference between the two files when you use the attached eclipse project to generate them on your own machine!

The opengl rendering seems to get the alphablending wrong. I think, the alpha channel of a rendered triangle always replaces the alpha channel of the pixels below the triangle. This is not what i want!

Any help is appreciated!

Manuel Brotz

See below for example images!