Welcome, Guest. Please login or register. Did you miss your activation email?

Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Messages - hiram

Pages: [1]
1
General / Re: FPS Peaks with VSync-enabled (59Hz refresh rate)
« on: August 31, 2014, 12:06:11 pm »
Perfect explanation, Ixrec. Thank you so much! Learnt a lot with you.

2
General / Re: FPS Peaks with VSync-enabled (59Hz refresh rate)
« on: August 31, 2014, 11:22:09 am »
FYI: I calculate the FPS by 1 / dt, once I want to know how many "dt" fits in one second.

3
General / Re: FPS Peaks with VSync-enabled (59Hz refresh rate)
« on: August 31, 2014, 11:20:26 am »
Hi Ixrec,

First of all, thanks for dedicating your precious time writing a so complete answer.

I'm measuring FPS this way:

sf::ContextSettings settings;
settings.antialiasingLevel = 16;
sf::RenderWindow window(sf::VideoMode(1280, 720), "Test SFML", sf::Style::Default, settings);
window.setKeyRepeatEnabled(false);
window.setMouseCursorVisible(false);
window.setVerticalSyncEnabled(true);
// window.setFramerateLimit(59);

Game game;
sf::Clock clock;
float dt;
game.init();
while (window.isOpen()) {
    dt = clock.restart().asSeconds();
    window.clear();
    game.update(dt);
    game.render(window);
    window.display();
}

About setting Framerate limit to 59, it works perfectly. FPS keeps nearly constant (small variation). The problem with the V-Sync is that the deltaTime just goes from 0.0016 to 0.00001 (random values), and when it comes back to 0.0016 the animation is affected, once it depends on deltaTime.

Am I measuring time correctly?

I'm on iMac. Its hardware is very good. The GPU is AMD Radeon HD 6750M 512 MB. That's why I'm surprised to see the framerate spikes happening on rendering frames with just a green sf::Circle and a sf::Sprite moving.

4
General / Re: FPS Peaks with VSync-enabled (59Hz refresh rate)
« on: August 30, 2014, 10:22:44 pm »
totally agreed, Hapax.

Anyway, I'm new to game dev, but one of the main reasons to use fixed timestep is because of that FPS variation that everyone have to face, right?

As I am still learning, I don't usually know what is my fault and what is just how things works :-)

5
General / Re: FPS Peaks with VSync-enabled (59Hz refresh rate)
« on: August 29, 2014, 01:41:58 pm »
BTW, a great tutorial on fixed time step.

http://gafferongames.com/game-physics/fix-your-timestep/

6
General / Re: FPS Peaks with VSync-enabled (59Hz refresh rate)
« on: August 29, 2014, 01:26:14 pm »
Yeah, I understand. But do you observe this behavior in your OS & GPU? It might be something related to the driver, but I don't see those peaks happening on other games with V-Sync enabled. I have no idea.

7
General / FPS Peaks with VSync-enabled (59Hz refresh rate)
« on: August 29, 2014, 01:12:46 pm »
Hello,

I'm observing the FPS peaks in a program with V-Sync Enabled on a monitor with 59Hz refresh rate. Framerate limit is disabled, as expected. FYI, it's on a Mac OS X 10.10 (haven't tested the same code in other OSes), I'm using latest SFML (master) from Git (compiled as Release).

As far as I know, V-Sync tends to keep framerate (FPS) similar to the monitor refresh rate. The magic happens on GPU. However, I'm observing these peaks and it's causing sprites movements to"lag", once they are dependent on deltaTime (time per frame) and a big variation will affect the movement.

I've attached a chart with my measurements. The peaks happens intermitently. They are not caused by something I do on the main loop.

Is that a normal behavior with V-Sync enabled?

Note: I was expecting the FPS to be nearly constant. Also, I know I could use setFramerateLimit, but I'd rather prefer to trust on the underlying hardware mechanisms to achive the desired FPS.

Pages: [1]
anything