I have this question for a long time. Let's say you have a plane and you want to display the pixels under the plane in black, and the ones above the plane in white. How I can know in the fragment shader at the time I calculate the color of the pixel, that its position is above or under the geometry? If someone found a solution to a similar problem I will be glad to heart about it. Or it can be simple as, if the pixel is located in the 3d space <0 I display it in black and in white otherwise.