Implement D3D SetGammaRamp

What it says on the tin: a place to discuss proposed new features.
Post Reply
SamJ
Halfling
Posts: 40
Joined: Tue Jan 25, 2011 9:12 pm

Implement D3D SetGammaRamp

Post 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.
drwbns
Orc Shaman
Posts: 788
Joined: Mon Jan 18, 2010 6:06 pm
Location: Costa Mesa, California
x 24

Re: Implement D3D SetGammaRamp

Post by drwbns »

You should just post the patch here in case other devs want to use it :)
User avatar
hallucinogen
Gnoblar
Posts: 7
Joined: Fri Jun 01, 2012 7:44 am

Re: Implement D3D SetGammaRamp

Post by hallucinogen »

Hey, you could post the patch, can be useful.
User avatar
Jabberwocky
OGRE Moderator
OGRE Moderator
Posts: 2819
Joined: Mon Mar 05, 2007 11:17 pm
Location: Canada
x 218
Contact:

Re: Implement D3D SetGammaRamp

Post 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.
Image
User avatar
Kojack
OGRE Moderator
OGRE Moderator
Posts: 7157
Joined: Sun Jan 25, 2004 7:35 am
Location: Brisbane, Australia
x 534

Re: Implement D3D SetGammaRamp

Post 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.
Post Reply