I had a question about maximizing performance with wireframe-type
graphics.

I have an application related to CAD that's doing a lot of line
drawing.  Different parts of the drawing essentially correspond to
layers that can be turned on or off, which are implemented as Groups.
All of the objects in a Group are Segments, and a typical segment is
created like this:

var line:Segment = new Segment( new Vertex(tipX, tipY, tipZ), new
Vertex(x, y, z), debugMat );

Okay, now to the question.  I had been creating a new
WireframeMaterial object for every Segment.  However, there are
actually very few different material types needed, so I thought I'd do
myself a favor, make up a palette with one copy of each of them, and
then just pass in the palette entries to the new Segment.

Man, that really killed the performance to build the group!

Why would that be?  Seems like there is less work if I am not
constantly allocating so many copies of what are essentially the same
materials.

Cheers,

BW

Reply via email to