Nested Stencils?
Forum rules
Before you make a thread asking for help, read this.
Before you make a thread asking for help, read this.
- drunken_thor
- Citizen
- Posts: 75
- Joined: Wed Oct 01, 2014 12:14 am
- Location: Toronto, Canada
- Contact:
Nested Stencils?
Hey all I have come upon a hard problem, I am trying to optimize light_world.lua and I have realized that stencils are a good way to go because I have noticed that stencils limit the amount of area that shaders are applied thus speeding up the shader application. However this is a sticking point, I want to mask of the area not touched by the light (a circle mask) and mask off the shadow bodies(inverted stencils). To draw circle mask I need a stencil and the bodies I need an inverted stencil. Is there a way to use one of each or nest them?
Re: Nested Stencils?
draw onto a canvas: {255,255,255,255} for "can be drawn to" and {0,0,0,0} for "can't be drawn to"drunken_thor wrote:Hey all I have come upon a hard problem, I am trying to optimize light_world.lua and I have realized that stencils are a good way to go because I have noticed that stencils limit the amount of area that shaders are applied thus speeding up the shader application. However this is a sticking point, I want to mask of the area not touched by the light (a circle mask) and mask off the shadow bodies(inverted stencils). To draw circle mask I need a stencil and the bodies I need an inverted stencil. Is there a way to use one of each or nest them?
then set blend mode to multiplicative and draw as usual.
- drunken_thor
- Citizen
- Posts: 75
- Joined: Wed Oct 01, 2014 12:14 am
- Location: Toronto, Canada
- Contact:
Re: Nested Stencils?
The problem is that I want to use a stencil as an optimization techique for shaders. That is a very cool technique you described but I need a stencil for a very specific reason in this instance.
Re: Nested Stencils?
By shadow bodies do you mean the bodies that cast the shadows or the actual shadow darkness?drunken_thor wrote:mask off the shadow bodies
- drunken_thor
- Citizen
- Posts: 75
- Joined: Wed Oct 01, 2014 12:14 am
- Location: Toronto, Canada
- Contact:
Re: Nested Stencils?
The actual shadow darkness, for now I have settled to just use a sentcil for the range of the light and integrate the shadow stenciling into the shader being used. Not as optimal as I had hoped but oh well.Azhukar wrote:By shadow bodies do you mean the bodies that cast the shadows or the actual shadow darkness?drunken_thor wrote:mask off the shadow bodies
Who is online
Users browsing this forum: Ahrefs [Bot] and 224 guests