Re: [osg-users] How to get average frame rate after some amount of running time?

2010-01-05 Thread Robert Osfield
Hi Dat,

On Mon, Dec 28, 2009 at 5:18 PM, Nguyen Tien Dat  wrote:
> Thanks for your answer. But I still have some doubts here. When I load
> the model with osgviewer, and press key 's', it displays that the
> frame rate is only 34 fps. But in my application, the frame rate goes
> up to 60, which is kind of strange because I have some control inside
> the loop too. Could it be possible to have your application runs with
> faster frame rate than osgviewer?

It's certainly possible to write two different applications that
perform differently  as to why, well there are close to infinite
number of reasons.  One has to narrow done why, and you are in a
position to do this because you have your application in front of you
and the OSG code base, I don't so I can't answer these questions you
have to.

Robert.
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] How to get average frame rate after some amount of running time?

2009-12-28 Thread Nguyen Tien Dat
Hi Robert,
Thanks for your answer. But I still have some doubts here. When I load
the model with osgviewer, and press key 's', it displays that the
frame rate is only 34 fps. But in my application, the frame rate goes
up to 60, which is kind of strange because I have some control inside
the loop too. Could it be possible to have your application runs with
faster frame rate than osgviewer?
Thanks,
Dat

On Thu, Dec 24, 2009 at 10:52 AM, Robert Osfield
 wrote:
> Hi Dat,
>
> On Thu, Dec 24, 2009 at 4:09 PM, Nguyen Tien Dat  wrote:
>> Yes, I doubt that this is the refresh rate of the monitor, not the
>> real frame rate. How could I avoid the "sync-to-vblank" thing, so that
>> I can have the actual frame rate?
>
> It *is* the actual frame rate.  This is a good thing, it means that
> the app is doing just fine, in visual simulators the goal that we all
> strive for is hitting the display refresh rate on every single frame.
>
> Now... if you are doing certainly types of performance profiling you
> might want to switch of vsync so you can look at the maximum frame
> rates you application+database is capable of doing on that hardware +
> application behavior.  It should be just a quick look when
> benchmarking though, as soon as the benchmarking to look at something
> specific about performance you should switch vsync back on.  Rember
> hitting vsync on every frame is the real goal that you should be
> striving for, the maximum frame rates with vsync off is really a false
> goal which can lead you to make poor decisions on your database and
> application.
>
> To switch off vysnc use your driver control panel.
>
> Robert.
> ___
> osg-users mailing list
> osg-users@lists.openscenegraph.org
> http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
>
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] How to get average frame rate after some amount of running time?

2009-12-24 Thread Robert Osfield
Hi Dat,

On Thu, Dec 24, 2009 at 4:09 PM, Nguyen Tien Dat  wrote:
> Yes, I doubt that this is the refresh rate of the monitor, not the
> real frame rate. How could I avoid the "sync-to-vblank" thing, so that
> I can have the actual frame rate?

It *is* the actual frame rate.  This is a good thing, it means that
the app is doing just fine, in visual simulators the goal that we all
strive for is hitting the display refresh rate on every single frame.

Now... if you are doing certainly types of performance profiling you
might want to switch of vsync so you can look at the maximum frame
rates you application+database is capable of doing on that hardware +
application behavior.  It should be just a quick look when
benchmarking though, as soon as the benchmarking to look at something
specific about performance you should switch vsync back on.  Rember
hitting vsync on every frame is the real goal that you should be
striving for, the maximum frame rates with vsync off is really a false
goal which can lead you to make poor decisions on your database and
application.

To switch off vysnc use your driver control panel.

Robert.
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] How to get average frame rate after some amount of running time?

2009-12-24 Thread Nguyen Tien Dat
Yes, I doubt that this is the refresh rate of the monitor, not the
real frame rate. How could I avoid the "sync-to-vblank" thing, so that
I can have the actual frame rate?
Thanks,
Dat

On Wed, Dec 23, 2009 at 2:33 AM, Ulrich Hertlein  wrote:
> On 23/12/09 12:23 AM, Nguyen Tien Dat wrote:
>> frameRate = (double)numOfFrame/(endTime - startTime);
>>
>> But it always gives me about 60fps. Did I make a mistake somehow?
>> (startTime and endTime are in seconds already)
>
> 60Hz sounds like you are running with sync-to-vblank.
>
> /ulrich
> ___
> osg-users mailing list
> osg-users@lists.openscenegraph.org
> http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
>



-- 
Dat Tien Nguyen
PhD student, Computer Science Department
The University of Iowa, IA 52242
http://cs.uiowa.edu/~tinguyen
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] How to get average frame rate after some amount of running time?

2009-12-23 Thread Ulrich Hertlein
On 23/12/09 12:23 AM, Nguyen Tien Dat wrote:
> frameRate = (double)numOfFrame/(endTime - startTime);
> 
> But it always gives me about 60fps. Did I make a mistake somehow?
> (startTime and endTime are in seconds already)

60Hz sounds like you are running with sync-to-vblank.

/ulrich
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] How to get average frame rate after some amount of running time?

2009-12-22 Thread Nguyen Tien Dat
Dear Robert,
Thank for your answer. One more question. Right now I have my code like this:

numOfFrame = 0;
startTime = time(NULL);
while (!viewer.done())
{
   viewer.frame();
   numOfFrame ++;
}
endTime = time(NULL);
frameRate = (double)numOfFrame/(endTime - startTime);

But it always gives me about 60fps. Did I make a mistake somehow?
(startTime and endTime are in seconds already)
Thanks,
Dat

On Mon, Dec 21, 2009 at 3:17 AM, Robert Osfield
 wrote:
> Hi Dat,
>
> On Sun, Dec 20, 2009 at 8:26 PM, Nguyen Tien Dat  wrote:
>> Dear all,
>> Could you tell me a way to get the average frame rate after, for
>> example, 1 minute of running?
>
> The OSG itself doesn't give you this but it gives you all the tools to
> do it.  You have an osg::Timer for the time, and your have control
> over the frame loop so you can count the frames - so you can just do
> it yourselves for all th timings.  There is even an FrameStam
> viewer.getFrameStamp() that gives you the ReferenceTime and
> FrameNumber, see include/osg/FrameStamp for further details, if you
> just want to use the OSG built in timing/frame counting.
>
> All is left is a programming question... how do you computer averages
> over a specified period.  This is something I would expect most
> computer graphics programmers to be able to do.
>
>
> Robert.
> ___
> osg-users mailing list
> osg-users@lists.openscenegraph.org
> http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
>



-- 
Dat Tien Nguyen
PhD student, Computer Science Department
The University of Iowa, IA 52242
http://cs.uiowa.edu/~tinguyen
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] How to get average frame rate after some amount of running time?

2009-12-21 Thread Robert Osfield
Hi Dat,

On Sun, Dec 20, 2009 at 8:26 PM, Nguyen Tien Dat  wrote:
> Dear all,
> Could you tell me a way to get the average frame rate after, for
> example, 1 minute of running?

The OSG itself doesn't give you this but it gives you all the tools to
do it.  You have an osg::Timer for the time, and your have control
over the frame loop so you can count the frames - so you can just do
it yourselves for all th timings.  There is even an FrameStam
viewer.getFrameStamp() that gives you the ReferenceTime and
FrameNumber, see include/osg/FrameStamp for further details, if you
just want to use the OSG built in timing/frame counting.

All is left is a programming question... how do you computer averages
over a specified period.  This is something I would expect most
computer graphics programmers to be able to do.


Robert.
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


[osg-users] How to get average frame rate after some amount of running time?

2009-12-20 Thread Nguyen Tien Dat
Dear all,
Could you tell me a way to get the average frame rate after, for
example, 1 minute of running?
Thanks,
Dat

-- 
Dat Tien Nguyen
PhD student, Computer Science Department
The University of Iowa, IA 52242
http://cs.uiowa.edu/~tinguyen
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org