Hello,
I am currently trying out the stencil shadow code from example L12. I successfully got the code running in my application (really easy to use) but I must have missed something. Here is a screenshot:
The problem: small flickering pixels in the shadow. If I place the camera near the shadow, the light pixels vanish, but if I get farther away, the flickering gets stronger and stronger.
Besides of this, I had to set the parameter clearStencilBuffer to true when calling DrawStencilShadow(). The example is somehow running without setting this. How does it come?
Flickering in stencil shadow
Re: Flickering in stencil shadow
That is due to how stencil shadows work in Irrlicht. those small flickers are precission problems when extruding the volumes for the shadows. The closer, the more precise, hence, the flickers dissapear. The least triangles, the better with the stencil shadows.
"There is nothing truly useless, it always serves as a bad example". Arthur A. Schmitt
-
- Admin
- Posts: 14143
- Joined: Wed Apr 19, 2006 9:20 pm
- Location: Oldenburg(Oldb), Germany
- Contact:
Re: Flickering in stencil shadow
Can also be small seams in the mesh, where vertices are not shared, but duplicated. Still precision problems, but more easily fixable with an improved mesh (or a simplified shadow mesh used as replacement for the original one)
Re: Flickering in stencil shadow
Thank you. I will try to use a simplified model for the shadow volume.