Skip to main content
gamedev.net
🔒 Locked

ShadowVolume Issues

Started by PornAgainChristian 1 reply 1k views
Original Post
PornAgainChristian
PornAgainChristian
I recently implemented shadow volumes in my engine, and I'm having a bit of trouble with them. Specifically what I am seeing is the 'notching' issue mentioned by Chris Brennan in his ShaderX article. When shadowing a skinned mesh, sometimes missing notches appear in the shadow due to normals on a face angling in different directions from the face normal. Brennan makes mention of a method for fixing this - averaging the weights across the face. But he only mentions this in brief, and doesn't explain it fully. I've tried implementing this blindly - averaging the weights across the face and picking the N highest, then flooding them into the vertices - but this doesn't work at all. It actually tears my shadow volume apart. Does anyone know of a source that more fully explains what needs to be done to fix these issues with skinned object shadows?
Zealot
Zealot
Hmm, don't know any resource to help you out, but the article links to a series of demos from ATI, and one is supposed to have a corrected algorithm. Do the demos come with code? Might not be that useful even if they do, but it could be worth a shot.

If not, you say that you're flooding the normal value of the face into the vertices' normals for that face? That kinda sounds like what he said do, but I don't have a clue why it would tear up the shadow volume, as I'd suspect that the averaged normal shouldn't be too different from each vertex's. Are you sure you are averaging the vertex normals correctly?

After reading the article, it seems that this is caused by all of the vertices' normals not being aligned right? Using the face's normal would seem to be the only solution, so maybe instead of just averaging the vertex normals, just calculate the plane's normal and use it for each vertex?

Mentions weighting though, and I've got no idea on how to help you there...

Good luck though, sorry I can't really help.
----------------------------------------------------------You know, I might as well go ahead and say I can't fix the problem... because that's when I figure out how.
PornAgainChristian
PornAgainChristian
NP, thanks for the reply. The terminology is actually what confuses me. It is quite possible for the vertices that share a face to not all be assigned to the same bones, so simply 'averaging' the weights doesn't do it - you have to average all the weights for all the contributing bones, then pick the top N contributors.

It's quite possible that the error lies in my code; but I did step through and verify that it is averaging correctly (I sum the weights for all contributing bones, pick the N highest, average the weights, normalize them to sum to 1, and flood them across the face's vertices).

At this point I'm actually leaning towards going with a shadow map, just because the volume solution is driving me crazy (and it has drawbacks of its own).

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.