Hard Light Productions Forums

Modding, Mission Design, and Coding => FS2 Open Coding - The Source Code Project (SCP) => Topic started by: CP5670 on July 24, 2005, 11:01:42 pm

Title: Refresh rates
Post by: CP5670 on July 24, 2005, 11:01:42 pm
Is there a way to specify the refresh rate in FS2 open?

If I play on Direct3D then this is not an issue because I am using the global refresh rate override for all DirectX games, but the interface looks all messed up in D3D (low res graphics and chopped up text) in the latest build. It looks fine in OpenGL, but the problem is it sets the refresh rate to 60hz by default there.

Also, many of the resolutions that are in the launcher's resolution list for D3D do not appear in the OGL list for some reason (basically anything above 1600x1200). I can manually set them in the registry and they work fine though. Is this a bug with the launcher?
Title: Refresh rates
Post by: taylor on July 25, 2005, 12:07:26 am
Not at the moment.  There will likely be an option added to the laucher soon though.  If for no other reason than to fix a related launcher bug.

As far as the available OpenGL resolutions, those are currently hardcoded.  I can't say that I know why though since the functions which are used to detect resolutions for D3D will also work for OpenGL.  This will likely be fixed at the same time that a refresh rate spinner is added.  At that point fullscreen OpenGL will use whatever refresh rate that you specify.
Title: Refresh rates
Post by: Admiral LSD on July 25, 2005, 12:25:55 am
Windows 2000/XP? This is a known issue that's been around for years. MS partially fixed it in XP but only for DirectX (no surprise there...). There are numerous utilities on the web that'll fix it, I was particularly fond of Reforce (http://www.pagehosting.co.uk/rf/download.html) before I noticed the ATi drivers have a refresh rate override in their control panels. Check your video drivers, there may already be a way to override it there.
Title: Refresh rates
Post by: taylor on July 25, 2005, 01:05:55 am
It is possible to set the refresh rates in the game, but only if you modify the source to let you.  Right now it just uses the default.  The utilities you can find on the net just let you change what the default actually is.  Having the game use a specifed refresh rate is easy, but right now there isn't a user friendly way to set it and sanity check it.  I don't mind going ahead and adding a way to use a particular refresh rate with a registry setting but if you fry your monitor or video card then don't come crying back here.
Title: Refresh rates
Post by: Admiral LSD on July 25, 2005, 02:04:15 am
You shouldn't have to hack FS to fix this, the best solution is to attack the root of the problem and fix the brain-damage within Windows itself, whether by using a 3rd party utility or the tools built-in to your video card drivers. This also has the advantage of working in other OGL games besides FSO.
Title: Refresh rates
Post by: taylor on July 25, 2005, 02:29:00 am
It's not a hack, we just don't set it.  We just have to add one line and a bit flag to make it use a specific refresh rate of our choosing.  Since we don't set it, Windows has to use something and will therefore use the default rate.  The only real brain-damage is that Windows keeps such a low refresh rate.  For DirectX, when fullscreen, it should use the current desktop refresh rate (I think) if possible unless you tell it otherwise.

For other OGL games (not including idSoftware stuff) it would be helpful to have the 3rd party utility.  But that utility won't mean crap for this game when we actually fix FSO to do this right since it would ignore whatever you set using the utility.  Windows is stupid for not handling fullscreen refresh rates the same in OGL as it does in D3D but the real issue here is that we aren't doing what we're supposed to in order to handle this properly.  I'm all for blaming Microsoft for everything but this is deffinitely one case where we just don't do things right.
Title: Refresh rates
Post by: Admiral LSD on July 25, 2005, 02:39:19 am
Under XP, DirectX does use the desktop refresh rate whereas OpenGL still uses the 60Hz default. In other words, MS saw fit to fix their own API but completely ignore a competing one. If MS had simply done the job properly in the first place then you wouldn't require any code modifications at all. However, the point is moreorless moot since the drivers for both the major video card families have facilities to fix the problem.
Title: Refresh rates
Post by: CP5670 on July 25, 2005, 03:42:29 am
So a setting for this will be added in soon?

Quote
Windows 2000/XP? This is a known issue that's been around for years. MS partially fixed it in XP but only for DirectX (no surprise there...). There are numerous utilities on the web that'll fix it, I was particularly fond of Reforce before I noticed the ATi drivers have a refresh rate override in their control panels. Check your video drivers, there may already be a way to override it there.


I haven't managed to find any utility that does exactly what I want with the refresh rates. The problem with things like RefreshForce are that they only allow one refresh rate setting per resolution. I have my desktop at 1280x960 at 85hz since the text looks very slightly sharper at that refresh rate, but want to play games at 120hz at this resolution. The refresh rate controls in the nvidia control panel have the same problem.

In my experience, it doesn't quite work in DirectX either. By default, it just sets everything to 75hz in my case even though I have my monitor's inf file installed. The way I currently have it working is through the refresh rate override setting in dxdiag, which is stored as a registry flag. This only allows you to set one refresh rate, which is used for all resolutions, but I sort of got around this by making several reg files that change this setting around. Before starting a game, I load the appropriate file to lock it to the correct refresh rate for whatever resolution the game runs in. A little cumbersome, but it has the advantage of not interfering with the Windows refresh rate and works on any fullscreen DX stuff.

I ran into this problem with a few other OGL games, but they all run on Doom 3 or Quake 3 engines and have console options to set the refresh rate.

Quote
As far as the available OpenGL resolutions, those are currently hardcoded. I can't say that I know why though since the functions which are used to detect resolutions for D3D will also work for OpenGL. This will likely be fixed at the same time that a refresh rate spinner is added. At that point fullscreen OpenGL will use whatever refresh rate that you specify.


It seems to be a detection issue only. I changed the registry flag VideocardFs2open to "OGL -(2048x1536)x32 bit" and it worked fine apart from being stuck at 60hz. It might be a good idea to just allow the user to type in any custom resolution; most modern games let you do that in some way.
Title: Refresh rates
Post by: taylor on July 25, 2005, 04:12:57 am
Quote
Originally posted by CP5670
So a setting for this will be added in soon?

Yeah, when I get the time (hopefully this week).  RT hasn't been around and there is at least one Launcher bug (the registry tab, long cmdline thing) that's been fixed since the last release.  I want 3.6.7 to have a Launcher with that fix.  There is one bug relating to multple 640x480 resolution entries being listed and adding a refresh rate control is a good way to clear that problem up.

Quote
It seems to be a detection issue only. I changed the registry flag VideocardFs2open to "OGL -(2048x1536)x32 bit" and it worked fine apart from being stuck at 60hz. It might be a good idea to just allow the user to type in any custom resolution; most modern games let you do that in some way.

You're right, it's just a detection problem.  Or rather a non-detection problem since it doesn't actually "detect" anything.  I'm going to at least update the resolution list to work like the D3D one does and give you a list of all supported resolutions.
Title: Re: Refresh rates
Post by: Niroborn on December 15, 2009, 03:23:25 am
Is there any changes? Does it possible to specify refresh rate now?
In Babylon 4 there is ogl_rate frag, but it doesn't work in TBP.

EDIT: OK I've picked the oldest thread :)
Title: Re: Refresh rates
Post by: Jeff Vader on December 15, 2009, 04:57:22 am
...

Start a new thread if you have questions.