|
|
In lugnet.cad.dev.mac, Allen Smith wrote:
snip
|
Bricksmith now recursively flattens the geometry for each referenced
top-level part then sorts it according to primitive type (triangles, quads,
lines). Since the primitives are sorted, each type can be enclosed in a
single glBegin while display lists are compiled. I create a unique display
list for each color variation of the part. Flattening and sorting the
primitives allowed the display lists to perform vastly improved internal
optimizations over what they were able to do with the unsorted data from the
previous version of Bricksmith.
Unfortunately, all this is a bit beside the point because display lists are
on their way out, deprecated, not even available on the iPhone, etc. You are
supposed to be using VBOs and VAOs nowadays. Unfortunately I am not a 3D
guru, wrote my program using obsolete methods to begin with, and it has taken
me a while to plan a transition.
By the way, Bricksmith does not render conditional lines. I consider shading
to be a sufficient substitute, and conditional lines sound difficult to
optimize.
Allen
|
Thanks for the insight Allen,
Im also not a 3D guru, but I like to fool around with it as much as anyone
interested in 3d programming.
Your method is roughly the same as what LD4DStdudio does, except I use VBO to
stuff whole high level parts in index-ed arrays. The indices are then grouped
per color (16 being also a color) so a minimum of glcolors are needed during
rendering. So it seems display lists arent less then VBO at all to me.
Only problem with the highlevel part approach is you cant support mirrored
submodels higher up in the rendering tree (like eg the star destroyed mpd uses)
cause it will mess up the normals. Or did you find a way around that?
Optimizations I was thinking of for my new renderer are using only triangles
instead of 1 on 1 ld quads and triangles cause quads will be split by the driver
anyway. (not sure if its actually faster doing it yourself but Ill have to
test that.)
The conditional lines are indeed a pain, normal lines can go in vbo/display
lists much like the triangles but you have to test all conlines against the the
current projection matrix for every redraw. I was planning to do this
multithreaded (like LDView does).
Roland
|
|
|
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? Ive played around writing an OpenGL LDraw
renderer based exclusively on display lists, but I cant 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 heres 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 its been assembled. Whereas
the conditional lines at the edges of the primitives are created in
advance, and must predict what theyre 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.
|
|
|
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? Ive played around writing an OpenGL LDraw
renderer based exclusively on display lists, but I cant 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 heres 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.
|
|
|
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? Ive played around writing an OpenGL LDraw
renderer based exclusively on display lists, but I cant 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
|
|
|
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? Ive played around writing an OpenGL LDraw
renderer based exclusively on display lists, but I cant for the life of me
figure out how to handle conditional lines in this setup. Has anyone else
solved this peculiarly specific problem?
Remi
|
|
|
In lugnet.cad.dev.mac, Roland Melkert wrote:
|
In lugnet.cad.dev.mac, Kevin L. Clague wrote:
snip
|
|
- Drawing speed improvements of up to 1200% snip
|
|
Just from a technical interest, how did you achieve that boost?
Im in the midst of writing a new LDraw renderer myself, so Im very
interested in any possible improvements I can implement over the old
LD4DStudio rendering method. Although I suspect it has to do with alpha
blending and or conditional line rendering (none of whom are done in LD4D,
but I would like to do in the new implementation).
Anyhow it sounds great, maybe I get to use it one day (Im planning to buy an
apple for some years now).
Roland
|
Hi Roland,
Bricksmith now recursively flattens the geometry for each referenced top-level
part then sorts it according to primitive type (triangles, quads, lines). Since
the primitives are sorted, each type can be enclosed in a single glBegin while
display lists are compiled. I create a unique display list for each color
variation of the part. Flattening and sorting the primitives allowed the display
lists to perform vastly improved internal optimizations over what they were able
to do with the unsorted data from the previous version of Bricksmith.
Unfortunately, all this is a bit beside the point because display lists are on
their way out, deprecated, not even available on the iPhone, etc. You are
supposed to be using VBOs and VAOs nowadays. Unfortunately I am not a 3D guru,
wrote my program using obsolete methods to begin with, and it has taken me a
while to plan a transition.
By the way, Bricksmith does not render conditional lines. I consider shading to
be a sufficient substitute, and conditional lines sound difficult to optimize.
Allen
|
|
|
In lugnet.cad.dev.mac, Kevin L. Clague wrote:
snip
|
Hi Roland,
Just to be clear, Allan recoded and achieved this fantastic performance
improvement.
Kevin
|
Hi Kevin,
Sorry I replied to the wrong message, thats what you get if you read the group
in a newsgroup client and post at the site.
Still hoping Allan could share some insight on the rendering technique(s) used.
Roland
|
|
|
In lugnet.cad.dev.mac, Roland Melkert wrote:
|
In lugnet.cad.dev.mac, Kevin L. Clague wrote:
snip
|
|
- Drawing speed improvements of up to 1200% snip
|
Kevin
|
Hi, Keving
Just from a technical interest, how did you achieve that boost?
Im in the midst of writing a new LDraw renderer myself, so Im very
interested in any possible improvements I can implement over the old
LD4DStudio rendering method. Although I suspect it has to do with alpha
blending and or conditional line rendering (none of whom are done in LD4D,
but I would like to do in the new implementation).
Anyhow it sounds great, maybe I get to use it one day (Im planning to buy an
apple for some years now).
Roland
|
Hi Roland,
Just to be clear, Allan recoded and achieved this fantastic performance
improvement.
Kevin
|
|
|
In lugnet.cad.dev.mac, Kevin L. Clague wrote:
snip
|
|
- Drawing speed improvements of up to 1200% snip
|
Kevin
|
Hi, Keving
Just from a technical interest, how did you achieve that boost?
Im in the midst of writing a new LDraw renderer myself, so Im very interested
in any possible improvements I can implement over the old LD4DStudio rendering
method. Although I suspect it has to do with alpha blending and or conditional
line rendering (none of whom are done in LD4D, but I would like to do in the new
implementation).
Anyhow it sounds great, maybe I get to use it one day (Im planning to buy an
apple for some years now).
Roland
|
|
|
In lugnet.announce, Allen Smith wrote:
|
Bricksmith 2.4 adds the following
features:
- Drawing speed improvements of up to 1200%
- 64-bit native on Mac OS X 10.6
- Viewports fill their entire frame
- Supports displaying the newly-standardized direct RGB color syntax
- Supports displaying legacy blended colors from the original LDRAW
- Saved files are formatted in traditional LDraw text style instead of fixed-width columns
|
...snip....
Allan,
Congratulations on such a great improvement! Keep up the good work.
Kevin
|
|
|