|
Hi John
-
I'm a Java3D newbie,
but I've worked with a number of other 3D APIs (most recently Direct3D).
I've seen this problem several times in other systems. Here's what might
be going on: Java3D - or the underlying native API - is indeed
buffering up primitives and state changes, and executing them in batches (either
when the buffer fills or the user calls flush()). However, texture changes
don't go into the buffer, because they're sometimes heavyweight
operations. In other words, providing a new texture can require a lot of
data (the texture pixmap itself) and so texture loads "go around" the pipeline
in the buffer.
In your case, it
appears that you already have two textures loaded and you're merely switching
between them, so you'd think the changes would go into the buffer. Perhaps
this is a bug in the native API/hardware, or in J3D's management of that
API. Have you tried this on a different graphics card?
I sure would like to
know if this is expected behavior, and if so, why J3D doesn't internally flush
the pipeline on a texture change.
Happy
holidays,
Brad
-----Original Message-----
From: Discussion list for Java 3D API [mailto:[EMAIL PROTECTED]]On Behalf Of John Owen Sent: Saturday, December 23, 2000 4:58 PM To: [EMAIL PROTECTED] Subject: Re: [JAVA3D] Immediate Mode Appearance Question/Problem I "fixed" this problem by inserting a
GraphicsContext3D.flush(true) statement between the rendering of each sphere
(graphics.flush(false) does not work). This eats into the frame rate but
produces the correct results.
So it seems like GraphicsContext3D.setAppearance()
is not making a copy of my appearance object but is instead holding onto a
reference. Does anybody know if this is by (ouch) design?
If so it leaves you leaves you with 2 pretty grim
alternatives, call GraphicsContext3D.flush(true) before each call to
GraphicsContext3D.setAppearance() and pay a performance cost
since your app is going to block, or be forced into allocating a new
appearance object before each call to
GraphicsContext3D.setAppearance().
Please tell me this is a bug, thanks,
- John
|
