> Date:         Mon, 24 Mar 2003 15:38:05 -0800
> From: Justin Couch <[EMAIL PROTECTED]>
>
> Basically, despite the BY_REFERENCE attribute, Java3D unindexes all your
> geometry and turns it into it's own internal, non-indexed versions. Those are
> then passed to the graphics card. This rather brain-dead approach is what is
> causing your GC problems - every time you change the geometry it throws out
> all the previously existing structures and generates a collection of new
> instances.

Indexed geometry is great for storage and convenient for representation,
but terrible for rendering.  Graphics hardware wants contiguous streams
of vertex data for the best performance.  With indices you can skip
around vertex data -- this destroys all locality of reference and
creates shorter data packets across the graphics bus.

There are no hardware-supported graphics primitives for directly
rendering indexed geometry, although vertex arrays come close.  The best
way to efficiently render indexed geometry is to copy the vertex data to
a contiguous chunk of memory in the correct order and with the vertex
components interleaved properly.

We have never characterized indexed geometry as high-performance and
don't recommend it for performance-sensitive applications.  Using
by-reference mode for the vertex data doesn't improve the situation.

> Believe it or not, but it does this even if you only change something
> inconsequential like normals or texCoords and leave the indexes alone.

There isn't any way for Java 3D to find out if you've changed a normal
or a texture coordinate in one or more of the array elements addressed
by the reference without iterating through all the data and keeping a
copy itself for comparison.

Allowing more fine-grained update sematics to the API could be a
reasonable RFE for the next major release of Java 3D.  If anybody thinks
this is important for their indexed geometry application, please submit
the RFE.

-- Mark Hood

===========================================================================
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff JAVA3D-INTEREST".  For general help, send email to
[EMAIL PROTECTED] and include in the body of the message "help".

Reply via email to