View Full Version : Wireframe removing invisible lines
kaizer
10-29-2006, 08:56 AM
Hello,
I am creating a 3D application that displays a figure in its wireframe model. I need to create an option that will remove invisible lines.
What algorithms can be used to do this?
Dont want to use a "face painting" with the background color to overwrite the invisible lines.
Don't know if a brute force:
For all lines, For all faces, if any face is in front of line, ignore the line
would work ok or if it would slow down.
Any comments on the subject and related subjects (visibility determination) are welcome.
Thanks.
Reedbeta
10-29-2006, 09:00 AM
The subject you're asking about is part of NPR (non-photorealistic rendering). Try googling for something like "NPR blueprint rendering" or "NPR sketchy rendering" to find techniques for this. Beware though, it won't be fast even for relatively simple models.
pater
10-29-2006, 11:39 PM
Don't know if a brute force:
For all lines, For all faces, if any face is in front of line, ignore the line
would work ok or if it would slow down.
Thanks.
That'll certainly not help, because the problem is that it's not just a "draw the line" or "don't draw the line" decision. A line in the background may also be partially visible (even in segments, depending on the complexity of the model).
Write a shader to update the depth buffer only in a first pass, change the depth bias slightly and render the same model as wireframe in a second pass? That should take appropriate care of the situations mentioned by pater too.
kaizer
10-30-2006, 05:25 AM
Hello,
thanks for your comments.
The subject you're asking about is part of NPR (non-photorealistic rendering). Try googling for something like "NPR blueprint rendering" or "NPR sketchy rendering" to find techniques for this. Beware though, it won't be fast even for relatively simple models.
That's an interesting technique however I don't think stuff that advanced...
That'll certainly not help, because the problem is that it's not just a "draw the line" or "don't draw the line" decision. A line in the background may also be partially visible (even in segments, depending on the complexity of the model).
So control must get down to a pixel/pixel analysis?
Thanks.
dave_
10-30-2006, 07:20 AM
Write a shader to update the depth buffer only in a first pass, change the depth bias slightly and render the same model as wireframe in a second pass? That should take appropriate care of the situations mentioned by pater too.
Thats what I was going to suggest. You dont have to write a shader, you could do this with the fixed function stuff in OpenGL.
Write a shader to update the depth buffer only in a first pass, change the depth bias slightly and render the same model as wireframe in a second pass? That should take appropriate care of the situations mentioned by pater too.
Do you actually have to bias? Or is the Z evaluation slightly different for wireframe than the original triangles? ie can you nto just set the compare to "equal"?
Reedbeta
10-30-2006, 01:28 PM
For wireframe you'll be generating fragments based on lines rather than triangles, so yes, they'll be slightly different due to roundoff errors.
Ah, so one can disable colour-write without having to write a shader. I stand corrected - my PC rendering knowledge is a little rusty (been concentrating on PSP for a while). Thanks for correcting my disinformation guys.
vBulletin, Copyright ©2000-2010, Jelsoft Enterprises Ltd.