gpt4 book ai didi

c++ - glColorMask 是否影响 glClear

转载 作者:塔克拉玛干 更新时间:2023-11-03 00:08:09 27 4
gpt4 key购买 nike

假设在下面的代码之前绘制了一些东西,下面的代码应该做什么?

glColorMask(GL_FALSE, GL_FALSE, GL_FALSE, GL_TRUE);
glClearColor(0.0, 0.0, 0.0, 1.0);
glClear(GL_COLOR_BUFFER_BIT);
glColorMask(GL_TRUE, GL_TRUE, GL_TRUE, GL_TRUE);

这段代码应该只将 alpha 设置为 1 还是会清除颜色缓冲区?

或者换句话说,glColorMask 会影响 glClear 的作用还是它只适用于正常的绘制操作?

我特别询问关于 OpenGL ES 2.0 的问题,因此任何对规范的引用都将不胜感激。

最佳答案

它只会清除 alpha channel 。

The pixel ownership test, the scissor test, dithering, and the buffer writemasks affect the operation of glClear

关于c++ - glColorMask 是否影响 glClear,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/12475369/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com