graphics shaders: discard vs transparency

来源:互联网 发布:cad软件安装教程 编辑:程序博客网 时间:2024/05/21 22:43
One final additional capability in fragment shaders that should be mentioned
is the discard operator. This is used to discard pixels so they will not be
passed to the framebuffer. Note that this is quite different from having the pixels
made transparent by setting their alpha color value to zero. Pixels with zero
alpha still have a depth value and are recorded in the depth buffer, so they

mask any pixel that might lie behind them.

就是是否写depthbuffer了。以前没想过这个问题。

原创粉丝点击