Game Development Community

Gamma adjustment

by Ronald J Nelson · in Torque Game Engine Advanced · 02/25/2008 (8:47 pm) · 2 replies

Just a quick question. In TGE there was a gamma correction setting in the options GUI that is not in TGEA. Is there any way to do this with TGEA?

#1
02/25/2008 (11:10 pm)
I was looking for this the other day. The videoSetGammaCorrection Console function was commented out from TGEA.

In platformVideo.cpp try uncommenting it and moving the variables above the function.
static F32 sgOriginalGamma = -1.0;
static F32 sgGammaCorrection = 0.0;

ConsoleFunction(videoSetGammaCorrection, void, 2, 2, "setGammaCorrection(gamma);")
{
   argc;
   F32 g = mClampF(dAtof(argv[1]),0.0,1.0);
   F32 d = -(g - 0.5);

   if (d != sgGammaCorrection &&
   	 (sgOriginalGamma != -1.0 || Video::getGammaCorrection(sgOriginalGamma)))
      Video::setGammaCorrection(sgOriginalGamma+d);
	sgGammaCorrection = d;
}

Havent tested it... at work. I'll play with it again when I get home.
#2
02/26/2008 (4:50 pm)
Yeah I tried it and it didn't work. It is probably due to the DirectX to OpenGL differences.