Colour profiles in games. The new "widescreen" controversy.

General discussions about PC games/gaming.
User avatar
DaFox
Posts: 2356
Joined: 14 Nov 2006, 15:48

Re: Colour profiles in games. The new "widescreen" controversy.

Post by DaFox »

Ian (the author of cclutch) can probably explain more in detail if he decides to sign up.


Indeed, I really would be quite interested in the technical details of implementing it. Right now most games are made exactly the same way, a window is created with WinAPI with a 'flag' to set it to fullscreen. So really by default it isn't the games fault. It's either Windows or the video drivers that disable it in Fullscreen apps.

If there is a way for the application to override it and explicitly ask to use the active color profile It would be really nice for documentation, and without it your idea really cannot go anywhere sadly.
User avatar
suiken_2mieu
Insiders
Insiders
Posts: 2351
Joined: 20 Aug 2009, 04:20
Location: Virginia
Contact:

Re: Colour profiles in games. The new "widescreen" controversy.

Post by suiken_2mieu »

To OP: I can see why people would be frustrated with this issue, as most people, who even have "Matching Monitors" Have different revs or may even have refurbs with different panels.

Though, I honestly don't notice the color difference too much. Also I thought you could force the color profiles through drivers.
System Core: | Intel Core i5-2500K + ASUS P8Z68-V + 16GB Corsair XMS3 DDR3 1333 MHz | Win7 x64 | MSI R7970 Lightning 3GB [1105/1400] |
Display: | 3 x Dell Ultrasharp 3007WFP-HC @ 7680x1600 | Dell u3011 |
User avatar
Dem Pyros
Posts: 1060
Joined: 08 Dec 2006, 06:01

Re: Colour profiles in games. The new "widescreen" controversy.

Post by Dem Pyros »

In fact, I can only think of one WSGF member off the top of my head that I seem to remember having colour calibration hardware - X-Warrior.

I also have color calibration hardware and a color calibrated system (well, several). Nevertheless, my main gaming system only has TN panels, sadly.

It would be nice if developers implemented it, but it doesn't terribly bother me (wheras with photos it's essential).
yoitsmeremember
Posts: 1
Joined: 07 Dec 2010, 00:14

Re: Colour profiles in games. The new "widescreen" controversy.

Post by yoitsmeremember »

[quote]Ian (the author of cclutch) can probably explain more in detail if he decides to sign up.


Indeed, I really would be quite interested in the technical details of implementing it. Right now most games are made exactly the same way, a window is created with WinAPI with a 'flag' to set it to fullscreen. So really by default it isn't the games fault. It's either Windows or the video drivers that disable it in Fullscreen apps.

If there is a way for the application to override it and explicitly ask to use the active color profile It would be really nice for documentation, and without it you're idea really cannot go anywhere sadly.
Alright, sorry it has taken me so long to get signed up here, I've been very busy these last few weeks with personal and school obligations.

Anyway, the problem is, at least on the DirectX front, not a problem of what a game doesn't do, but rather a problem of what a game does do. Full-screen Direct3D applications do not inherently screw up color calibration. The problem occurs when a specific function is called--in Direct3D9 and earlier, this is SetGammeRamp(), and in later versions it was moved to the DXGI and renamed SetGammaControl() (simply referred to as SGR()/SGC() from here on). These are the functions that cause loss of color calibration. While I can't say with 100% accuracy whether the problem itself lies in Microsoft's design of the API or the implementation by the various graphics card vendors (nVIDIA/ATi/Intel), with the problem occurring on several vendors cards I would assume it is behaving exactly how Microsoft designed it.

It's even more ambiguous when you look at the documentation. There is actually a flag that can be passed to the function, D3DSGR_CALIBRATE, which "If a gamma calibrator is installed, the ramp will be modified before being sent to the device to account for the system and monitor response curves." However, upon testing, I found that this either doesn't work as expected (at least on my 5850), or works exactly as expected but the "gamma calibrator" doesn't include installed monitor profiles and therefore is seemingly useless anyway. If it doesn't include the "curves" of monitor profiles, what does it refer to then?

The reasons for even calling such a function to begin with are dubious. Originally, it seems this was used by developers to "fade out" or "fade in" a scene, or provide some basic color filtering, which was not very easy to do efficiently back in the day. This doesn't seem to be in practice in any game made in the last ~5 years that I've played, judging from my experience playing them both with and without Color Clutch in use (explained later).

More recently, games seem to use it in a different fashion--to provide users who have no such monitor calibration some in-game adjustment. Ultimately, developers want the game to look the same way to the end user that it looked to them, and setting gamma ramps is a quick, though incomplete and incorrect fix for this. A better way would allow users to set brightness, contrast, and gamma using a shader, which is what I believe some of the newer games are doing. For instance, I recently purchased BF:BC2, and it has brightness and contrast (no gamma) adjustments which thankfully never call SGC().

The easy fix for those who want full screen gaming while holding on to their monitor calibration is to simply not call the function. Unfortunately, most games call SGR()/SGC() no matter what, even if there have been no adjustments to the gamma in the settings. That was why I wrote Color Clutch. The theory behind it is simple--prevent the games from calling these functions, and your color calibration will survive. There aren't a whole lot of good ways to do this, so I took what I thought was the best way; injecting a DLL into the process, and then, whenever it tries to call SGR()/SGC(), instead it calls my "bogus" function with the same parameters. The only difference between the real function and mine is that my function doesn't actually do anything.

As for current plans regarding Color Clutch, I'm working on support for some older versions of DirextX (specifically 6, which I think is the first version to include a SGR() function, and 7). This is made difficult by the complete lack of documentation pertaining to these old APIs, but I should eventually be able to get something out that works. OpenGL, though, has no apparent analog to SGR()/SGC(), so I don't believe I can do anything there, and I'm not entirely sure how, why, or even if some users are losing calibration on OGL games.

Sorry about the long post, but I thought it was better to be thorough than lacking. :)
User avatar
DaFox
Posts: 2356
Joined: 14 Nov 2006, 15:48

Re: Colour profiles in games. The new "widescreen" controversy.

Post by DaFox »

Awesome stuff, thanks Ian.
lobski
Posts: 93
Joined: 17 Apr 2008, 09:36

Re: Colour profiles in games. The new "widescreen" controversy.

Post by lobski »

Thanks for the great explanation.

From the looks of it, it looks like the single point of failure lies in with whomever the developers are. Which I suppose can be taken as good news, and it looks like the problem isn't a terribly difficult thing to "fix". If what Ian speculates turns out to be true, and that the only reason games lose their colour is because of an archaic means to fade out/in games, perhaps the developers could be lobbied to implement this properly. It is quite obvious that lobbying Microsoft for them to fix this error in their DirectX suites, so perhaps it's best going directly to the developers.
Tanuki
Posts: 2866
Joined: 07 Jul 2007, 23:55

Re: Colour profiles in games. The new "widescreen" controversy.

Post by Tanuki »

Is this related to Windows 7? Doesn't XP force fullscreen apps to use custom settings?
lobski
Posts: 93
Joined: 17 Apr 2008, 09:36

Re: Colour profiles in games. The new "widescreen" controversy.

Post by lobski »

I'm pretty sure its DirectX related, and happens on all versions of Windows, XP, Vista, W7, etc.
User avatar
DaFox
Posts: 2356
Joined: 14 Nov 2006, 15:48

Re: Colour profiles in games. The new "widescreen" controversy.

Post by DaFox »

I'm pretty sure its DirectX related, and happens on all versions of Windows, XP, Vista, W7, etc.


Yep, it definitely seems that it doesn't matter what version of Windows your running. According to Ian normally it works fine in fullscreen apps. Likely on all modern versions of Windows.
lobski
Posts: 93
Joined: 17 Apr 2008, 09:36

Re: Colour profiles in games. The new "widescreen" controversy.

Post by lobski »

I have also contacted Mike, author of Monitor Calibration Wizard. http://www.hex2bit.com/products/index.asp

MCW works for a number of games, but it is still a "soft" option, and the game is still able to "hard lock" back to the default uncalibrated colours once the game goes fullscreen. However, it does work for some games, I am guessing it works for games that are not explicit about defaulting the colour values.
lobski
Posts: 93
Joined: 17 Apr 2008, 09:36

Re: Colour profiles in games. The new "widescreen" controversy.

Post by lobski »

Also, the most annoying game for me right now is Dragon Age. I want to play it and complete it, but I can't seem to get custom colours to stick with this game. Color Clutch doesn't work, neither does MCW.

The only workaround is to launch the game in windows and run ShiftWindows on it. But I have to do it every single time. Why don't more games support borderless windowed?
lobski
Posts: 93
Joined: 17 Apr 2008, 09:36

Re: Colour profiles in games. The new "widescreen" controversy.

Post by lobski »

The author of MWC wrote back;

Thanks for your email.

MCW uses some Windows API (application programming interface) to adjust the colors, basically a couple functions to set the gamma ramp lookup table. It works well within Windows, and a number of games (specifically OpenGL based games). However, support within Direct3D games become dependent on the video drivers to "care" about this lookup table and to carry the settings over into what is rendered through Direct3D. Support in that regard has typically been kept, but it does get broken from time to time by the video card driver developers.

The other issue is that the video card drivers themselves have their own color correction support built in, and often that correction takes precedence over the Windows gamma ramp tables. I have an option in MCW to "apply fix to override driver level color correction", which attempts to workaround some video card driver implementations. It does this by setting the gamma ramp table twice, with two different profiles. Oddly, that has worked decent as a workaround for the video card driver implementations, but may do nothing to help in your case.

In the long run, new methods other than the gamma ramp table may be needed to be used to support games. I haven't dug into it too much, but it may be possible to modify the Direct3D drawing surface being used by a game (unless Windows security prevents it). Otherwise, I would be looking at utilizing the APIs available in each video card driver. I know ATI does a good job of providing a programming interface to their drivers, so I wouldn't expect it to be difficult to get things working well on an ATI based video card. I haven't looked at nVidia yet, but I would imagine they have something similar available. Of course, going that route also means you have to build against a number of video card manufactures' programming interfaces (APIs), and support multiple versions and changes to those APIs, which gets to be a pain. This is why I think it might be better to bring pressure on the video card developers to keep proper support for the Windows gamma ramp API, so existing software doesn't break.

Back when Vista came out, Microsoft broke support for the gamma ramp API, requiring application to ask for permission before it could be used. This basically broken all the calibration software out there that wasn't written for Vista, and virtually all the OpenGL based games (as far as color correction built into the games). Later, Microsoft backed down on the security so everything worked as it did before. Some of the video card manufactures also built in workarounds into the video card drivers because of how slow Microsoft was in dealing with it.

There's no universal fix, but there are generally workarounds. I am a gamer myself, so I would certainly attempt to get things working within games if I can.

Mike
Post Reply

Who is online

Users browsing this forum: No registered users and 2 guests