Sign in to follow this  

why my game's fps can faster than my display's fps????

This topic is 4087 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

why my game's fps can faster than my display's fps???? I know this problem is very basic ,but I really can't understand it, when my game begin to rend again and again but my display refurbishing is so slow that it can't really rend at the pace of my game's fps next is my code of Rending. ------------------------------------------------------------------- Device->Clear(0, 0, D3DCLEAR_TARGET | D3DCLEAR_ZBUFFER, 0xff0000ff, 1.0f, 0); Device->BeginScene(); D3DXMATRIX I; D3DXMatrixIdentity(&I); if( TheTerrain ) TheTerrain->draw(&I, false); if( FPS ) FPS->render(0xffffffff, timeDelta); Device->EndScene(); Device->Present(0, 0, 0, 0)

Share this post


Link to post
Share on other sites
I am guessing the answer to your problem is to enable/disable wait for v-sync in either your code or in your PCs video card settings. If you have wait for vsync enabled, and your monitor refreshes at 60hz, you arent going to get more the 60 fps.

Share this post


Link to post
Share on other sites
Basically, your game is going through its main loop at say 70fps. The screen can say do only 60fps. Your game is running just fine, its just that the monitor may miss a few. Using v-sync can solve this problem quite easily.

V-Sync basically has your program wait to render until the monitor is ready.

Share this post


Link to post
Share on other sites
Just to expand upon the explanations above a bit, monitors draw the screen from top to bottom, then there is a brief period, known as the vertical retrace, between the end of one screen being drawn and the next. When a program is "waiting for the vsync", it means it is waiting until this period before it draws the next scene. D3D will wait for this period when you call ->Present unless you tell it not to.

The reason for this is that if the monitor was halfway through drawing one screen and the graphics hardware updated the screen buffer with a new screen, what would briefly appear on the screen would be the top half of one frame and the bottom half of another.

This causes an effect known as tearing. Generally graphics applications will wait for the vertical retrace to ensure that, for any given monitor refresh, there is only one given frame in the screen buffer.

While you can disable vsync to increase your frame rate, you shouldn't. There are two reasons this is a bad idea - one, you can get the tearing effects described above and two, a user can override this with their local settings to force your app to wait for vsync, so you are back to square one.

Write your game (or whatever) so it runs independantly of the actual frame rate by calculating the time elapsed since the last frame and using this value to modify how fast things move and animate and so on. 60 fps is more than enough to appear "smooth" to the human eye.

Share this post


Link to post
Share on other sites
User could disable wait for vsync, and you would have a problem. Use triplebuffering.

I use drawing at speeds around 24 FPS, 25/30 FPS if I can know the refresh rate of the monitor.

Of course I have decoupled input from the game engine, and the game engine is decoupled from 3D engine.

Share this post


Link to post
Share on other sites
Quote:
Original post by Raghar
User could disable wait for vsync, and you would have a problem. Use triplebuffering.

I use drawing at speeds around 24 FPS, 25/30 FPS if I can know the refresh rate of the monitor.

Of course I have decoupled input from the game engine, and the game engine is decoupled from 3D engine.


I'm curious - what would the advantage of triple buffering be if the user had disabled vsync?

Share this post


Link to post
Share on other sites
Quote:
Original post by EasilyConfused
I'm curious - what would the advantage of triple buffering be if the user had disabled vsync?
Obviously, no tearing and more fluid drawing. Thought the differences between double and triple buffering are often negligible.




Re repeat4 you might like to look here:
http://www.thefreedictionary.com/rend

Also this page,
http://www.tech-hounds.com/article8/ArticlesPage3.html
and all other pages here
http://www.tech-hounds.com/articles.html
might be quite useful. (Cleanly done pages about basics, and about some quite important details)

Share this post


Link to post
Share on other sites
I thought that the whole point of triple buffering was that while the first back buffer was waiting (for the vertical retrace) to swap with the primary buffer to the screen, you could go ahead and render to the second back buffer while waiting.

Surely if vsync is off, triple buffering is meaningless? And how, without vsync, does triple buffering prevent tearing? Sorry if I'm misunderstanding and please explain if my understanding is flawed in some way as I've never used triple buffering. I did think I understood the concept though.

Share this post


Link to post
Share on other sites

This topic is 4087 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this