• Advertisement
Sign in to follow this  

Stencil test and shader

This topic is 2160 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

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?

Focusrite smile.png

Share this post

Link to post
Share on other sites
Sign in to follow this  

  • Advertisement