Project

General

Profile

Feature #3491

Support Software-Side Gamma Correction

Added by Irrenhaus Three over 1 year ago. Updated about 2 months ago.

Status:
New
Priority:
Normal
Assignee:
-
Category:
GUI
Target version:
Start date:
08/11/2016
% Done:

0%

Severity:
Normal

Description

As described in https://bugs.openmw.org/issues/1983, interior cells are generally much darker than they were in Vanilla, and it becomes very difficult to see in exterior cells at night too - especially if playing during the daytime and having diffuse sunlight on the monitor.
The reason for that is that Vanilla had a gamma slider you could adjust to improve game visibility on your screen, which doesn't exist in OpenMW. Since changing the actual monitor gamma would include a metric ton of hardware support, it's understandable that this is not the way to go.
So why not simulate it in software? You wouldn't be changing any hardware settings but adjust colors, light intensity and whatnot in either textures or finalized frames instead.

For further reading, see this article about the principle of gamma correction: http://gamedevelopment.tutsplus.com/articles/gamma-correction-and-why-it-matters--gamedev-14466

Thanks for your time, keep up the good work. :)


Related issues

Related to OpenMW - Bug #1983: Indoor cells are too dark Confirmed 10/06/2014

History

#1 Updated by scrawl . over 1 year ago

We have the gamma correction slider implemented using SDL, but it doesn't seem to work on Linux at the moment (hence it's disabled in Linux builds).

#2 Updated by Irrenhaus Three over 1 year ago

Jannik Heller wrote:

We have the gamma correction slider implemented using SDL, but it doesn't seem to work on Linux at the moment (hence it's disabled in Linux builds).

I see, that explains why I'm not seeing it. :)
It's good to know though that it's being worked on. Thanks again.

#3 Updated by Alexei Dobrohotov 12 months ago

  • Target version set to openmw-0.42

#4 Updated by Alexei Dobrohotov 11 months ago

  • Related to Bug #1983: Indoor cells are too dark added

#5 Updated by Marc Zinnschlag 10 months ago

  • Target version changed from openmw-0.42 to openmw-0.43

#6 Updated by Alexei Dobrohotov 5 months ago

  • Target version changed from openmw-0.43 to openmw-1.0

#7 Updated by Miloslav Číž about 2 months ago

I've had a ton of problems with gamma in games on Linux, it's a bug in SDL. Some projects use various hacks to overcome this. Could we adopt this approach?

#8 Updated by Andrei Kortunov about 2 months ago

Could we adopt this approach?

It would be nice. Also I noticed that 'gamma' setting from settings.cfg started to work on Linux after SDL upgrade to 2.0.5.
xorg-server is 1.19.5, if it matters.

#9 Updated by Andrei Kortunov about 2 months ago

So basically we should try to set the gamma via SDL first, and if it fails, use the fallback hack, right?

#10 Updated by scrawl . about 2 months ago

That's nice, can we have a confirmation from another user that SDL 2.0.5 works?

I don't see the need to work on a hack if this has been fixed in SDL. For what it's worth, the approach linked in comment #7 isn't gamma, it's just brightness; and the additional full-screen quad will reduce performance a little bit.

#11 Updated by Andrei Kortunov about 2 months ago

Sorry for misleading: gamma still works after downgrade to 2.0.4.

SDL expects the DirectColor window to apply the gamma correctly, but it get the TrueColor one from X server. IIRC, this problem was claimed to be fixed in the one of X server updates several months ago, but it did not work for me. I actually have no idea why it started to work now.

#12 Updated by Miloslav Číž about 2 months ago

I have Linux Mint 18.1 and have these packages: libsdl2-2.0-0/xenial,now 2.0.4+dfsg1-2ubuntu2 amd64, libsdl2-dev/xenial,now 2.0.4+dfsg1-2ubuntu2 amd64, I unhid the gamma slider and tested it but doesn't seem to work.

#13 Updated by Miloslav Číž about 2 months ago

What if we made a general postprocessing shader that would not only allow us to deal with this, but also do other stuff like adjust contrast, saturation, bloom effect etc.? Instead of a cheap hack we might as well go for a full-blown feature. Later it would be useful to modders who could plug in their own GLSL code to do all kinds of crazy stuff.

#14 Updated by Miloslav Číž about 2 months ago

I made a quick mockup video. I think it could really bring the graphics to another level, should I add it as a separate feature request?

#15 Updated by scrawl . about 2 months ago

I was hoping we could use the osg EffectCompositor for that - see #4067.

#16 Updated by Miloslav Číž about 2 months ago

Oh OK, I searched for post-processing and didn't find that, sorry.

Also available in: Atom PDF