Soft Stencil Shadows

Downloads

SoftStencils.rar [776Kb] – C# 2.0 (VS.NET 2005)

Description

This demo demonstrates a technique that fellow forum user kTech proposed in the Beta Discussion forum to smooth otherwise hard stencil shadows. It uses screen-space blur of the shadow pass to smoothen things out.

Features

  • Uses standard TV stencil shadowing, but adds another pass to smooth them out
  • A custom gaussian blur shader or TV’s glow effect can be chosen to perform the blurring
  • A simple color multiplication shader is used to blend the blurred shadows to the scene
  • The shaders are now Shader Model 1.4-compatible, but SM2.0 is preferred

Known Problems

  • Since there is no depth testing (yet) performed while blurring, some “shadow bleeding” occurs, moreso when using self-shadowing
  • Some users experienced “shadow acne” problems with self-shadowing; shadow noise on the surfaces. I have seriously no idea what causes it…
  • Screen-space blurring looks good, it’s fast, but it has many problems. For instance, the more you look away from the shadow, the more it will be blurred, which is really unrealistic…

Screenshots

One thought on “Soft Stencil Shadows”

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.