Hi gamedevs!
I've been googling my issue for days now, nothing comes up that would solve it. People have similar problems, but this one seems unique to me?!
To get to the point, here's what I have:
- custom C++ engine, doing the baby steps, for now. I can render 2D sprites with transparency properly
- OpenGL (4.4 core) with SDL2, glew
- 2 SRGB Frambuffers, I render to the 1st, then post-effects to the 2nd, then blit it to the default FBO
- Windows 10 desktop PC, 4k screen (well, two of them, different types)
- GeForce GTX 1050 Ti, latest drivers
SDL_GL_SetAttribute(SDL_GL_FRAMEBUFFER_SRGB_CAPABLE, 1);
glEnable(GL_FRAMEBUFFER_SRGB)
;
So, the problem:
In windowed mode, the gamma is fine. Whenever I go "full screen" (not even exclusive mode, just borderless, i.e. SDL_WINDOW_FULLSCREEN_DESKTOP), the screen suddenly becomes too dark. Here's the fun part: if I then press the volume up/down multimedia key, then while the Win10 overlay is showing, the gamma becomes correct!! But the moment when the volume overlay is gone, boom, darker screen again. While it's "switching", I can see pink-ish, green-ish artifacts for about 1/10 of a second. Switching back to windowed, it's fine again. Screenshots done while fullscreen look fine.
Now, I have no idea what causes this - is it SDL, OpenGL, Windows, GPU drivers, or my monitor (both of them do this)? I'm hoping someone can help figure this out. I'll be eternally grateful, since this is making me pull my hair out. Disclaimer: I'm not that experienced in this area (graphics programming, GPUs), my greatest achievement was a deferred renderer playground (it used WinApi - not SDL).
Help me please!!
Adam B
EDIT: Forgot to mention that I've checked many settings already. In NVIDIA Control Panel, I don't have anything suspicious, under "Adjust desktop color settings", it's "Use NVIDIA settings". Nothing that would indicate any kind of overrides. Windows 10's Game Mode ON/OFF doesn't make a difference. Game bar is OFF.