Stencil shadows meant to look like this?

Posts: 49
Joined: 2006.07
Post: #1
I just implemented some basic z-pass stencil shadows, and am a bit disappointed with how they handle self-shadowing curves. The problem is that each polygon of the curve is either fully in shadow or fully out of shadow so the geometry becomes a lot more obvious... see the jagged line in this screenshot. Is that just a limitation of the algorithm or is it just my implementation of it?
[Image: shadow_sample.jpg]
Quote this message in a reply
Posts: 5,143
Joined: 2002.04
Post: #2
You need to make your lighting equation so that the far side of the object is completely dark; then you'll get a smooth line.
Quote this message in a reply
Posts: 1,140
Joined: 2005.07
Post: #3
Alternately, you could render your scene once only with ambient lighting, then another time after the stencil shadows so only the unshadowed parts get light. That way self-shadowing only looks different if the part that's being shadowed would usually be lit.
Quote this message in a reply
Post Reply 

Possibly Related Threads...
Thread: Author Replies: Views: Last Post
  SLOW performance drawing multiple polygons per frame with stencil buffer clam61 7 11,220 Apr 27, 2013 11:53 AM
Last Post: clam61
  Masking without a stencil buffer? Bachus 12 23,160 Sep 2, 2010 02:42 PM
Last Post: Skorche
  Window drop shadows NelsonMandella 9 9,911 Mar 21, 2010 02:34 PM
Last Post: NelsonMandella
  Making 2D Stencil Shadows Soft metacollin 16 23,449 Jul 22, 2009 01:59 PM
Last Post: NelsonMandella
  softening 2d shadows NelsonMandella 5 7,132 May 19, 2009 04:19 AM
Last Post: Najdorf