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 / 11101
11100  |  11102
Subject: 
Re: Bricksmith 2.4: Faster. Much Faster.
Newsgroups: 
lugnet.cad.dev
Date: 
Wed, 16 Jun 2010 19:09:03 GMT
Viewed: 
38032 times
  
In lugnet.cad.dev.mac, Don Heyse wrote:
   In lugnet.cad.dev.mac, Don Heyse wrote:
   In lugnet.cad.dev.mac, Don Heyse wrote:
   In lugnet.cad.dev.mac, Remi Gagne wrote:
   In lugnet.cad.dev.mac, Allen Smith wrote:
  
By the way, Bricksmith does not render conditional lines. I consider shading to be a sufficient substitute, and conditional lines sound difficult to optimize.

Heh, you hit that problem too? I’ve played around writing an OpenGL LDraw renderer based exclusively on display lists, but I can’t for the life of me figure out how to handle conditional lines in this setup. Has anyone else solved this peculiarly specific problem?

You can ignore the conditional lines and achieve the same effect with display lists using the stencil buffer techniques presented here:

http://www.opengl.org/resources/code/samples/sig99/advanced99/notes/node108.html

And here’s a silhouette technique using BFC:

http://citeseerx.ist.psu.edu/viewdoc/download?doi=10.1.1.71.8503&rep=rep1&type=pdf

This technique and the conditional lines both target the same edges lines where the front facing polygons meet the back facing polygons, so the results should be quite similar.

And another thing...

The BFC technique actually has an advantage over conditional lines because it works on the entire scene after it’s been assembled. Whereas the conditional lines at the edges of the primitives are created in advance, and must predict what they’re going to butt up against when the entire scene has been assembled. This prediction may not always be right, resulting in missing conditional lines and some visible where they should not be.

So finally this brings us to a technique that combines the predictive abilities of the conditional lines with the runtime advantages of the stencil and BFC algorithms.

Think of the conditional line as a pair of triangles with a shared edge line. You can ensure the two triangles are wound the same way by going through the shared edge line in the opposite direction in the two triangles. This means if we try to draw both triangles in a scene where the conditional line should show then one of the triangles can be culled by BFC. So we take advantage of this by drawing the conditional line triangles (edges only) into the stencil buffer. Then we redraw only the conditional lines and use the stencil buffer to pass only the conditional lines that were drawn once. Conditional lines that were drawn 0 times, or more than 1 time do not pass.

I think it could work. What do you think?

Enjoy,

Don



Message has 1 Reply:
  Re: Bricksmith 2.4: Faster. Much Faster.
 
(...) Interesting, but complicated IMO :-) Shaders offer a much easier implementation, and (I suspect) a faster one. Geometry-shaders for preference, but the algorithm can be implemented using vertex-shaders or even ARB vertex-programs to support (...) (14 years ago, 16-Jun-10, to lugnet.cad.dev, FTX)

Message is in Reply To:
  Re: Bricksmith 2.4: Faster. Much Faster.
 
(...) And another thing... The BFC technique actually has an advantage over conditional lines because it works on the entire scene after it's been assembled. Whereas the conditional lines at the edges of the primitives are created in advance, and (...) (14 years ago, 16-Jun-10, to lugnet.cad.dev.mac, lugnet.cad.dev, FTX)

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