Dave, I'd certainly love to hear from Sun on this issue. But it's one I believe we have to live with using Java 3D. I'd guess that Java 3D induces a bit of computation every time the scene graph is changed (when a branchgroup is added).
We take two different approaches to this concept. You try to make lots of small changes to smooth out this to the point where it's not noticed. In Pernica we let the user run smoothly for a while, then load a BIG chunk of terrain and just accept that we'll have a big pause. - John Wright Starfire Research "Yazel, David J." wrote: > > We have this really annoying condition. When we swap out patches of the > terrain we get minute pauses. This means we are running along and > pause....run 40 meters...pause. Now the pauses are brief, no doubt about > it. But they really bug me since everything else is so smooth. > > I think we have eliminated everything from our end. > > 1. Textures are loaded in a seperate thread. The pauses is not during this > time. > 2. The textures are by-ref > 3. The geometry for each patch is by-ref, infrequent > 4. Garbage collection is at a minimum, we are using pools and caches for > most heavyweight objects. > 5. The pactches are reused. When patches are removed they are placed into a > cache. When we need a new patch we get one from the cache, update the > texture and update the geometry. > 6. When we decide we need to reconfigure the patches we calculate a minimum > set of changes, like "remove a level 3 patch and insert 4 level 2 patches" > 7. Because we need to keep frame-to-frame coherency, we build an "update > transaction" which includes commands to insert and remove the patches. > 8. The transaction is executed from a behavior on wakeuponelapsedframes(0) > > We have to make multiple patch changes in a single atomic transaction > because otherwise you would see momentary gaps in the terrain. Sometimes we > are inserting as many as 10-12 patches (each from 300-1000 triangles and a > 128x128 texture). These seem really lightweight, so I am not sure why we > get the pauses. > > One thought I had would be to insert each patch into the scene, one per > frame all with rendering attribiutes setVisible(false), then in one atomic > transaction remove the old patches and make the new ones visible. > > Is it the insertion of the benchgroups into the scene which causes the > pauses? Any thoughts? > > =========================================================================== > 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".
