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
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了。以前没想过这个问题。