For direct access use https://forums.oldunreal.com
It's been quite a while since oldunreal had an overhaul, but we are moving to another server which require some updates and changes. The biggest change is the migration of our old reliable YaBB forum to phpBB. This system expects you to login with your username and old password known from YaBB.
If you experience any problems there is also the usual "password forgotten" function. Don't forget to clear your browser cache!
If you have any further concerns feel free to contact me: Smirftsch@oldunreal.com

OpenGL gamma/brightness correction

Questions, Tips&Tricks for the special patches
User avatar
GreatEmerald
OldUnreal Member
Posts: 5347
Joined: Mon May 21, 2007 2:30 pm

OpenGL gamma/brightness correction

Post by GreatEmerald »

Is there a way to get how much exactly is OpenGL changing the screen gamma/brightness during play? These changes are not reflected in screenshots and videos, and that's rather annoying because things look way too dark. If there is a way to tell how much is changed, then I can manually edit them to match what I see.
User avatar
Smirftsch
Administrator
Posts: 9008
Joined: Wed Apr 29, 1998 10:00 pm
Location: NaPali

Re: OpenGL gamma/brightness correction

Post by Smirftsch »

no idea if this is of any use for you (simplified code):

Code: Select all

SDL_SetGammaRamp( gammaRamp.red, gammaRamp.green, gammaRamp.blue );
and:

Code: Select all

                FLOAT RedGamma = 1.0f / (2.5f * (GammaCorrection+GammaOffsetRed));
            FLOAT GreenGamma = 1.0f / (2.5f * (GammaCorrection+GammaOffsetGreen));
            FLOAT BlueGamma = 1.0f / (2.5f * (GammaCorrection+GammaOffsetBlue));
            
            for (u = 0; u < 256; u++) 
            {
                  int iVal;
                  int iValRed, iValGreen, iValBlue;

                  //Initial value
                  iVal = u;

                  //Brightness
                  iVal += brightness;
                  //Clamping
                  if (iVal < 0) iVal = 0;
                  if (iVal > 255) iVal = 255;

                  //Gamma
                  iValRed = (int)appRound((float)pow(iVal / 255.0f, rcpRedGamma) * 255.0f);
                  iValGreen = (int)appRound((float)pow(iVal / 255.0f, rcpGreenGamma) * 255.0f);
                  iValBlue = (int)appRound((float)pow(iVal / 255.0f, rcpBlueGamma) * 255.0f);

                  //Save results
                  gammaRamp.red[u] = (BYTE)iValRed;
                  gammaRamp.green[u] = (BYTE)iValGreen;
                  gammaRamp.blue[u] = (BYTE)iValBlue;
            }
while Brightness refers to the value in the ini in [SDLDrv.SDLClient], from 0.1 to 1.0
Sometimes you have to lose a fight to win the war.
User avatar
GreatEmerald
OldUnreal Member
Posts: 5347
Joined: Mon May 21, 2007 2:30 pm

Re: OpenGL gamma/brightness correction

Post by GreatEmerald »

Huh, that's 0.5 by default, so it just adds +0.5 to each colour component? That's not a whole lot... And also looks like it doesn't translate to [url=http://en.wikipedia.org/wiki/YUV]YUV[/url] (which is what videos are using) well at all, because Y reacts to G much more than to B :\ Oh well, it looks like having it approximated through YouTube enhancements is probably the best way to go anyway.

Return to “OpenGL & D3D for Unreal & UnrealTournament”