front to back blending issues on Linux

Hello

I’m implementing a front to back slice volume rendering and I am having issues with blending.

Basically I should be using glBlendFunc(GL_ONE_MINUS_DST_ALPHA,GL_ONE); but it does not work while on Linux using glBlendFunc(GL_ONE_MINUS_SRC_ALPHA,GL_ONE); works!!! I’m also testing on macbook and glBlendFunc(GL_ONE_MINUS_DST_ALPHA,GL_ONE); works there (as it should). Also with only glBlendFunc(GL_ONE_MINUS_SRC_ALPHA,GL_ONE); I am having issue when the background is white!!!

Would anybody know why this could be???

Versions of OpenGL
Macbook: Opengl 2.1
Linux: Opengl 4.1

Thanks
Pascal

It sounds like you have a drawable with a pixel format that does not have an alpha component (ie, RGB vs. RGBA). Try querying the number of GL_ALPHA_BITS via glGetInteger() and see if you have a non-zero value, like 8.

You are right. It was 0!!!

I’ve added GLUT_ALPHA to my glutInitDisplayMode and it now works.

Thanks a lot :slight_smile: