PDA

View Full Version : Silhouette edges



Aeluned
04-01-2005, 07:37 AM
I've googled and found a few links.
Anyone have any other links they found useful in
calculating silhouette edges?

Thanks.

ZbuffeR
04-01-2005, 08:30 AM
Yes, me, I have plenty of such very valuable links, but I won't show them :D

... no, really, can you post yours at least ? So there would be no duplicates, and would help other people too.

Aeluned
04-01-2005, 09:45 AM
http://www.cc.gatech.edu/~sarah/Project3/goodLines/a_few_good_lines.htm

http://developer.nvidia.com/object/robust_shadow_volumes.html

http://www.gamedev.net/reference/articles/article1873.asp

http://www.paulsprojects.net/opengl/shadvol/shadvol.html (source code)

I just want a broad sweep of implementations and
methods out there.

I like the idea of setting the model polygon
connectivity once before hand and then comparing
polygon normals to detect the silhouette edges.
My implementation is borderline not fast enough
at the moment (my app is time critical) so maybe
I'm missing something. It'd also be nice to use
high resolution models for this stuff.

Thanks.

ZbuffeR
04-01-2005, 10:51 AM
Author says "great for dense models" :
http://www.geocities.com/tom_j_hall/

Aeluned
04-02-2005, 05:49 AM
cool. Thanks man.

Aeluned
04-04-2005, 09:43 AM
ZBuffer,
Have you implemented this by any chance?
or silhouette edges in general?
what's the fastest space to calculate this stuff
in?

I mean, if the model is transformed I would need
to transform each and every triangle before
calculating visibility from the light's point of
view based on the plane equation of that triangle,
right?

Wouldn't that suck performance wise?
I think I've seen the light being transformed by
the inverse of the models tranformation matrix.
I'm not sure if that was exactly it, but that
doesn't make sense to me.

Can anyone help?

SeskaPeel
04-05-2005, 08:02 AM
I can help quite a lot on this topic.
Now you'll have to say precisely what you want to do.

I implemented Tom Hall's method, and it is less efficient (and very prone to errors) than the brute force method.

Actually, after months of research, the only viable one seems to be the brute force. I didn't test sm3.0 methods though.

Do you intend to render GL_LINES ?

SeskaPeel.

Aeluned
04-05-2005, 10:35 AM
Really.. I just read Hall's implementation and
was going to go ahead with it.

I want to do edge rays (sort of volumetric light
eminating from the object)
sketch rendering, volumetric shadows, etc...

I just think it would be a cool thing to get into
place.

brute force just considers each edge in the model,
correct?

you find that this works decent for high polygon
count models?

SeskaPeel
04-06-2005, 03:58 AM
Hall's method is wrong on some particular cases (and not the concave stuff, it sometimes simply fails completely), and we tried to polish a good implementation, but it leeched the CPU even more than the brute force (we were wondering if we should go to ASM). Clearly, you can't rely on it as a robust method. Too bad, because stroking is a very good point.

Do you have shader model 3 ?
if yes this one will be the best : http://graphics.cs.brown.edu/games/FeatureEdges/index.html (read carefuly the Epilogue part)

If you don't, you'll certainly want to optimize CPU:
1/ a "concave" edge can't be a visible silhouette edge. So if you just want to display the silhouette edges, you don't need to compute the concave ones.
2/ You can store a buffer of edges, each containing the two face indices and the two vertex indices. When you compute your silhouettes for the current frames, fill a second, already existing "edge indices" array, that was created to the maximum size possible. Then return the position in this array of the last index. This way you avoid allocation
3/ Compute your silhouettes right after rendering your mesh (in Z for stencil, in color buffer for standard rendering, etc.) to keep paralelism
4/ Compute your silhouettes in mesh local space, you need to transform the eye vector in this space.
5/ Rely heavily on STL and inlining (or ASM) to update each face "frontorbackfacing" boolean fields.

And with this, we managed to lose no frames/sec on complex scenes (mostly because we use a lot of fill rate limited effects). Anyway, this was after months of research (kind of a failure, yes).

There is not one and only method that will perform best for all your applications. Just choose one and focus on it.

SeskaPeel.

Aeluned
04-06-2005, 04:53 AM
Thanks so much.

I appreciate you sharing what you've learned
after months of blood, sweat and tears :)

That's all very helpful!

I have an NV40 gen card, so shader model 3 should
be available to me.

Cheers.

Java Cool Dude
04-06-2005, 09:00 AM
Something very primitive:
http://www.realityflux.com/abba/C++/Silhouette/silhouette.jpg

Binaries (http://www.realityflux.com/abba/C++/Silhouette/Silhouette.zip)
Demo source (http://www.realityflux.com/abba/C++/Silhouette/SilhouetteSRC.zip)
Engine source (http://www.realityflux.com/abba/C++/SXMLEngine/SXMLEngine.zip)