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.
Wireframe removing invisible lines
Started by kaizer, Oct 29 2006 04:56 PM
8 replies to this topic
#1
Posted 29 October 2006 - 04:56 PM
#2
Posted 29 October 2006 - 05:00 PM
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.
reedbeta.com - developer blog, OpenGL demos, and other projects
#3
Posted 30 October 2006 - 07:39 AM
kaizer said:
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.
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.
#4
Posted 30 October 2006 - 09:55 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.
#5
Posted 30 October 2006 - 01:25 PM
Hello,
thanks for your comments.
That's an interesting technique however I don't think stuff that advanced...
So control must get down to a pixel/pixel analysis?
Thanks.
thanks for your comments.
Reedbeta said:
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...
pater said:
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.
#6
Posted 30 October 2006 - 03:20 PM
gaia said:
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.
#7
Posted 30 October 2006 - 05:31 PM
gaia said:
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"?
#8
Posted 30 October 2006 - 09: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.
reedbeta.com - developer blog, OpenGL demos, and other projects
#9
Posted 31 October 2006 - 11:17 AM
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.
1 user(s) are reading this topic
0 members, 1 guests, 0 anonymous users












