Stencil test and shader

Started by
-1 comments, last by Focusrite 12 years ago
Hello Gamedev,
I'm working on a 2d shadow system (by drawing to an alpha layer texture, which blends the world accordingly) and require a stencil test to make multiple light sources to work propperly.
However, there's an issue with the stencil test when it passes through the shader, it still renders. The "algorithm" used is:

  1. Draw point light onto stencil.
  2. Apply shadow (ie. remove the drawn light where it does not reach, behind walls etc)
  3. Render the point light to the alpha layer where stencil allows (ie. where shadows haven't removed)

The render, step 3, has to pass through the shader and isn't blocked by the stencil, and it's completely rendered onto the alpha layer, is there any way you can make the shader too be blocked by the stencil test?

Regards
Focusrite smile.png
[size=1][Not related to the company]

This topic is closed to new replies.

Advertisement