Skip to main content
gamedev.net
🔒 Locked

problem with shadows

Started by PiNtoS Jun 28, 2007 at 3:08 PM 1 replies 950+ views
Original Post
PiNtoS
PiNtoS
I'm trying to implement shadows, following Nehe's tutorial #27 (shadow volumes using the stencil buffer). The model I'm using has 6000 triangles, and I'm using an invisible model of about 2000 triangles to cast the shadows. I'm getting two types of problematic artifacts: First, this method naturally causes self-shadowing, which is fine, except the line between light and shadow looks pretty bad: Second, the shadow cast on the ground sometimes has holes, particularly around his neck: I'm following the tutorial pretty religiously, so you can take that to be my code. Is there any way of fixing either of these problems? Thanks!
FReY
FReY
Problem 1]
When using shadow volumes, you shouldn't have a 6000 triangle mesh self-shadowed by a 2000 triangle mesh. Think about it and you will see those boundaries between light & shadow are a natural result of doing just that.

Problem 2]
I suspect your shadow mesh is non-manifold at the neck. Your shadow geometry should have the following characteristics:
* no holes (ie. all triangles have a neighbour triangle at each edge)
* no t-junctions (all edges are shared by exactly 2 triangles)

do unto others... and then run like hell.
PiNtoS
PiNtoS
When using shadow volumes, you shouldn't have a 6000 triangle mesh self-shadowed by a 2000 triangle mesh. Think about it and you will see those boundaries between light & shadow are a natural result of doing just that.

I'm not sure what you mean - first of all, I initially had the same original mesh cast shadows, but that was just as bad (if not worse). Second, are you referring to the poly count or the difference between meshes? (I don't follow the "think about it" request.)

With regards to problem #2, I'm pretty sure that the mesh satisfies those constraints. What else could be the problem?

Topic Locked

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

Sign in to reply to this topic.