Yeah it is Carmacks Reverse and currently it has 3 Rendermodes:
the first is to render the scene(full),Render the shadows to the stencil, then a black transparent quad is rendered over the viewport.
the second is to render the scene(only ambient),Render the shadows to the stencil, Render the whole scene again with full light on.
the third is just the debug mode and shows the shadowvolumes.
the second pass enables you to have more blended shadows, so the shadow is not seen in very dark areas or 'hides' when coming to more or same dark areas.
Currently I'm currently trying to solve the inverting shadow bug when the cam is inside a shadovolume. (Normally this should be done automatically with carmacks reverse, but this only works when using a infinite clip plane. And at the moment my approaches to enable this in opengl simply fails)
If someone could show me how to implemnt an infinte clip plane in Opengl and minib3ds camera system, or could point me to the right direction I would be very happy :) .
Oh, for the stencil shadows a lot of thanks has to go to 'devils child' who gave me the allowence to use his volume generation code in minib3d.
[Correction]
The current Algo doesn't use carmacks reverse(zFail), It currently uses ZPass and thats the reason for the inverted shadow bug. I have tried to implemnt carmacks reverse but without success. The code should be compatible (shadowVolume Creation) but I will let it currently this way. And maybe someone else will have more luck to get it working with zfail after I have released the source. Maybe Leadwerks or other Engine Writers (Pointing to Mark Sibly) may have look then i try it ;) .
[/Correction]
the first is to render the scene(full),Render the shadows to the stencil, then a black transparent quad is rendered over the viewport.
the second is to render the scene(only ambient),Render the shadows to the stencil, Render the whole scene again with full light on.
the third is just the debug mode and shows the shadowvolumes.
the second pass enables you to have more blended shadows, so the shadow is not seen in very dark areas or 'hides' when coming to more or same dark areas.
Currently I'm currently trying to solve the inverting shadow bug when the cam is inside a shadovolume. (Normally this should be done automatically with carmacks reverse, but this only works when using a infinite clip plane. And at the moment my approaches to enable this in opengl simply fails)
If someone could show me how to implemnt an infinte clip plane in Opengl and minib3ds camera system, or could point me to the right direction I would be very happy :) .
Oh, for the stencil shadows a lot of thanks has to go to 'devils child' who gave me the allowence to use his volume generation code in minib3d.
[Correction]
The current Algo doesn't use carmacks reverse(zFail), It currently uses ZPass and thats the reason for the inverted shadow bug. I have tried to implemnt carmacks reverse but without success. The code should be compatible (shadowVolume Creation) but I will let it currently this way. And maybe someone else will have more luck to get it working with zfail after I have released the source. Maybe Leadwerks or other Engine Writers (Pointing to Mark Sibly) may have look then i try it ;) .
[/Correction]