Hi guys!
I'm trying to implement a lighting engine that can draw shadows and reflections of polygons. This is how it basically works:
1. render the scene unlit into canvas
2. render the unlit canvas into the backbuffer with an ambient color
3. for each lightsource the unlit scene is rendered additive on top of the backbuffer with an inverted stencil that draws shadow polygons of some shadowcasters (convex polygons)
until now everything works quite well but here comes my problem:
4. each lightsource casts reflections on some sides of the convex polygons. these are rendered by drawing the unlit canvas with a stencil that draws the reflection polygon.
this also works quite well but if i want to draw the shadows of those reflections i would need an inverted stencil that again draws the shadow polygons for the reflections. If you first active the normal stencil and than activate the inverted stencil only the inverted stencil is active.
Is there a way to combine the two stencils or do i have to rethink my relfection rendering?
Combine inverted stencil and normal stencil
Forum rules
Before you make a thread asking for help, read this.
Before you make a thread asking for help, read this.
Who is online
Users browsing this forum: No registered users and 11 guests