Subject:
|
Re: Why Type 5 Lines?
|
Newsgroups:
|
lugnet.cad.dev
|
Date:
|
Fri, 19 Apr 2002 17:13:25 GMT
|
Viewed:
|
771 times
|
| |
| |
In lugnet.cad.dev, Steve Bliss writes:
> In lugnet.cad.dev, Travis Cobbs wrote:
>
> > In lugnet.cad.dev, Steve Bliss writes:
> > > In lugnet.cad.dev, Kyle McDonald wrote:
> > >
> > > > 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.
> > >
> > > One problem: transparent surfaces would show the wireframe backside. :\
> >
> > Actually, transparent surface should work fine. As long as they are set to
> > write to the Z buffer when drawn, and their outlines are drawn with Z buffer
> > testing enabled, they should work fine. The wireframe parts that aren't
> > supposed to be visible won't be drawn in the first place (which is actually
> > the same thing that happens for the opaque portions).
>
> The backside wireframe elements *will* be drawn, that's the point of
> what Kyle was talking about. The idea is to draw the wireframe of the
> backside surfaces and it will all be hidden by the frontside surfaces,
> *except* for the lines around the outlines of the objects.
>
> Except that transparent frontside surfaces will reveal the wireframe
> backsides.
I understand what you are saying, but it won't happen that way if Z buffer
writing is enabled during the drawing of the transparent surfaces. The
transparent surfaces aren't really transparent. They're just blended with
whatever is behind them. (This is why you get interesting effects if you
don't sort them.) They look like they are transparent, but if they really
were transparent, then you wouldn't have to sort; you could just draw them
in any order and they would look correct. The reason they have to be sorted
is that the blending only occurs with whatever is drawn before them.
So, if you turn on Z buffer writing while drawing the transparent surfaces,
then the back sides of the wireframe won't show up as long as Z buffer test
is enabled when drawing the wireframes. The back-facing wireframe is drawn
after the filled transparent surfaces. The edges will still show up because
those particular lines will pass the Z test. (Polygon offset will still
probably be needed to get clean lines.) This is actually exactly the same
thing that happens with the opaque surfaces. The key reason it will work
with transparent surfaces also is the fact that they aren't really
transparent; they're just blended with whatever is there before them.
Normally you don't bother to enable Z buffer writing when drawing the
transparent surfaces, because they are the last thing drawn, and it won't
matter. However, it doesn't hurt anything to enable it, other than slowing
it down a little. And if you want to use this algorithm, it has to be enabled.
--Travis Cobbs (tcobbs@REMOVE.halibut.com)
|
|
Message has 3 Replies: | | Re: Why Type 5 Lines?
|
| (...) Cool. Thanks for taking the time to explain it to me. I didn't realize this about opengl. Steve "please speak slowly and clearly" Bliss (23 years ago, 19-Apr-02, to lugnet.cad.dev)
| | | Re: Why Type 5 Lines?
|
| (...) Thanks for that explanation, however I think we still need to include type 5 lines in parts, so that programs which don't implement this technique (eg ldraw) can still display the curved edges correctly. Programs which do implement it can (...) (23 years ago, 19-Apr-02, to lugnet.cad.dev)
|
Message is in Reply To:
| | Re: Why Type 5 Lines?
|
| (...) The backside wireframe elements *will* be drawn, that's the point of what Kyle was talking about. The idea is to draw the wireframe of the backside surfaces and it will all be hidden by the frontside surfaces, *except* for the lines around the (...) (23 years ago, 19-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
|
|
|
|