To LUGNET HomepageTo LUGNET News HomepageTo LUGNET Guide Homepage
 Help on Searching
 
Post new message to lugnet.cad.devOpen lugnet.cad.dev in your NNTP NewsreaderTo LUGNET News Traffic PageSign In (Members)
 CAD / Development / 7128
7127  |  7129
Subject: 
Re: Why Type 5 Lines?
Newsgroups: 
lugnet.cad.dev
Date: 
Thu, 18 Apr 2002 03:41:26 GMT
Viewed: 
584 times
  
I was reading through this more, and while I still don't know exactly
how it all works, I think I stumbled onto something.


  > I dont know how many of you have come across this technique before. I
  > remember finding an OpenGL demo that did this kind of NPR (NonPhotorealistic
  > Rendering) outlines.
  >
  > The concept is rather simple, create clones of objects, turn that clones into
  > a wire frame setting the color and the line widths and switch their culling
  > so that they are drawn backface.
  >

Looking at the code below I don't actually see the Z buffer offset being used,
but the one thing I did notice in the above paragraph is that he suggests
switching the culling of the wireframe copy of the geometry.

I think I know why this works, and it may work even for geometry that isn't
in strips!

If you only have the original geometry, you have some faces that face toward
you, and others that face away from you. These are the faces that will be
drawn solid and filled in. Now you make a copy of these faces and set them
to be drawn wireframe.

If you stop here, you end up with a full mesh over top (with Zbuffer bleeding)
of your filled in faces. but if you flip the culling on the wireframe faces,
you end up *not* drawing the mesh on the filled faces you have drawn. You *do*
end up making the mesh lines elligible to be drawn for the filled faces on
the back side of the object that were already culled, but since those lines
will endup with a further away Z buffer value they won't get drawn.

What you are left with drawing on top of the filled faces are only the lines
that fall at the visible edges of the mesh - right where the Culling get's
triggered. Pretty ingenious if you ask me :)

If I lost you in there, picture a scene that is rendered according to the
view point, but then it is frozen. If you were to walk around  the object,
you'd see it had a 'solid' front, and a 'wireframe' back. From the front
though you can only see the 'wires' that go around the edges. Since this
Day/night (solid/wire) line is done through culling, it is always computed
as needed based on the viewers view point. Which is just what the type5
lines were intended for. :) Now that I understand it better, I even think
it will work without 'strips' and 'fans', but it's apparent now that it
*won't* work without BFC. So that becomes even more important. So I was
wrong about the strips :( but at least we don't need the Stencil Buffer,
or any special hardware or driver features :)

I need either this or I need to be able to turn on lighting, because
right now the images are so washed out faces at totally different depths,
but which have the same color are virtually indistinguishable from each
other. Unfortunately  both lighting and this solution depend on BFC so...

-Kyle




--
                                    _
-------------------------------ooO( )Ooo-------------------------------
Kyle J. McDonald                 (o o)
                                  |||||

                                  \\\//
                                  (o o)            kmcdonald@BigFoot.COM
-------------------------------ooO(_)Ooo-------------------------------



Message has 1 Reply:
  Re: Why Type 5 Lines?
 
(...) One problem: transparent surfaces would show the wireframe backside. :\ Steve (22 years ago, 18-Apr-02, to lugnet.cad.dev)

Message is in Reply To:
  Re: Why Type 5 Lines?
 
(...) That sounds like glPolygonOffset which would be part of the solution because it allows the edges to look clean. We all use that already. (...) I can see how you might accomplish some of that by manipulating glEdgeFlag when you define your (...) (22 years ago, 18-Apr-02, to lugnet.cad.dev)

21 Messages in This Thread:







Entire Thread on One Page:
Nested:  All | Brief | Compact | Dots
Linear:  All | Brief | Compact

This Message and its Replies on One Page:
Nested:  All | Brief | Compact | Dots
Linear:  All | Brief | Compact
    

Custom Search

©2005 LUGNET. All rights reserved. - hosted by steinbruch.info GbR