problem with multipass bleeding

Started by
2 comments, last by MountainLion2 20 years, 5 months ago
I''m sure someone out there amungst the heavens knowns the very simple and easy solution to this problem...I''m using multipass multitexturing to add some static shadows to project, to be more specific I''ve drawn a stone archway onto a wall with an overhang above. The stones for the arch were all drawn individually along with the wall above them, what i''m tring to do is add a shadow, across the top that drops just under the top of the arch...when I draw the shadow it does a nice job of following the curve of the arch but it bleeds horribly. I''ve tryed some of the suggestions I''ve found by searching through the forums, like Polygon Offset, reseting the z-buffer higher, adjusting the near/far clipping planes, the only one I''ve found that works is to turn off the depth test, but then my shadow comes out as a rectangle and no longer follows the arch. any suggestions?
Advertisement
Set depthfunc to GL_LEQUAL.

glDepthFunc(GL_LEQUAL);

If you use polygon offset, disable z-buffer writing,
when rendering the second pass.

glDepthMask(GL_FALSE);

[edited by - circuit on November 18, 2003 4:39:31 AM]
Hello

Here are a few tips that i ran into, i am not sure if this will help.

First you have to have your depth buffer off or it will fail a depth test and not display (or it should anyway).

You a stencil buffer to make sure you are not causing double darkaning. Double darkaning is that each triangle in the shadow adds grey, but if there is more then one triangle showdowing a specific place then it will add grey twice. To avoid that set the stencil buffer to a value and only add grey if the stencil test passees. You get the idea.

The last thing and probobly the most important. You should check your shadow matrix, if its longer then it should be then chances are the shadow matrix is projecting the model the wrong way.

Later, Ben
Hey, thanks for the help.

This topic is closed to new replies.

Advertisement