Hey folks,
 
We have observed some interesting behavior when setting Appearance attributes on large scene graphs, and I was wondering if anyone could comment on this.
 
We have found that building and setting the Appearance object (from scratch) on a Shape3D node is actually faster than setting values for a few attributes of an existing Appearance object.  For example, the first block below appears to execute faster than the subsequent block (as an example):
 
// Build an Appearance object from scratch, and set it.
Appearance myNewAppearance = new Appearance();
initAppearance(myNewAppearance);  // this inits *all* relevant attributes on the given object
myShape3D.setAppearance(myNewAppearance);
 
// Change a few attributes on an existing Appearance object.
Appearance myExistingAppearance = myShape3D.getAppearance();
myExistingAppearance.getPolygonAttributes().setFillMode(myFillMode);
myExistingAppearance.getRenderingAttributes().setVisible(myVisibleState);
myExistingAppearance.getColoringAttributes().setColor(mColor);
 
Does that make sense?  If so, why would building and setting the Appearance object be faster than adjusting a few values on an existing Appearance object?  Thanks for any insight.
 
- Mauricio

Reply via email to