PDA

View Full Version : issues on shadow volume



chensb
10-08-2008, 11:34 AM
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 (http://arxiv.org/pdf/cs/0301002v1)
I found some artifacts in the result:
http://www.imageuploading.com/ims/pic.php?u=17027dShI2&i=107998
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?

dletozeun
10-08-2008, 04:19 PM
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.

zeoverlord
10-08-2008, 05:34 PM
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.

chensb
10-08-2008, 10:54 PM
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.

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...

chensb
10-08-2008, 11:04 PM
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.


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?
http://www.imageuploading.com/ims/pic.php?u=17027dShI2&i=108003
http://www.imageuploading.com/ims/pic.php?u=17027dShI2&i=108004

zeoverlord
10-09-2008, 01:43 AM
yes

_NK47
10-09-2008, 03:02 AM
meshes for shadow volumes need to be closed because they rely on adjacent faces and their edges.

zeoverlord
10-09-2008, 03:56 AM
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.

_NK47
10-09-2008, 04:12 AM
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.

Keith Z. Leonard
10-09-2008, 10:56 AM
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?

chensb
10-11-2008, 08:36 AM
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:)