开发者

Bad (unattractive) blending in OpenGL with bright figures on dark background

开发者 https://www.devze.com 2023-04-12 02:53 出处:网络
I h开发者_如何学JAVAave a problems in OpenGL with blending (in result of antialiasing or textured painting). See problem illustration:

I h开发者_如何学JAVAave a problems in OpenGL with blending (in result of antialiasing or textured painting). See problem illustration:

Bad (unattractive) blending in OpenGL with bright figures on dark background

I have the following setup code

// Antialiasing
glEnable(GL_POINT_SMOOTH);
glEnable(GL_LINE_SMOOTH);
// Blending
glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
glEnable(GL_BLEND);
// Texture font
glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST);
glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP);

Please, point me to the solution of this problem.


OpenGL blends in a linear RGB color space, but your monitor is not linear. This causes the apparent alpha to change depending on whether the background is light or dark. Try using the GL_EXT_framebuffer_sRGB extension.

0

精彩评论

暂无评论...
验证码 换一张
取 消