Reputation: 1881
I have an assignment I'm working on that required me to render an image only using hidden lines. I'm finding stuff online on how to remove hidden lines but Ive been unsuccessful at figuring out how to reverse the code to make it so that it only draws the hidden lines.
Usually when i come to Stack Overflow I like to post a bad attempt at the code. In this case I haven't even gotten a piece of code that even does what i remotely want it to do. Since this is the case I was hoping for the theory on how I could do this.
Thanks for anything that could help!
Upvotes: 0
Views: 77
Reputation: 59811
If I understand you correctly, you can use an approach similar to Depth Peeling using multiple render passes: Draw the scene once, keep the resulting depth buffer. Draw the scene again, now discard all fragments whose z value is less or equal to the value in the stored z-buffer and draw all others.
Upvotes: 1