Jump to content

  • Log In with Google      Sign In   
  • Create Account

Stencil test and shader


Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.

  • You cannot reply to this topic
No replies to this topic

#1 Focusrite   Members   -  Reputation: 100

Like
0Likes
Like

Posted 20 April 2012 - 01:43 PM

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:
  • Draw point light onto stencil.
  • Apply shadow (ie. remove the drawn light where it does not reach, behind walls etc)
  • 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 Posted Image
[Not related to the company]

Sponsor:



Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.



PARTNERS