> 1. If you have two shapes which have different appearences, but the same
> material, do you sort and then only send the material once if possible?
Yes, Java3D maintains dirty bits for material, point/line/polygon attrs,
coloring attrs and  transparency and sends these attributes down only when
they change from one Shape3D to another.

> 2.  Do you sort materials, etc based on their values or the actual
> instantiation of the Java object?  So if I have two materials which are
> equivelent, but 2 different instantiations of materials do I still get
the
> optimization?

Java3D checks for equal as well as equivalent.


 3. I was thinking of writing a caching system where after I build
something
> like a Material I would say Material m = checkMaterial(mm), whereupon it
> would look in a cache of already instantiated materials and if it finds a
> match it would return the original and discard the new one.  Do you see
any
> issues with this approach? I am planning on doing this for
> renderingAttributes, transparencyAttributes, coloringAttributes,
> polygonAttributes and materials.  I already cache textures.

This caching mechanism is fine if you only do equals. In fact we do this
for .compile. If you also include equivalent node components then you need
to worry about what happens if one of the node components is writable and
is subsequently changed.


> MIME-Version: 1.0
> Content-Transfer-Encoding: 7bit
> X-Priority: 3
> X-MSMail-Priority: Normal
> X-MimeOLE: Produced By Microsoft MimeOLE V5.00.2615.200
> Date: Sat, 17 Mar 2001 19:35:42 -0500
> From: David <[EMAIL PROTECTED]>
> Subject: [JAVA3D] Optimization for shared appearances
> To: [EMAIL PROTECTED]
>
> This is a question for the Sun engineers.
>
> 1. If you have two shapes which have different appearences, but the same
> material, do you sort and then only send the material once if possible?
> 2.  Do you sort materials, etc based on their values or the actual
> instantiation of the Java object?  So if I have two materials which are
> equivelent, but 2 different instantiations of materials do I still get
the
> optimization?
> 3. I was thinking of writing a caching system where after I build
something
> like a Material I would say Material m = checkMaterial(mm), whereupon it
> would look in a cache of already instantiated materials and if it finds a
> match it would return the original and discard the new one.  Do you see
any
> issues with this approach? I am planning on doing this for
> renderingAttributes, transparencyAttributes, coloringAttributes,
> polygonAttributes and materials.  I already cache textures.
>
> Dave Yazel
>
>
===========================================================================
> 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".

===========================================================================
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