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 / 10488
10487  |  10489
Subject: 
Re: Maximum depth of ldraw models?
Newsgroups: 
lugnet.cad.dev
Date: 
Thu, 7 Sep 2006 04:01:39 GMT
Viewed: 
2602 times
  
In lugnet.cad.dev, Erik Olson wrote:
In lugnet.cad.dev, Steve Bliss wrote:
In lugnet.cad.dev, Mark Tarrabain wrote:
I notice that no maximum depth is given by the standard.  How
potentially non-compliant would a renderer be if it fails because parts
in a model are too deeply nested (a maximum of as little as 16 on some
OpenGL implementations).  I notice that no existing parts are nested
more than 7 files deep, but I want to be sure.

Hmm.  I use MPD models a lot, there can be several levels of nesting within a
single .mpd file, and I have been known to refer to .mpd files from other .mpd
files.

I'm not sure how deep my nesting of model files goes, but I'd be a little
concerned about a limit of 16 levels.  I wonder if ldraw renderers tend to
flatten out the nesting in part files?

I tested the performance of, and saw a decent gain from flattening part
geometry. (Perhaps 15% in BrickDraw3D for QuickDraw3D or OpenGL.)

Same here for LDView.  LDView always flattens part geometry, and this seems to
improve performance enough to be noticed.  LDView does use a display list for
each part, and a nested display list for each nesting level above that (as long
as you have its memory usage setting set to the default of "High"), and I've
never had anyone complain that a model didn't display properly due to nesting
issues.


What this means is that when a part is prepared into a drawing list, it is not a
list of calls to primitives with a transformation, but instead the primitives
are copied out and all coordinates pre-transformed, all the way down.  (With the
exception of studs and changes of color.) Or, a part is created as a single mesh
with an attempt to join triangles into triangle mesh and to join line segments
into line primitives.

LDView behaves similarly, although it doesn't do any joining aside from its
primitive substitution.  But since it uses vertex arrays, it turns out that
joining into strips and fans can actually sometimes be detrimental to
performance, since each strip and fan requires a separate API call, while all
the triangles (for instance) can be drawn with a single API call.  So unless the
strips get above some threshold (which is video-card dependent), they'll
actually be slower.  Also, I use multiple display lists for each part in order
to be able to handle the default color and the highlight color while still
drawing that geometry in a display list.


This can speed up rendering by eliminating a large number of camera stack
operations, eliminating duplicate vertices, and by increasing the memory cache
hit rate, at the cost of a reasonable amount of extra memory used.

Yes, and remember that matrix multiplications aren't generally accelerated at
all.  So when you change the model/view matrix, the matrix multiplication
happens on the CPU.  A part with lots of studs ends up with quite a few matrix
multiplies.

--Travis



Message has 3 Replies:
  Re: Maximum depth of ldraw models?
 
(...) Well, typically the multiplies that occur for different studs have the same rotation and scaling aspects, the only thing different is the position. So instead of repeating the multiplication on the original matrix, if the top left 3x3 values (...) (18 years ago, 7-Sep-06, to lugnet.cad.dev)
  Re: Maximum depth of ldraw models?
 
(...) Actually on modern cards strips are always slower than optmized lists. You can always try adding degenerate triangles to stitch strips together to save the cost of multiple render calls (too bad PC cards don't support a primitive reset index). (...) (18 years ago, 8-Sep-06, to lugnet.cad.dev)
  Re: Maximum depth of ldraw models?
 
(...) I found that performance went down somewhat when I copied and pre-translated all the studs too. I could be creating a memory cache penalty. Anyway it is only one matrix multiply per stud (stud is already flattened in itself), which goes onto (...) (18 years ago, 9-Sep-06, to lugnet.cad.dev)

Message is in Reply To:
  Re: Maximum depth of ldraw models?
 
(...) I tested the performance of, and saw a decent gain from flattening part geometry. (Perhaps 15% in BrickDraw3D for QuickDraw3D or OpenGL.) What this means is that when a part is prepared into a drawing list, it is not a list of calls to (...) (18 years ago, 7-Sep-06, to lugnet.cad.dev)

11 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