Fullscreen decreases performance

If you are a new Irrlicht Engine user, and have a newbie-question, this is the forum for you. You may also post general programming questions here.
Post Reply
FumarMata
Posts: 13
Joined: Fri Mar 02, 2007 12:26 pm

Fullscreen decreases performance

Post by FumarMata »

Hello

Do you know why fullscreen decreases my application performance?

My laptop screen is 1280*768 and the app runs perfectly when I play it at that size (showing all the frame, the windows toolbar, etc.), but if I play exactly the same movie fullscreen, it goes much slower

thanks in advance

marc
hybrid
Admin
Posts: 14143
Joined: Wed Apr 19, 2006 9:20 pm
Location: Oldenburg(Oldb), Germany
Contact:

Post by hybrid »

Maybe you don't get the same screen depth/stencil buffers etc. on your desktop as you get in fullscreen.
FumarMata
Posts: 13
Joined: Fri Mar 02, 2007 12:26 pm

Post by FumarMata »

and is there a way to solve it?
JonLT
Posts: 152
Joined: Thu Mar 15, 2007 5:47 pm
Location: Denmark

Post by JonLT »

I dont really know, but the problem might be vsync.
This can be set when you create an IrrlichtDevice.
hybrid
Admin
Posts: 14143
Joined: Wed Apr 19, 2006 9:20 pm
Location: Oldenburg(Oldb), Germany
Contact:

Post by hybrid »

That might be even a better guess than mine, is your FPS drop always to 60 or 75 FPS?
George
Posts: 7
Joined: Tue Jun 20, 2006 12:28 am
Location: Sydney, Australia

Post by George »

If you are running in full screen mode and you have vsync enabled then the maximum frame rate will be the frame rate of your monitor.

To test it, simply change your monitor refresh rate and re-run the application.
CuteAlien
Admin
Posts: 9720
Joined: Mon Mar 06, 2006 2:25 pm
Location: Tübingen, Germany
Contact:

Post by CuteAlien »

With the current implementation the frame rate will actually not be the rate of your monitor but 60 FPS. At least on OpenGL/Windows. Which means that changing the monitor frequency will also make no difference - that value is not used in fullscreen. Not sure if it's different in DirectX.

But disabling vsync should already be enough to find out if this is the problem.
hybrid
Admin
Posts: 14143
Joined: Wed Apr 19, 2006 9:20 pm
Location: Oldenburg(Oldb), Germany
Contact:

Post by hybrid »

This should be correct to fix the vsync to monitor refresh

Code: Select all

        if (wglSwapIntervalEXT)
                wglSwapIntervalEXT(vsync ? 1 : 0);
The one means wait for 1 refresh interval before redrawing.
CuteAlien
Admin
Posts: 9720
Joined: Mon Mar 06, 2006 2:25 pm
Location: Tübingen, Germany
Contact:

Post by CuteAlien »

@hybrid: This is correct (thought there is no reason to restrict vsync to a bool as 2 is also a legal value here). The problem is simply that the monitor refresh rate in fullscreen has nothing to do with the refresh rate which you set in windows. That's something which would have to be changed in CIrrDeviceWin32::switchToFullScreen. To set another frequence one would have to add somthing like that:

Code: Select all

dm.dmDisplayFrequency = frequency;
dm.dmFields |= DM_DISPLAYFREQUENCY;
I don't know why the default is that you get 60Hz, this is just the experience i made.
hybrid
Admin
Posts: 14143
Joined: Wed Apr 19, 2006 9:20 pm
Location: Oldenburg(Oldb), Germany
Contact:

Post by hybrid »

Ok, so that means Irrlicht's OpenGL fullscreen under Windows flickers on CRTs?
CuteAlien
Admin
Posts: 9720
Joined: Mon Mar 06, 2006 2:25 pm
Location: Tübingen, Germany
Contact:

Post by CuteAlien »

I wouldn't say 60HZ is already flickering. It's just not the rate of the monitor which is set in windows. Which i my experience can be somewhat puzzling when you're profiling your game ;-)
vitek
Bug Slayer
Posts: 3919
Joined: Mon Jan 16, 2006 10:52 am
Location: Corvallis, OR

Post by vitek »

The refresh rate value set in the Windows display settings will have no effect on the refresh rate seen in a full screen d3d app. The refresh rate for a full-screen exclusive d3d app is set in the FullScreen_RefreshRateInHz field of the present params. Right now it is getting set to D3DPRESENT_RATE_DEFAULT which allows the runtime to select an appropriate value. I don't believe that setting the dmDisplayFrequency member of the device mode is enough to do it. Maybe I'm wrong...

Travis
CuteAlien
Admin
Posts: 9720
Joined: Mon Mar 06, 2006 2:25 pm
Location: Tübingen, Germany
Contact:

Post by CuteAlien »

Sorry, i can't tell about d3d. I only tested my solution with OpenGL. So i guess that Travis is right and it has do be done somewhat different for d3d.
Post Reply