Because the far end of the pyramid has been moved closer to us (to keep it inside the far clip plane) the fragments of the entire pyramid are too close to us - almost like a poor-man's polygon offset. In the picture we see this in the form of incorrect volume intersection. There is one hitch: the actual Z test is no longer correct.
#FSAA UTILITY FOR MAC GAMES WITHOUT ANTIALIASING FREE#
The "perspective" is created by dividing X and Y by W - we're free to completely whack Z without deforming the geometry as long as we are post-frustum-transform. This is because the position edit is done in clip space, and clip space is orthographic - X and Y turn into raster positions and Z into a depth position. The actual screen-space position of the view volume does not change. What's nice about this hack is that it is entirely in vertex shader, which means that we don't do anything that could inhibit the GPU's ability to do early or optimized Z culling. (W tends to negative for standard glFrustum matrices.) Gl_Position.z = clamp(gl_Position.z, gl_Position.w,-gl_Position.w) This can be done in the vertex shader with something like: If depth clamp isn't available, one alternative is to restrict the Z position of each bounding volume vertex in clip space.
When we actually rasterize, we don't get any light spill - the result is a vertical clip in our light, visible on the top of the fuselage. Note the vertical line where the back face is missing. But what if you don't have this extension? The simple solution is obvous: use GL_depth_clamp to the near and far clip planes instead of clipping. This last case shows up as a really weird looking bug in X-Plane: when the landing light is on and pokes out the far clip plane, we can get a cut-out that removes other area lights that cover the screen-space intersection of the landing light volume and the far clip plane. This in turn can interfere with other lights that cover the same screen space. If we have geometry in front of the entire light, it will end up off-by-one in its surface count.
Typically this is done using either a billboard or a bounding volume around the light.To save fill rate when drawing deferred lights, we want to draw a geometric shape to the screen that covers as few pixels as possible - preferably only the ones that will be lit.Using two sided stencil volumes to improve fill rate with deferred lights is not new I'll write more if anyone wants, but this is all stuff I got off of the interwebs.