Jump to content

View more

Image of the Day

WIP title screen for #DeathOfAPartisan #screenshotsaturday #gamedev https://t.co/qJNhfZCvd4
IOTD | Top Screenshots

The latest, straight to your Inbox.

Subscribe to GameDev.net Direct to receive the latest updates and exclusive content.


Sign up now

Stencil shadow volumes - general tips and advice?

4: Adsense

Old topic!

Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.


  • You cannot reply to this topic
No replies to this topic

#1 mv348   Members   

263
Like
0Likes
Like

Posted 29 January 2013 - 01:01 PM

Hello!

 

After much hard work I have just finished my first implementation of stencil shadow volumes. It works perfectly about 98% of the time. But every now and then I see a small artifacts appear in isolated regions. It is so infrequent that it is probably acceptable but I think it might be worth going the extra mile to hunt down these artifacts.

 

But before I do that, I was wondering if anyone could offer some general tips or common sources of error that can create occasional artifacts.

 

Here are some of the measures I have tried (based on papers/articles i've read) to eliminate artifacts:

 

1. when determining if a triangle is facing the light, i take the dot product of the light-to-triangle vector with the triangle normal, and I return true if dotProduct > epsilon, where epsilon is a small positive value, rather than just zero.

 

2. when creating the front and back faces of the volume, I move the front-face along the direction of the light-vector by a small epsilon. Presumably this is because  "due to floating point errors we might encounter bizarre corruptions where the volume hides the front cap". Not sure i fully understand this but I thought it was worth a shot.

 

Neither of these fixed the occasional appearance of artifacts. Does anyone have any more tricks or tips that might help?

 






Old topic!

Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.