Gamma support in 1.3?

I’m quite surprised by this change; I would have thought this is a
fairly fundamental bit of functionality to have? In it’s absence anyone
using it with 1.2 will have to write their own when upgrading to 1.3.

personally i had only woes with gamma in sdl so i’m quite happy to see it gone
VittorioOn Mon, Feb 21, 2011 at 1:54 PM, Tim Angus wrote:

http://hg.libsdl.org/SDL/rev/3a8a452b49f0

I’m quite surprised by this change; I would have thought this is a fairly
fundamental bit of functionality to have? In it’s absence anyone using it
with 1.2 will have to write their own when upgrading to 1.3.


SDL mailing list
SDL at lists.libsdl.org
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org

This was only ever completely functional on hardware with cluts
(either 8-bit palettes or DirectColor LUTs), and never worked on Mac
OS X. Nowadays this is often done via shader parameters or gamma
corrected textures.

I’m not opposed to putting it back, but at this point it’s something I
can’t test and someone would need to step up and maintain.

See ya!On Mon, Feb 21, 2011 at 4:54 AM, Tim Angus wrote:

http://hg.libsdl.org/SDL/rev/3a8a452b49f0

I’m quite surprised by this change; I would have thought this is a fairly
fundamental bit of functionality to have? In it’s absence anyone using it
with 1.2 will have to write their own when upgrading to 1.3.


SDL mailing list
SDL at lists.libsdl.org
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org


? ? -Sam Lantinga, Founder and CEO, Galaxy Gameworks

This was only ever completely functional on hardware with cluts
(either 8-bit palettes or DirectColor LUTs), and never worked on Mac
OS X. Nowadays this is often done via shader parameters or gamma
corrected textures.

The trouble with this is that if shaders aren’t an option and doing
software gamma is infeasible/slow/poor quality, you’re forced into
writing the abstraction yourself. I don’t mind doing this in principle,
but most platforms require some context; context which SDL assumes
control over. So if you’re going to use SetDeviceGammaRamp,
XF86VidModeSetGamma or whatever, you’re going to need to get hold of the
relevant platform specific context structures. I’m not really sure how
you’d go about this without guessing and/or making assumptions about
what SDL does now and will do in the future, so this seems inherently
dangerous and icky to me.

In other words it seems to me that for many applications this forces you
into doing software/texture based gamma correction.

I’m not opposed to putting it back, but at this point it’s something I
can’t test and someone would need to step up and maintain.

Well I can probably look at the implementations on platforms I have
available to me if required, but it’s not something I would be able to
make any maintainanace commitment to, unfortunately. It doesn’t strike
me as something that would need a lot of ongoing maintenance however as
you would assume once working implementations exist, the underlying
platforms are unlikely to change things. Perhaps that’s naive of me though.On 21/02/2011 15:26, Sam Lantinga wrote:

Sam Lantinga wrote:

This was only ever completely functional on hardware with cluts
(either 8-bit palettes or DirectColor LUTs), and never worked on Mac
OS X.

This is puzzling, as our application has been using SDL gamma
fades on OS X and Windows since about 2004.

(We only use them in full screen mode.)

Regards,

Bill

This was only ever completely functional on hardware with cluts
(either 8-bit palettes or DirectColor LUTs), and never worked on Mac
OS X.

This is puzzling, as our application has been using SDL gamma
fades on OS X and Windows since about 2004.

(We only use them in full screen mode.)

Aleph One uses them as well. They only work sometimes in Mac OS X, and in
Windows they work partially but Windows DIB only lets you adjust the gamma
ramps so far, which results in our fades being all glitchy. DIB will never
let you black the screen, for instance.

Gamma fades work fine in X11 and old Mac OS, in fact I am the one who
contributed classic Mac gamma ramp support to SDL.

But, times change. We have a slow software fallback now, for handhelds,
and for PCs we are recommending OpenGL, where fading in and out is an easy
alpha blend over black.

Even when OpenGL is on, however, we also use the gamma ramps to change the
screen brightness, which does work on all platforms and is pretty
essential to first person shooters.

Instead of full gamma ramps, should SDL 1.3 expose a limited
SDL_SetBrightness(float) which works with reasonable gamma values, say
0.7-1.3? That’s all you can be sure DIB will give you. I can port the code
from SDL 1.2 for the three PC OSes, but I can’t volunteer to do any
handheld ports.

GregoryOn Tue, 22 Feb 2011, Bill Kelly wrote:

Okay, after your feedback and looking at other games that still use
gamma support, I’m bringing it back.

Thanks! :)On Tue, Feb 22, 2011 at 6:15 AM, Gregory Smith wrote:

On Tue, 22 Feb 2011, Bill Kelly wrote:

This was only ever completely functional on hardware with cluts
(either 8-bit palettes or DirectColor LUTs), and never worked on Mac
OS X.

This is puzzling, as our application has been using SDL gamma
fades on OS X and Windows since about 2004.

(We only use them in full screen mode.)

Aleph One uses them as well. They only work sometimes in Mac OS X, and in
Windows they work partially but Windows DIB only lets you adjust the gamma
ramps so far, which results in our fades being all glitchy. DIB will never
let you black the screen, for instance.

Gamma fades work fine in X11 and old Mac OS, in fact I am the one who
contributed classic Mac gamma ramp support to SDL.

But, times change. We have a slow software fallback now, for handhelds, and
for PCs we are recommending OpenGL, where fading in and out is an easy alpha
blend over black.

Even when OpenGL is on, however, we also use the gamma ramps to change the
screen brightness, which does work on all platforms and is pretty essential
to first person shooters.

Instead of full gamma ramps, should SDL 1.3 expose a limited
SDL_SetBrightness(float) which works with reasonable gamma values, say
0.7-1.3? That’s all you can be sure DIB will give you. I can port the code
from SDL 1.2 for the three PC OSes, but I can’t volunteer to do any handheld
ports.

Gregory


SDL mailing list
SDL at lists.libsdl.org
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org


? ? -Sam Lantinga, Founder and CEO, Galaxy Gameworks