[Feature Request] Gamma in Windowed Mode

Started by glurex, Sun 26/02/2023 02:56:53

Previous topic - Next topic

glurex

I wasn't sure where to post this, but I guess this is the right place.

It's a triviality, very low priority request. But I'd want to know if there's a posibility to make System.Gamma works on windowed mode (for now this only works on MS Windows FullScreen). IDK if that's a hard thing to do (or if it's even possible), but I leave this request for future.

Thanks!

eri0o

#1
I think system.gamma current implementation uses real gamma, this is why it has such limits. There was once an implementation by @Alan v.Drake that was in his own experimental branches. It was not real gamma, but it was for all renders and it simulated it pretty well - it would not fix a badly adjust gamma of a monitor but it did simulated the adjustment in the renderers on top of what ever it was.

I don't remember the caveats/how well it worked.

I know real gamma modifies the entire display usually, so in SDL3, it's been removed - it was possible to modify gamma of the entire monitor in SDL2, but this causes some problems in platforms, as some system even try to correct for gamma when loading image files.

Are you trying to make a dark game and facing monitor differences?

glurex

Thanks for the info about how system.gamma works, eri0o!

Quote from: eri0o on Sun 26/02/2023 10:32:25Are you trying to make a dark game and facing monitor differences?

Yes, my game has some dark rooms (forests, wetlands). On some monitors it looks a bit too much darker but, as I've tested it, it's not a really really big problem. So I'm not too worried about it. Maybe I'll put a Gamma slider on my Config GUI, but with a warning that it will only works on fullscreen (disabling it when windowed).

Crimson Wizard

I'd like to note that OpenGL renderer don't have Gamma working at all at the moment (not even in a fullscreen).

eri0o

@Crimson Wizard , just for information, here is the fake gamma I mentioned: https://github.com/AlanDrake/ags-draconian/commit/987034cb6b75011347049587e7864fce80cb0962

The idea was that fake gamma was safer than real gamma - meaning, it would not affect other things in the monitor.

Alan v.Drake

I hadn't noticed I'd been mentioned here, but I always keep these custom commits constantly rebased as it's what I use to develop my game and test experimental stuff, so if we ever want to merge pieces of it they're always available in the primary branch in my repo (just refreshed a few hours ago).
The fake gamma should work fine as is, unless someone wants to write the implementation some way better.

- Alan

SMF spam blocked by CleanTalk