I’m having real problems with volumetric shadows, using a Geforce 2 and opengl. I appear to be getting gaps between triangles, sharing a common edge, rendered into the stencil
buffer.
When they are rendered into the stencil buffer, and the scene is re-rendered with lighting enabled, pixel sized gaps beween the shared edge (a to c) are coming through, resulting in pixels of the green texture (of the terrain) showing through in the shadow. It is obvious that some pixels arent getting set correctly in the stencil buffer, but is this because of something I’m not setting in OpenGL, or due to the way opengl’s line drawing is handled?
That should not happen. You should probably post more of your code here so we can see what OpenGL state you have set. If you’re using glPolygonOffset, that might cause it (but probably not).
Now, that being said, you are actually using the exact same vertices, correct? You aren’t using one set of vertices for the first poly and another set for the second, correct? Even if they look the same, they could be subtly different in their floating-point representation. In order for that edge to have no cracks, the line must be defined by the exact same floating-point values.
yup, they are exactly the same, and im not using polygonoffset. The example above produces a crack…and the vertices are the same. I think i know what the problem is, plz refer to my post above
i dont know if this is it (i havent used stencil that much)
perhaps post a small snipet of the stencil code.
ive got a feeling youre doing something like drawing one tri into the stencil, + then when you draw the other tri along the edge because how the stencil is set up, the edge pixels are being removed.
sorry bad explanation