Title: RE: [JAVA3D] Performance Experience
Thanks! I'll try it today.
----- Original Message -----
Sent: Monday, July 15, 2002 8:44 AM
Subject: Re: [JAVA3D] Performance Experience


Add this as a custom behavior:

import java.util.*;
import javax.media.j3d.*;

/** A behavior to calculate the framerate (number of Frames Per Second)
 *
 * @author Corysia Taware [EMAIL PROTECTED]
 * @version $Revision$
 */
public final class FramePerSec extends Behavior
{
        private int frameCount = 0;
        private long lastTimeCheck = 0;
        private WakeupCondition condition = new WakeupOnElapsedFrames(100);

        private vp2testb backref;

        public void initialize()
        {
                lastTimeCheck = System.currentTimeMillis();
                wakeupOn(condition);
        }

        public FramePerSec(){
        }

        public void processStimulus(Enumeration wakeup)
        {
                long currTime = System.currentTimeMillis();
                System.out.println("FPS: " + (300000 / (currTime - lastTimeCheck)));
                lastTimeCheck = currTime;
                wakeupOn(condition);
        }
}
-----Original Message-----
From: Zoran Krunic [mailto:[EMAIL PROTECTED]]
Sent: Monday, July 15, 2002 10:04 AM
To: [EMAIL PROTECTED]
Subject: Re: [JAVA3D] Performance Experience


Hi There,

Is there a way to get FPS measurements with j3D 1.2.1 ?

Thanks,

Zoran

----- Original Message -----
From: "Chien Yang" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Friday, June 21, 2002 10:47 AM
Subject: Re: [JAVA3D] Performance Experience


In Java 3D 1.3 beta, we did ship with a FPSCounterDemo in our demo.
The FPSCounterDemo uses a FPSCounter behavior to measure the frame rate
of the scene. FPSCounter is easy to use, and all you need is to add
roughly the following 3 lines to your code :

        private FPSCounter fpsCounter = new FPSCounter();
  // Create the Framecounter behavior
fpsCounter.setSchedulingBounds(bounds);
objRoot.addChild(fpsCounter);

FPSCounter is our prefer method of measuring frame rate. Any comment
and suggestion to improve FPSCounter will be greatly appreciated.

- Chien Yang.
  Java 3D Team.

> Date: Fri, 21 Jun 2002 13:18:46 -0400
> From: Lan Wu-Cavener <[EMAIL PROTECTED]>
> Subject: Re: [JAVA3D] Performance Experience
> X-Sender: [EMAIL PROTECTED]
> To: [EMAIL PROTECTED]
> MIME-version: 1.0
> Content-transfer-encoding: quoted-printable
> Delivered-to: [EMAIL PROTECTED]
>
> At 11:25 AM 6/21/2002 -0500, you wrote:
> >I'm basically having a behavior wake up on every frame and marking the
> >time and comparing.  I randomly choose frames and average the times and
do
> >1/time = fps.
> >
> Thanks!
>
> Be careful with what you do in the behavior. That might be the reason to
> slow down the application. I don't think that calculating frame rate will
> do that  though.
>
>
> > >>> Lan Wu-Cavener <[EMAIL PROTECTED]> 06/21 11:01 AM >>>
> >your note reminded me of a question I had related to the performance. I
was
> >running my j3d program on w2k. I found that adjusting the processes
> >priority through task management tool can change the j3d program
> >performance although it is not recommended to change the process
priority.
> >I wondered if there is similar problem with XP OS (which I don't have any
> >experience). Just a thought for you to check out.
> >
> >Using geometry byRef will improve the performance in terms of changing
> >Shape3d's geometry. But it will not have big impact on the scene
rendering.
> >The latter can be improved by occlusion culling.
> >Oh, how do you test the number of frame per second?
> >
> >
> >At 05:21 PM 6/21/2002 +0200, you wrote:
> > >Hi,
> > >
> > >will using the same geometry object along several shape3d nodes
> > >reduce the memory usage IN THE VIDEO CARD memory
> > >or only the SYSTEM memory used by J3D for java objects ?
> > >
> > >
> > > >-----Original Message-----
> > > >From: Discussion list for Java 3D API
> > > >[mailto:[EMAIL PROTECTED]] On Behalf Of Shawn Kendall
> > > >Sent: Freitag, 21. Juni 2002 06:14
> > > >To: [EMAIL PROTECTED]
> > > >Subject: Re: [JAVA3D] Performance Experience
> > > >
> > > >
> > > >Chad Zalkin wrote:
> > > >
> > > >> My application runs really slow with my current scene.  When
> > > >I removed
> > > >> textures, I went from < 10 fps to ~30 fps.   When I killed a lot of
> > > >> geometery but added some textures, I went to ~60 fps.
> > > >That's with no
> > > >> atmospherics and no lights and no sound.
> > > >>
> > > >> My system sure should be able to handle this:
> > > >>
> > > >> Dual Athlon MP 1700+
> > > >> 512 MB Ram
> > > >> ATI Radeon 7000 (64 mb vid ram)
> > > >> JDK 1.4
> > > >> Java3d 1.3 beta 2
> > > >> WindowsXP Pro
> > > >>
> > > >> Any Ideas why this would run so slow?  I don't think I have
> > > >any thread
> > > >> blocking/locking or otherwise obviously bad code.
> > > >>
> > > >> Thanks
> > > >> Chad Zalkin
> > > >
> > > >Not knowing anything else about the size of your apps textures
> > > >and amount of geometry, one possiblity is that you are going
> > > >over your video card memory limit.  The behavior you describe
> > > >is typical of that.  Whenever you go over the amount of
> > > >available memory, the render system will have to page in and
> > > >out the geometry and textures in your scene.  That paging
> > > >across the AGP port will dramatically reduce render
> > > >performance the moment it happens.
> > > >
> > > >Remember, a large part of your video memory is use for frame
> > > >buffer, then the rest can be used for geometrry and textures.
> > > >Also, any other applications can be holding on to video memory
> > > >as well, making it less for your J3D app.
> > > >
> > > >Shawn Kendall
> > > >Java3D Game Tech Developer
> > > >
> > > >===============================================================
> > > >============
> > > >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".
> >
> >Lan Wu-Cavener
> >Dept. of Landscape Architecture
> >
>
>===========================================================================
> >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".
>
> Lan Wu-Cavener
> Dept. of Landscape Architecture
>
>
==========================================================================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".

Reply via email to