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 / 11103
11102  |  11104
Subject: 
Re: Bricksmith 2.4: Faster. Much Faster.
Newsgroups: 
lugnet.cad.dev
Date: 
Wed, 16 Jun 2010 20:49:23 GMT
Viewed: 
38358 times
  
In lugnet.cad.dev, Alex Taylor wrote:
   In lugnet.cad.dev, Don Heyse wrote:
   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?

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 older cards.

Ah ha! Yet another reason to read that vertex-shader book. So, are you suggesting running this algorithm on the graphics card (with counters for the vertices instead counting pixels in the stencil buffer) or perhaps some other algorithm?

Anyhow, I think the one thing I wanted to point out here is that the conditional lines contain more information than you might think. They’ve got enough winding information to draw the silhouette using a BFC technique, even if the part itself is not BFC compliant. If that can be implemented faster using a vertex-shader on the graphics card, even better!

Don



Message has 1 Reply:
  Re: Bricksmith 2.4: Faster. Much Faster.
 
(...) Actually, it's even simpler! This is the code for the geometry-shader: #version 120 #extension GL_NV_geometry_shader4 : enable varying out vec4 gl_TexCoord[]; float determinant(mat2 m) { return m[0][0] * m[1][1] - m[0][1] * m[1][0]; } void (...) (14 years ago, 16-Jun-10, to lugnet.cad.dev)  

Message is in Reply To:
  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)

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