Re: [Algorithms] Yet another stencil shadow question
Brought to you by:
vexxed72
From: Christian L. <cla...@aw...> - 2002-12-26 15:40:24
|
Maybe I'm naive... but say you build your simplified mesh such that it's always smaller than the original mesh (ie: any new vertex is pushed a bit toward the inside of the mesh), wouldn't that get rid of most self-shadowing artifacts? Many mesh simplification algorithms allow you to choose between inflating and deflating the original mesh, so somebody on this list must have tried it already? Christian Laforte Rendering&Vis Team, Alias | wavefront ----- Original Message ----- From: "Bernie Freidin" <be...@mi...> To: <gda...@li...> Sent: Friday, December 20, 2002 4:05 PM Subject: RE: [Algorithms] Yet another stencil shadow question yes you can use a low-detail model to cast shadows, but you'll have to turn off "self-shadowing" for that model or else it will look horrible. john carmack turns off self-shadowing all the time =) -bernie -----Original Message----- From: Jason Maynard [mailto:jma...@li...] Sent: Friday, December 20, 2002 11:34 AM To: gda...@li... Subject: Re: [Algorithms] Yet another stencil shadow question Is it possible to create a seperate low-detail model used only for the shadow volume passes that looks pretty close to the shape of the original model but you can ensure it has none of these problems with the vertex normals or discontinuities or whatever? Maybe I'm just not seeing the big picture but it sounds like it would be easier to use a simple non-problematic model for the extrusion than it would be to insert degenerates into the high-detail geometry that has these weird issues with the vertex normals. Also a seperate issue here, but one problem I noticed with this technique that didn't occur to me at first is that the shadows are appearing on geometry of the shadow receivers that face away from the light. That makes sense in that the faces that aren't facing the light wouldn't be lit by it so they should be in shadow, but right now I'm just doing it kinda crappy and drawing a black blended quad over the screen for the shadows. To solve this then do I basically need to render only the ambient pass first and then render everything again after the shadow volume passes to brighten up the non-shadowed areas with the lights? I was hoping to not have to render the entire scene a second time but if I must then I must. Oh yeah if you wanna see what the problem looks like: http://www.livetech.com/images/BackFaceShadows.jpg Thanks, -Jason ----- Original Message ----- From: "Guillaume Provost" <Gui...@ps...> To: <gda...@li...> Sent: Friday, December 20, 2002 10:40 AM Subject: RE: [Algorithms] Yet another stencil shadow question > Tom, > > I was'nt talking about the degenerate quad, but the direction the > normals are pointing in. > Both methods (face extrusions and vertex extrusions) rely for their > believability on the > consistency of the normals you use. > > If you push an edge using a vertex normal at one end and a poly > normal at the other end, > chances are you will get a significant discontinuity in the > projected shadow's silouette > In fact, the further out your shadow casts, the greater the > difference will be. > > Guillaume. > > -----Original Message----- > From: gda...@li... > [mailto:gda...@li...]On Behalf Of Tom > Forsyth > Sent: Friday, December 20, 2002 7:02 AM > To: gda...@li... > Subject: RE: [Algorithms] Yet another stencil shadow question > > > For each edge, if either vertex needs duplicating, you need to insert a > degenerate (it might only need to be a degenerate triangle, rather than a > quad - I'd have to think to work out if that's true or not). > > > Tom Forsyth - Muckyfoot bloke and Microsoft MVP. > > This email is the product of your deranged imagination, > and does not in any way imply existence of the author. > > > -----Original Message----- > > From: Guillaume Provost [mailto:Gui...@ps...] > > Sent: 20 December 2002 00:37 > > To: 'gda...@li...' > > Subject: RE: [Algorithms] Yet another stencil shadow question > > > > > > Tom, > > > > What would happen on the boundary cases of mixing these > > two methods? > > Would'nt the edge that has one vert being pushed along > > its vertex > > normal, > > and one pushed along its face normal produce noticeable shadow > > artifacts? > > > > Guillaume. > > > > -----Original Message----- > > From: gda...@li... > > [mailto:gda...@li...]On Behalf Of Tom > > Forsyth > > Sent: Thursday, December 19, 2002 3:43 PM > > To: gda...@li... > > Subject: RE: [Algorithms] Yet another stencil shadow question > > > > > > Sure, but I'm saying you can mix the two methods - introduce > > degenerates and > > multiple vertices with face normals where there is low > > tesselation or sharp > > edges or whatever, but use the smooth non-degenerate method > > where there is > > high enough tesselation and you don't mind the slight > > shrinkage. Or have I > > missed something fundamental that stops you mixing the two like this? > > > > > > Tom Forsyth - Muckyfoot bloke and Microsoft MVP. > > > > This email is the product of your deranged imagination, > > and does not in any way imply existence of the author. > > > > > -----Original Message----- > > > From: Chris Butcher (BUNGIE) [mailto:cbu...@mi...] > > > Sent: 19 December 2002 20:17 > > > To: gda...@li... > > > Subject: RE: [Algorithms] Yet another stencil shadow question > > > > > > > > > No, Jon was talking about a technique where you are storing > > the *face* > > > normal in each vertex, rather than the smoothed normal. > > This produces > > > accurate and robust shadow volumes, but results in the > > memory overhead > > > and vertex transformation costs that I mentioned. > > > > > > -- > > > Chris Butcher > > > Rendering & Simulation Lead > > > Halo 2 | Bungie Studios > > > bu...@bu... > > > > > > > > > -----Original Message----- > > > From: Tom Forsyth [mailto:to...@mu...] > > > Sent: Thursday, December 19, 2002 11:39 AM > > > To: gda...@li... > > > Subject: RE: [Algorithms] Yet another stencil shadow question > > > > > > True, but: > > > > > > (a) you only need to introduce degenerates where the mesh is coarse > > > and/or > > > sharp-edged. > > > > > > (b) you're drawing stencil volumes, so 99% of the time > > you're fillrate > > > limited, not vertex limited. > > > > > > > > > Tom Forsyth - Muckyfoot bloke and Microsoft MVP. > > > > > > This email is the product of your deranged imagination, > > > and does not in any way imply existence of the author. > > > > > > > -----Original Message----- > > > > From: Chris Butcher (BUNGIE) [mailto:cbu...@mi...] > > > > Sent: 19 December 2002 18:57 > > > > To: gda...@li... > > > > Subject: RE: [Algorithms] Yet another stencil shadow question > > > > > > > > > > > > Jon's suggestion requires duplicating vertices whenever their face > > > > normals differ. In a typical dense mesh, this will blow your > > > > vertex data > > > > size by a factor of six, and require the creation of > > > degenerate quads > > > > between every pair of adjacent non-coplanar triangles. Also, > > > > your vertex > > > > cache reuse will go through the floor since every vertex is > > > basically > > > > unique. > > > > > > > > It's not necessarily a bad technique, but you should be > > aware of the > > > > caveats before you decide to go with it. > > > > > > > > -- > > > > Chris Butcher > > > > Rendering & Simulation Lead > > > > Halo 2 | Bungie Studios > > > > bu...@bu... > > > > > > > > > > > > -----Original Message----- > > > > From: Tomasz Rozen [mailto:Tom...@in...] > > > > Sent: Thursday, December 19, 2002 2:08 AM > > > > To: gda...@li... > > > > Subject: Re: [Algorithms] Yet another stencil shadow question > > > > > > > > Okay, thanks for all your answers. > > > > > > > > In my previous post I forgot to mention that this > > algorithm included > > > > inserting degenerated triangles along sharp edges (two per edge). > > > > Basicaly I was expecting something Jon and Chris have > > > > described. I think > > > > you > > > > can also have problems with convex meshes. > > > > > > > > I think I'll go with what Jon suggested, however I'm a > > > little worried > > > > about > > > > video memory. > > > > > > > > Thanks again, > > > > Tomek > > > > > > > > > > > > > > > > > -----Wiadomosc oryginalna----- > > > > > Od: gda...@li... > > > > > [mailto:gda...@li...]W > > > imieniu Jon > > > > > Watte > > > > > Wyslano: Thursday, 19 December 2002 05:39 > > > > > Do: gda...@li... > > > > > Temat: RE: [Algorithms] Yet another stencil shadow question > > > > > > > > > > > > > > > > > > > > You don't get a perfect fit with the mesh silhouette, so > > > shadows are > > > > > slimmer than they'd otherwise be. For really coarse > > > geometry, it may > > > > > potentially mean fairly gross shape differences. > > > > > > > > > > If you're not geometry throughput bound, and you very > > > likely are not > > > > > when you do stencil shadows, I'd rather use a separate > > > > version of the > > > > > mesh with stitched sliver triangles between each edge, and face > > > > > normals. Extrude all vertices that have (face) normals > > > pointing away > > > > > from the light (or even those pointing ever so slightly > > > towards the > > > > > light). > > > > > > > > > > Cheers, > > > > > > > > > > / h+ > > > > > > > > > > > > > > > > -----Original Message----- > > > > > > From: gda...@li... > > > > > > > > > [mailto:gda...@li...]On Behalf Of > > > > > > Tomasz Rozen > > > > > > Sent: Wednesday, December 18, 2002 1:16 PM > > > > > > To: Gdalgorithms-List > > > > > > Subject: [Algorithms] Yet another stencil shadow question > > > > > > > > > > > > > > > > > > Once I've heard about an approach to rendering stencil > > > > shadows (but > > > > > > unfortunately I don't remember where). The algorithm > > was simple: > > > > extrude > > > > > > every vertex if L . N < 0 (L - light vector, N - > > vertex normal). > > > > > > Has anyone successfuly implemented this algorithm? Are there > > > > > any caveats? > > > > > > > > > > > > Thanks, > > > > > > Tomek > > > > > > > > > > > > -- > > > > > > mailto:tr...@st... > > > > > > http://trozen.w.interia.pl > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > ------------------------------------------------------- > > > > > > This SF.NET email is sponsored by: Order your Holiday > > > > Geek Presents > > > > Now! > > > > > > Green Lasers, Hip Geek T-Shirts, Remote Control Tanks, > > > Caffeinated > > > > Soap, > > > > > > MP3 Players, XBox Games, Flying Saucers, WebCams, > > > Smart Putty. > > > > > > T H I N K G E E K . C O M http://www.thinkgeek.com/sf/ > > > > > > _______________________________________________ > > > > > > GDAlgorithms-list mailing list > > > > > > GDA...@li... > > > > > > https://lists.sourceforge.net/lists/listinfo/gdalgorithms-list > > > > > > Archives: > > > > > > http://sourceforge.net/mailarchive/forum.php?forum_id=6188 > > > > > > > > > > > > > > > > > > > > > ------------------------------------------------------- > > > > > This SF.NET email is sponsored by: Order your Holiday > > > Geek Presents > > > > Now! > > > > > Green Lasers, Hip Geek T-Shirts, Remote Control Tanks, > > Caffeinated > > > > Soap, > > > > > MP3 Players, XBox Games, Flying Saucers, WebCams, > > Smart Putty. > > > > > T H I N K G E E K . C O M http://www.thinkgeek.com/sf/ > > > > > _______________________________________________ > > > > > GDAlgorithms-list mailing list > > > > > GDA...@li... > > > > > https://lists.sourceforge.net/lists/listinfo/gdalgorithms-list > > > > > Archives: > > > > > http://sourceforge.net/mailarchive/forum.php?forum_id=6188 > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > ------------------------------------------------------- > > > > This SF.NET email is sponsored by: Geek Gift Procrastinating? > > > > Get the perfect geek gift now! Before the Holidays pass you by. > > > > T H I N K G E E K . C O M http://www.thinkgeek.com/sf/ > > > > _______________________________________________ > > > > GDAlgorithms-list mailing list > > > > GDA...@li... > > > > https://lists.sourceforge.net/lists/listinfo/gdalgorithms-list > > > > Archives: > > > > http://sourceforge.net/mailarchive/forum.php?forum_id=6188 > > > > > > > > > > > > ------------------------------------------------------- > > > > This SF.NET email is sponsored by: Geek Gift Procrastinating? > > > > Get the perfect geek gift now! Before the Holidays pass you by. > > > > T H I N K G E E K . C O M http://www.thinkgeek.com/sf/ > > > > _______________________________________________ > > > > GDAlgorithms-list mailing list > > > > GDA...@li... > > > > https://lists.sourceforge.net/lists/listinfo/gdalgorithms-list > > > > Archives: > > > > http://sourceforge.net/mailarchive/forum.php?forum_ida88 > > > > > > > > > > > > > ------------------------------------------------------- > > > This SF.NET email is sponsored by: Geek Gift Procrastinating? > > > Get the perfect geek gift now! Before the Holidays pass you by. > > > T H I N K G E E K . C O M http://www.thinkgeek.com/sf/ > > > _______________________________________________ > > > GDAlgorithms-list mailing list > > > GDA...@li... > > > https://lists.sourceforge.net/lists/listinfo/gdalgorithms-list > > > Archives: > > > http://sourceforge.net/mailarchive/forum.php?forum_id=6188 > > > > > > > > > ------------------------------------------------------- > > > This SF.NET email is sponsored by: Geek Gift Procrastinating? > > > Get the perfect geek gift now! Before the Holidays pass you by. > > > T H I N K G E E K . C O M http://www.thinkgeek.com/sf/ > > > _______________________________________________ > > > GDAlgorithms-list mailing list > > > GDA...@li... > > > https://lists.sourceforge.net/lists/listinfo/gdalgorithms-list > > > Archives: > > > http://sourceforge.net/mailarchive/forum.php?forum_ida88 > > > > > > > > > ------------------------------------------------------- > > This SF.NET email is sponsored by: Geek Gift Procrastinating? > > Get the perfect geek gift now! Before the Holidays pass you by. > > T H I N K G E E K . C O M http://www.thinkgeek.com/sf/ > > _______________________________________________ > > GDAlgorithms-list mailing list > > GDA...@li... > > https://lists.sourceforge.net/lists/listinfo/gdalgorithms-list > > Archives: > > http://sourceforge.net/mailarchive/forum.php?forum_id=6188 > > > > > > ------------------------------------------------------- > > This SF.NET email is sponsored by: Geek Gift Procrastinating? > > Get the perfect geek gift now! Before the Holidays pass you by. > > T H I N K G E E K . C O M http://www.thinkgeek.com/sf/ > > _______________________________________________ > > GDAlgorithms-list mailing list > > GDA...@li... > > https://lists.sourceforge.net/lists/listinfo/gdalgorithms-list > > Archives: > > http://sourceforge.net/mailarchive/forum.php?forum_id=6188 > > > > > ------------------------------------------------------- > This SF.NET email is sponsored by: The Best Geek Holiday Gifts! > Time is running out! Thinkgeek.com has the coolest gifts for > your favorite geek. Let your fingers do the typing. Visit Now. > T H I N K G E E K . C O M http://www.thinkgeek.com/sf/ > _______________________________________________ > GDAlgorithms-list mailing list > GDA...@li... > https://lists.sourceforge.net/lists/listinfo/gdalgorithms-list > Archives: > http://sourceforge.net/mailarchive/forum.php?forum_id=6188 > > > ------------------------------------------------------- > This SF.NET email is sponsored by: The Best Geek Holiday Gifts! > Time is running out! Thinkgeek.com has the coolest gifts for > your favorite geek. Let your fingers do the typing. Visit Now. > T H I N K G E E K . C O M http://www.thinkgeek.com/sf/ > _______________________________________________ > GDAlgorithms-list mailing list > GDA...@li... > https://lists.sourceforge.net/lists/listinfo/gdalgorithms-list > Archives: > http://sourceforge.net/mailarchive/forum.php?forum_id=6188 ------------------------------------------------------- This SF.NET email is sponsored by: The Best Geek Holiday Gifts! Time is running out! Thinkgeek.com has the coolest gifts for your favorite geek. Let your fingers do the typing. Visit Now. T H I N K G E E K . C O M http://www.thinkgeek.com/sf/ _______________________________________________ GDAlgorithms-list mailing list GDA...@li... https://lists.sourceforge.net/lists/listinfo/gdalgorithms-list Archives: http://sourceforge.net/mailarchive/forum.php?forum_id=6188 ------------------------------------------------------- This SF.NET email is sponsored by: The Best Geek Holiday Gifts! Time is running out! Thinkgeek.com has the coolest gifts for your favorite geek. Let your fingers do the typing. Visit Now. T H I N K G E E K . C O M http://www.thinkgeek.com/sf/ _______________________________________________ GDAlgorithms-list mailing list GDA...@li... https://lists.sourceforge.net/lists/listinfo/gdalgorithms-list Archives: http://sourceforge.net/mailarchive/forum.php?forum_ida88 |