Shadow volumes for non-manifold geometry

Get help with installing and running the Cafu Engine here. This forum is also for general questions and discussion of all aspects regarding the Cafu Engine.
Post Reply
RAZOR
Posts:17
Joined:2004-08-23, 07:44
Location:New Zealand
Shadow volumes for non-manifold geometry

Post by RAZOR » 2006-02-21, 10:58

I should mention, I don't actually use this engine, though I have great respect for both it and Carsten himself. I prefer to mess about at a lower level, even if I don't get much in the way of results that way. Now on topic.

Ca3de, like doom 3 and similar games, only casts shadows correctly if the object is "air tight" right? Well there's a paper I stumbled on recently that describes an algorithm which works for any geometry and still creates optimal volumes. You can find it here: http://www.hitlabnz.org/fileman_store/2 ... dridge.pdf I think it's slightly simpler than the original algorithm (not that I've tried the original), and all the data required can be generated from the vertex and index data. I tried it out, and you can find some lame looking screenshots here: http://www.razor.byethost.com//article. ... 8162616489

I'm just posting this because I thought you might be interested in the algorithm. It would give artists that much more freedom, and I don't know of any existing engines that use it. Oh, and I wasn't sure which forum to put this post in. It's a bit technical, but seeing as it's not really about development with the engine I put it here.
No-one quite knows why I'm here...
User avatar
Carsten
Site Admin
Posts:2170
Joined:2004-08-19, 13:46
Location:Germany
Contact:

Post by Carsten » 2006-02-21, 14:17

Hi Razor,

nice to hear from you, and thanks for the information! :-)

Good news is that Ca3DE can deal correctly with non-2-manifold geometry since a while, that is, it also gets shadows right for severely "broken" polygonal meshes.
The key strategy that Ca3DE implements is very simple and effective: It treats edges that only have one polygon (i.e. the polygon has no neighbour at that edge) always as silhouette edges. Edges where more than two polygons meet are treated like edges with only one polygon - they're always considered silhouette edges, too.
It's a bit surprising, but this simple strategy solves the problem reliably.
You can think of how you would treat a single triangle if it was to be used as a shadow caster. The fact that any polygonal model, no matter how "broken" it is, could be treated as a set of individual triangles, "proves" the correctness of this approach.

I've looked at the paper that you linked above, and I think that what they do is overly complicated, especially as edges with not two (or worse, more than two) neighbours should rarely occur anyway.

Anyways, thank you very much for your post - I'm very grateful for any tips in this regard :idea:
Best regards,
Carsten
Cereus Prods
Posts:25
Joined:2006-02-20, 16:46
Location:Lake Havasu City AZ

Post by Cereus Prods » 2006-02-21, 18:08

Are those screenshots form this engine?! The ones in the PDF not the site.
User avatar
Carsten
Site Admin
Posts:2170
Joined:2004-08-19, 13:46
Location:Germany
Contact:

Post by Carsten » 2006-02-21, 19:04

No, the above linked pdf is not related to Ca3DE.
But our upcoming TechDemo has similarly impressive scenes...
Best regards,
Carsten
RAZOR
Posts:17
Joined:2004-08-23, 07:44
Location:New Zealand

Post by RAZOR » 2006-02-22, 06:31

Carsten wrote: Good news is that Ca3DE can deal correctly with non-2-manifold geometry since a while, that is, it also gets shadows right for severely "broken" polygonal meshes.
I didn't know that! You never cease to amaze me :).
Carsten wrote: It treats edges that only have one polygon (i.e. the polygon has no neighbour at that edge) always as silhouette edges. Edges where more than two polygons meet are treated like edges with only one polygon - they're always considered silhouette edges, too.
That actually works? If it's so simple then why did the writer of that paper never succeed in modifying the Crow/Bergeron’s algorithm? Or does it just work in enough cases that there isn't any trouble?
Carsten wrote: I've looked at the paper that you linked above, and I think that what they do is overly complicated, especially as edges with not two (or worse, more than two) neighbours should rarely occur anyway.
I don't really see how it's complicated... They just take the front facing polygons and use their counter scheme to find edges that aren't shared (and other cases) and need extruding. Still, you have your way implemented and tested already, so whatever the advantages or disadvantages you should probably stick with it.
Cereus Prods wrote: Are those screenshots form this engine?! The ones in the PDF not the site.
If the screens were of Ca3de I wouldn't be telling Carsten about it would I? And while it does look nice, 4fps really doesn't cut it.
No-one quite knows why I'm here...
User avatar
Carsten
Site Admin
Posts:2170
Joined:2004-08-19, 13:46
Location:Germany
Contact:

Post by Carsten » 2006-02-22, 15:07

RAZOR wrote:That actually works? If it's so simple then why did the writer of that paper never succeed in modifying the Crow/Bergeron’s algorithm? Or does it just work in enough cases that there isn't any trouble?
No, it works "always". This is because, theoretically speaking, it reduces all complex cases to the case of a single, individual triangle. As the edges of an individual triangle are always silhouette edges, the approach is always right.
The only potential problem that I can see is that when three or more triangles meet at a common edge, there might be a small performance penalty, because a shadow volume facet gets drawn that is canceled out later when the same facet is drawn in opposite orientation.
RAZOR wrote:I don't really see how it's complicated... They just take the front facing polygons and use their counter scheme to find edges that aren't shared (and other cases) and need extruding. Still, you have your way implemented and tested already, so whatever the advantages or disadvantages you should probably stick with it.
Sure, their approach is not really "complicated", I just said that because I think that mine is even simpler. ;)
Best regards,
Carsten
Post Reply

Who is online

Users browsing this forum: No registered users and 19 guests