Shadows bug in the old extended version.

BlitzMax Forums/MiniB3D Module/Shadows bug in the old extended version.

zcbeaton(Posted 2008) [#1]
I'm using klepto's old extended version of MiniB3D simply for the shadows and for the shaders, but I'm encountering an issue with the shadows. I have a cube on grass. The cube has a shadow cast on the grass, but when I move into this shadow, suddenly there's a shadow cast everywhere else except this area.

How can I fix this?

EDIT: Here's a screenshot.



Gabriel(Posted 2008) [#2]
I don't use MiniB3D, but I'm guessing shadows are stencil shadows?

When you say "I move into this shadow" it's not very explicit. Do you mean an animated character model?

My guess would be that your animated character model has unwelded vertices or holes in the mesh or something of this order which generally breaks stencil shadows. This is the main disadvantage of stencil shadows, and it's generally better to fix the model than fix the shadows. The stencil code *can* be written to adjust for *some* of these problems automatically, but stencil shadows are already dog slow, and this sort of checking just makes them even slower.


zcbeaton(Posted 2008) [#3]
Actually I was referring to the camera. I'm sorry for not providing a screenshot from the beginning, so here we go.




klepto2(Posted 2008) [#4]
Try to add this in your code:

SetShadowMode(2)

In the upcoming new version this is definetly fixed. The issue is because of the use of two different techniques: ZPass and ZFail.
ZPass is slightly faster but has problems if the camera is in a shadowvolume (inversed shadows).
ZFail is much more fillrate intensive but solves the described the above problem.

The new version will not have this problem anymore.


zcbeaton(Posted 2008) [#5]
Hmm, that code didn't seem to fix it. In fact, now all I can see is a solid brown colour across the screen. If I'm in wireframe, I can see where I am, but otherwise I can only see a single shade of brown.

I sincerely look forward to your new version!