z-fail with open objects ?

I’m doing some basic stencil shadows using z-fail with a non-inf farplane (just kicked it back “far enough”). Works great, except I can’t really figure out a tactic to render non-closed volumes. I’m thinking of using a very basic holefiller, by scanning for “hanging” edges that line up at a vertex and closing them off into a tri. I’m not sure if this would always work, but even if it does, there’s also the case of a hanging tri (with two or even three hanging edges). I was thinking to handle those by using the tri, reversed, as the cap…

This all sounds a bit clunky and ad-hoc, so I was wondering if anyone else has been working on this… thanks !

I can’t imagine having a model that isn’t closed. I mean forget the shadow volumes, are you ok with being able to see a hole in your model ? Shadow Volumes will handle a hole that is “drilled” through the model since it is technically still closed, although it has a lot of nasty concavities in it. Nvidia’s demo has a object around the light source that is like that. I would think your best bet is simply to look into an algorithm to close the models. Try google. I don’t know what else to tell you. Haven’t realy needed to close my models before. Everything I do comes out of 3d Studio Max and I can always use their cap holes modifier if I need too.


I’m actually doing a basic md3 modelviewer, and unless my reader is seriously barfed, those are full of open ended tristrips – eg the flare tris on the rocket model, or some of the tris where torso and legs meet on most playermodels.
Thanks though, guess I’ll be looking into some of those algos for closing for the shadow-only pass.

Edit : Forgot to mention that I’m merging vertices based on geometric position (ie that were split due to ST differences) so those dangling edges are probably for real…

[This message has been edited by bpeers (edited 06-04-2002).]

I described a method to use open models - it’s in one of the shadow threads on this board. Basically, reverse the winding of all front-facing triangles ( wrt. the light ) to create the projected far cap. There are other ways that will work with the GPU method of extracting silhouettes ( requires preprocessing the mesh ).