issues on shadow volume

Thanks to zeoverlord and Keith Z. Leonard’s help on shadow mapping.
Just now I implemented my own shadow volume, according to
Title: Practical and Robust Stenciled Shadow Volumes for Hardware-Accelerated Rendering
I found some artifacts in the result:
In the red circle, the self shadow is aliasing.
In the green cirecle, the teapot’s shadow is broken.
(Note teapot is made directly by 3dsMAX)
How can I resovle them?

I am not well informed about shadow volumes, but are the artifacts at grazing angles correspond to meshes polygons? It is like you are doing occlusion per face instead of fragment.

the red ring is a natural artifact, shadow volumes handle curves and spheres badly, it’s solved by creative 3d artists that could work around this problem.
The green ring is because the the stencil testing part doesn’t work properly, are you sure you have more than 1 bit stencil, you need 8 bit.

Yes. I did occlusion per triangle. I do wish I can program shader, however my video card is Intel 945GM, which supports this feature badly…

I guess intel 945 GM supports 8 bit. This morning I found the teapot model is not closed(see the picture below). Could it be the reason?


meshes for shadow volumes need to be closed because they rely on adjacent faces and their edges.

well that all depends on how good your engine is, my engine only requires that no back faces are visible to the light, as it uses only light facing polygons for shadowing and doesn’t care about the rest.

But in this case then yea, it has to be closed.

im calculating shadow volumes on startup and extrude them in a vertex shader. while building volumes the code makes sure it deals with closed polygons, those where adjecent faces are present.
so yes, engine dependent.

maybe i should try shadow volumes in geometry shader.

This may seem a silly question, as I have not looked at shadow volume stuff in about 8-9 years, are you backface culling? If not the closed mesh issue is what is causing your cracks. If there are cracks in a model, light will leak through, so to speak. In the real world the inside of the mesh would occlude that light from your floor plane, but if that geometry doesn’t get sent through, then nothing is occluding that light, right?

I think that’s the problem, I decide to use shadowmapping in my engine since it’s more robust than shadow volume.
Yesterday I bought a new laptop, which supports cg 2.1. so I think i could implement stage-of-the-art shadowmapping algorithms on it:) I’ve been looking forward to this kind of hardware for a long time.
by the way, I have to say this is the best forum i’ve ever seen.
everybody is very very kind. thank you very much:)