stencil shadow woes

Started by
-1 comments, last by Breadfan 21 years, 2 months ago
hi, ive been racking by brain for weeks, i cant seem to figure out what is causing these artifacts in my demo: http://atlas.imagemagician.com/images/break_stuff/stencilFUBAR.jpg as the light gets closer it messes up evan more. its very simple demo using zpass. i have extesevily tested the silhouette routine and know that the outline is being calculated correctly, so it must be something to do with the stencil buffer. heres what the outline looks like http://atlas.imagemagician.com/images/break_stuff/siloute.jpg and the shadow mesh: heres what the mesh looks like when light is up close. the first screeny was taken when the light is far away http://atlas.imagemagician.com/images/break_stuff/shadow_mesh.jpg heres the main drawing routine: //Set up iniial z values glDisable(GL_STENCIL_TEST); glColorMask(0,0,0,0); glDepthMask(1); glEnable(GL_DEPTH_TEST); glDepthFunc(GL_LEQUAL ); Rect1();//the green rectangle AnimateModel(&obj); glEnable(GL_CULL_FACE); glEnable(GL_STENCIL_TEST); //BACK FACES//// glCullFace(GL_BACK); bool backf = 0; glColorMask(backf,backf,backf,backf); glStencilOp(GL_KEEP, GL_KEEP, GL_INCR); glStencilFunc(GL_ALWAYS, 0, ~0); glDepthMask(0); //project the outline Rhino.ProjectSiloute(light,&obj,time,0); bool frontf = 0; glColorMask(frontf,frontf,frontf,frontf); //FRONT FACES//// glCullFace(GL_FRONT); glStencilOp(GL_KEEP,GL_KEEP , GL_DECR); glStencilFunc(GL_ALWAYS, 0, ~0); glDepthMask(0); //project the outline Rhino.ProjectSiloute(light,&obj,time,0); //MAIN DRAWING PASS bool color = 1; glColorMask(color,color,color,color); glDisable(GL_CULL_FACE); glStencilOp(GL_KEEP, GL_KEEP, GL_KEEP); glStencilFunc(GL_EQUAL , 0, ~0); glDepthMask(1); //Draw thegreen rectangle Rect1(); glDisable(GL_STENCIL_TEST); all help appreciated [edited by - Breadfan on January 28, 2003 2:21:22 PM]

This topic is closed to new replies.

Advertisement