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 / 10100
10099  |  10101
Subject: 
Re: Rendering implementation details
Newsgroups: 
lugnet.cad.dev
Date: 
Tue, 25 Jan 2005 20:57:25 GMT
Viewed: 
1800 times
  
In lugnet.cad.dev, Mark Tarrabain wrote:
Okay.... having had a day to think about it and a night to sleep on it,
I think I've figured out something....

But it would only work if the optional lines were incident to edges of
polygons that are part of the object being drawn.  I'm not sure if one
could always make that assumption.

But the idea I was envisioning was something like this...

During the initial processing of the file, for every optional line in
the object, find the two polygons in the file which share that edge, and
associate those two polygons with that line.

During rendering when any optional line is encountered, then for both
polygons that the line is associated with, take the dot product of its
outward surface normal and a vector pointing directly towards the viewer
(or viewing plane, if an orthgonal projection is being used).   If one
dot product is less than or equal to 0 and the other greater than or
equal to 0 then draw the optional line, otherwise both faces are back or
front facing and the optional line should be omitted.

This incurs the overhead of 2 transformations per optional line (one for
both polygons on either side of it), rather than the 4 I was mentioning
before.  I'm not sure if it's an acceptable improvement or not.

I don't see it.  Are you sure this works in the perspective projection?
Because I can't quite figure out what the magic view vector is in that
case.  I think you'd need to calculate one view vector for each edge
endpoint, which brings the number of transformations back up to 4.

Of course, this would only work at all if all optional lines happened to
be incident with polygon edges elsewhere in the object, which isn't
strictly required by the format, so I can't say I'd expect it to work
all the time.

A variation on this, which I am pretty sure _would_ work is to not draw
optional lines at all, and perform the above test on all edges in the
object which are not incident to any mandatory lines.   This effectively
makes a sillouhette for the object, and would be drawn in the color used
for edges based on the edge color for the polygon that is facing front
(which would be the whole object if it were all one color).   The
downside to this approach is that it would almost result in more
transformations, but at least it does not make any assumptions about
what may or may  not be in the file.

You're right about this one.  An ldraw renderer should be able to
figure out from examining the edges where to put the type 5 lines.
But the beauty of the magic halo and cartoon rendering algorithms is
that you don't have to figure out anything.  You just use BFC settings
and make a display list so the graphics card does all the math.  That's
gotta be faster.  Of course, as Travis pointed out, it requires full
BFC compliance to work.  Oh well.

Don

PS.  Are you planning a new renderer?  Why not fiddle with the ldview
sources instead?



Message has 1 Reply:
  Re: Rendering implementation details
 
(...) Actually, one can bring the number of transformations down to 1 for the entire _object_. Interesting what can happen when an idea sits in the brain and percolates for a couple of days. A new idea I had was to just transform the camera position (...) (20 years ago, 29-Jan-05, to lugnet.cad.dev)

Message is in Reply To:
  Re: Rendering implementation details
 
Okay.... having had a day to think about it and a night to sleep on it, I think I've figured out something.... But it would only work if the optional lines were incident to edges of polygons that are part of the object being drawn. I'm not sure if (...) (20 years ago, 25-Jan-05, to lugnet.cad.dev)

22 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