In my application I have ~28000 shape3D objects who's color can be
individually changed. When making the shapes, I point each shape to one
element of an array of appearance objects (about 7 elements in the
appearance array). To change their color (in response to a click), I change
the element of the Appearance array the shape is pointing to using the
setAppearance() method. The change is instantaneous.
Daniel
-----Original Message-----
From: Yazel, David J. [mailto:[EMAIL PROTECTED]]
Sent: Monday, September 18, 2000 9:21 AM
To: [EMAIL PROTECTED]
Subject: Re: [JAVA3D] Attribute change performance Issue.
Thats bizzare and disturbing. You are saying that one line of code,
basically changing a material (being used by many thousands of shapes) took
5 seconds? Thats appalling. I have never tried to do that, but I will be
working on a particle system soon, and changing color of shapes is extremely
important for that. It doesn't really make much sense to me. I have been
studying how open GL works, and frankly Java3d immediate mode is pretty much
like open gl. Basically you set the transformation and appearance and then
shove geometry out the pipe. Changing one material should have ZERO impact
on performance because on the next rendering cycle the only difference is a
slightly different appearance sent to the graphics card.
The only thing I can think of is Java3d is copying doing some synchronized
access to all shapes which reference the material. The other thought is
that it is converting all the shapes into ShapesRetained (their internal
format) every time you change the appearance.
It would be nice for Sun to comment on this.
Dave Yazel
> ----------
> From: Norihito Hiruma[SMTP:[EMAIL PROTECTED]]
> Reply To: Discussion list for Java 3D API
> Sent: Monday, September 18, 2000 5:17 AM
> To: [EMAIL PROTECTED]
> Subject: Re: [JAVA3D] Attribute change performance Issue.
>
> Thank you for making it reply to kindness.
> It is very much helped.
>
> Lets me reply in the sentence.
>
> > - My reading of your code seems to suggest you are using exactly the
> > same material colour values for all 10K objects. Is that so?
> > If so, why
> > use 10K instances of the Material object. You should just use one and
> > share that instance between all Shape3D instances. The more instances
> > you can share, the faster your application. For example, if
> > you have 10
> > different coloured objects you only need 10 instances of the Material
> > rather than 10,000.
> Because, CAD-Entity must hold a respectively different attribute.
> 1 CAD-Entity will be mapping to 1 Shape3D in CAD-Application.
> So, each Shape3D has different Material in test program.
>
> I had tried a code which was all Shape3D refer one Material, and change
> that
> one Material.
> The color change time of this case was about five seconds.
> ( Yes, a little faster than last code, but still slow )
>
> > - You may be stumbling on something j3d is doing with the rendering
> > process if it is taking so long. Have you tried calling stopRender(),
> > changing all the values, and then calling startRender() again?
> Yes, I had tried this too.
> ( call stopRender() -> setDiffuseColor() -> startRender() )
> But the result didn't change, so I deleted the code.
>
> - [EMAIL PROTECTED]
>
> ==========================================================================
> =
> 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".
===========================================================================
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".