在OpenGL中渲染对象时消除颜色通道

Gha*_*uni 2 opengl

我想知道如何在OpenGL中渲染一些对象时消除红色通道.

我可以使用片段着色器轻松完成此操作,但遗憾的是我无法为此特定项目使用着色器.

Disable the red channel
DrawOject();
Enable the red channel
Run Code Online (Sandbox Code Playgroud)

这有什么解决方案吗?

dat*_*olf 5

glColorMask(GL_FALSE, GL_TRUE, GL_TRUE, GL_TRUE);
Run Code Online (Sandbox Code Playgroud)