News:

Building a 3D Ray Tracer  By stevmjon

Main Menu

Slow FPS

Started by RaverDave, October 06, 2006, 10:47:02 AM

Previous topic - Next topic

RaverDave

Hi ahain!i was just coding something and i noticed that when i came to animating sprites it was slow,so i did a small test program like so!!

; PROJECT : Project3
; AUTHOR  : Raverdave
; CREATED : 06/10/2006
; ---------------------------------------------------------------------

OpenScreen 640,480,32,2
SetFPS 60
ScreenVsync On
Mouse Off

do
Cls 0
   SetCursor 10,1
   Print "Current FPS:"+Str$(FPS())
   sync
loop



However all i get is 23 fps everytime,with or without sprites onscreen?! I dunno where i am going wrong, remming out screenvsync has no effect, the only thing i have done recently is formatted my pc,so i dont have the latest directx, i probably have 8.0?! But my graphics driver is up to date!

Any ideas??

ale870

The problem is "print" instruction.

Try to substitute it with:

Text 10, 10, fps() 
;)

I found some problems about speed when using ScreenVsync On and when I enable MMX instruction set (it seems my code goes slower  ???).

I have a notebook (video card intel 945) and CPU Centrino Duo.
--Alessandro

kevin

 Sounds like a driver issue.    I get 60 to 300fps on my old Duron 800mhz, GF2 machine


ale870

QuoteSounds like a driver issue.    I get 60 to 300fps on my old Duron 800mhz, GF2 machine

It could be possible, since Intel 945 is not a good card  :(

I will try it on different computers  :)
--Alessandro

kevin


  The speed of video refresh, (clearing,flipping, drawing video images etc) is directly a result of speed of your video hardware's blitter.   Not installing the correct driver or using he MS default one's is a sure way to make your system under perform.  As those functions will be performed in software.



ale870

It seems there is a big gap using Print() and Text.
Is there any particular reason?
Are such instructions so different?

--Alessandro

kevin

They are identical

Print uses, Text to render

ale870

Using the previous example, I made some tests:

Original code: 62 FPS
Without ScreenVsync: 499 FPS  :o

MMX enabled/disabled does not take any advantage.

I have a notebook Compaq NC6320 (office notebook).
CPU: Centrino DUO. Video Card: Intel 945 GM.

I hope this could help you to create a workaround to this funny problem.
--Alessandro

kevin


ale870

This problem:

Original code: 62 FPS
Without ScreenVsync: 499 FPS 

(for example).

Or this one...
MMX enabled/disabled does not take any advantage.
--Alessandro

kevin


  Neither are even remotely problems
QuoteThis problem:

Original code: 62 FPS
Without ScreenVsync: 499 FPS 

When Vsync is enabled the video fresh (buffer flips) is synchronized to the vertical beam of your video card.  If your monitor refreshes as 60, the app will be locked to 60. 

Quote(for example).
Or this one...
MMX enabled/disabled does not take any advantage.

   MMX is only used with FX buffers, not video surfaces



ale870

Thank you for this useful clarification!

If MMX extensions are available, do you think I must always enable them to speed up the game (not the previous code, but generally speaking).
--Alessandro

kevin


Quotedo you think I must always enable them

They are ON by default, the user should never have a reason to disable them

RaverDave

#13
well i stated that using or not using vsync has no effect on the results, the video card i have as always is a nvidia geforce 6600 and i always download the latest drivers for that card, my computer is as fresh as they get, formatted one day ago, without even printing anything i can see just by the movement of the sprites it aint too clever..
just to note i have an amd duron 1.7.... 1 gig of ram and the said gfx card, plus something like 120 gig of hard-drive space..blahblah,should be ample

RaverDave

Okay, i wanted to avoid having to register windows,or whatever its called, now unfortunately you cannot update directx without doing this, the reason i wanted to avoid it was coz you never speak to anybody english when you phone them and it takes 1 million attempts to rally codes back and forth to activate windows, anyhow i bit the bullet and phoned em,activated windows and installed latest directx, thankfully it did the job and i now get 56 fps or round abouts with my sprites flying around! :D... So it seems that playbasic didnt like directx 8,or my gfx card didnt...i dunno which, maybe the latter,as i had updated the latest gfx card drivers without updating directx