Page 1 of 1

Implement D3D SetGammaRamp

Posted: Sat Apr 09, 2011 3:22 pm
by SamJ
I can send the patch for this if the maintainers are interested.

SetGammaRamp is the function that all windows commercial games use to set gamma correction. It relies on a hardware capability implemented on 99% of the current GPUs. Sure there are some really old gpus that don't support it, but if it's good enough for Blizzard Entertainment it's good enough for you.

Ogre3D doesn't implement that because there's no OpenGL equivalent. The thing is that you *really* want to use that because other solutions are either too complicated (full transformation of all your textures, shaders, vertex colours) or have a performance hit (compositor). Crippling the D3D version of the game (which let's face it, it's the important one) just because you can't do the same in OpenGL is not nice. It forces you include the D3D headers and link against D3D directly in your app, ugh! And you guys are always telling us that doing direct3d calls is missing the point of ogre and that we should never do it, but you don't give us access to essential features like this, what's up with that, ogre team?

So, can we have this, pleeease? You don't even have to do anything, I will send the patch. Just let me know how you would like it implemented if you feel it necessary (in what class to place the call, etc). The function would call SetGammaRamp in D3D and do nothing on OpenGL.

Re: Implement D3D SetGammaRamp

Posted: Fri Jun 01, 2012 12:41 am
by drwbns
You should just post the patch here in case other devs want to use it :)

Re: Implement D3D SetGammaRamp

Posted: Fri Jun 01, 2012 8:01 am
by hallucinogen
Hey, you could post the patch, can be useful.

Re: Implement D3D SetGammaRamp

Posted: Fri Jun 01, 2012 9:03 pm
by Jabberwocky
I played around with SetGammaRamp recently, and had some issues with it.
1. it would affect the whole screen, not just the game (if running in windows mode)
2. it would leave the computer in the altered state if the game didn't properly shut down.

Since I don't see this happen with other modern games, either I was doing something wrong, or else people aren't using SetGammaRamp anymore.

Re: Implement D3D SetGammaRamp

Posted: Sat Jun 02, 2012 2:54 am
by Kojack
That sounds like what Unreal used to do (got hit by it the other day running the Swat 4 editor). Mess with everything's gamma and not restore it if it crashed.