silhouette drawing

Started by
20 comments, last by UnrealMiniMe 17 years, 1 month ago
Wow, thanks UnrealMiniMe ... now that's an answer if I've ever seen one!! It all just comes back to the sad fact that there is no great way to do this. I think from now on I'll just have the artist add the silhouette in Max or Maya.

I agree and disagree with some of your post and I'm very confused from our recent findings with VBO's. We're using display lists to currently render our static geometry and when we switched over to use VBO's we lost 30+ fps. I think the GPU of my current machine is not powerful enough to handle hardcore shaders and VBO's. No loops in fragment shaders and VBO's are meant for static geometry!

Thanks a lot for you time :)
Advertisement
Wow, I'm an idiot. I totally missed the display list part of it and jumped straight to the conclusion that you were using immediate mode the moment I saw the glVertex call ;) Sorry about that! Display lists are just fine, too :)

Anyway, I'm not sure it's possible to add silhouettes as an art asset, because of the fact that they change based on the angle you're viewing from :( If your model was a perfect sphere, it would work (just have silhouette geometry stored and rotate it along with your view)...but somehow I don't think you're drawing only spheres. Good luck, though!


If you didn't mind silhouettes "inside" of the object, I have a post-process idea, though: If you run an edge-detection algorithm on the depth map of your image, you could set a threshold for "just how far away this pixel should be from its neighbors to be considered an edge." Once you determine which pixels are on an edge, you can render them into a texture as bright white (using HDR), blur that texture with a filter, and then subtract the result from your final image (assuming subtractive blending is possible - I'm still a noob on the details ;)). That will give you black silhouettes around pixels that are much closer to the camera than their neighbors, with varying softness/silhouette width (depending on the blur). Depending on how you set the threshold, you could probably find a good balance and eliminate most "inside silhouettes" (if you combined this with writing the normals to a texture and doing edge-detection on those too, you could really eliminate them). However, this would not render all silhouettes shown in the above image (nor would any true silhouette-finding algorithm), since the ledge in the image you showed actually has inside edges drawn. This kind of post-process algorithm would be kinda slow, but who knows - it could be faster than drawing everything twice, depending on your scene complexity.

P.S. Odds are, when you lose that many FPS with VBO's, you're using either wayyyyy too many, or they have more vertices stored in them than your vertex cache will allow. Basically, the bigger you make VBO's and the less there are, the faster they are - up until the point where there are more vertices in them than your graphics card can fit in its vertex cache. Then, immediately, the performance self-destructs. This is my understanding, at least.

P.P.S. I actually read more about finding silhouettes tonight (because I'm trying to improve shadow volumes for a project I'm doing...the silhouette finding algorithm is just too slow), and I came across an interesting research paper about finding silhouettes, and I think it'd probably be worth your while to check it out:
http://www.enformatika.org/ijcs/v1/v1-2-12.pdf

[Edited by - UnrealMiniMe on February 20, 2007 1:56:43 AM]

This topic is closed to new replies.

Advertisement