有谁知道如何在OpenGL中实现以下效果:
- 改变渲染场景的亮度
- 或者在OpenGL中实现Gamma设置
if( brightness > 1 )
{
glBlendFunc( GL_DEST_COLOR, GL_ONE );
glColor3f( brightness-1, brightness-1, brightness-1 );
}
else
{
glBlendFunc( GL_ZERO, GL_SRC_COLOR );
glColor3f( brightness, brightness, brightness );
}
glEnable( GL_BLEND );
draw_quad();
http://www.gamedev.net/community/forums/topic.asp?topic_id=435400 可能是你问题的答案,否则你可以尝试实现一个像素着色器来进行伽马校正。