Archived

This topic is now archived and is closed to further replies.

niexuchina

don't laugh at me.what is gamma?

Recommended Posts

Gamma is a greek letter. Gamma is used to denote constants or variables in many different contexts. Even within a limited scope such as game programming, gamma can be used to denote a large number of things. If I had to guess what you''re talking about I''d assume you''re asking about "gamma correction". Which is adjusting input signals to account for different intensity to voltage response curves in monitors.

Share this post


Link to post
Share on other sites
In simplest terms, gamma is the ratio of the numerical value of a pixel to its actual screen brightness. A higher gamma means a brighter pixel.


John Bolton
Page 44 Studios
Current project: NHL Faceoff 2005 PS2

Share this post


Link to post
Share on other sites
In simplistic terms, if you change your monitor''s brightness setting, you can make your screen very dark or extremely light. This is the basic idea behind gama -- higher gama yeilds lighter scenes, while lower gama yeilds darker scenes.

Share this post


Link to post
Share on other sites
Yeah, I would like to know this too. If I''m developing a game and I want to include ''Gamma correction'' in it''s options, how do I have to modify every pixel that''s going to the screen? What mathematical formula is used here?

Share this post


Link to post
Share on other sites
I believe in most graphics APIs there is a specific option to set the general screen gamma. Eg. Direct Draw had some object for it I remember, and the newer Direct 3D could have either some special function for it or as some render state. OpenGL I''d assume to have some function for this purpose as well.

Share this post


Link to post
Share on other sites
OK, I did a little searching and found this formula for anyone interested:

newcolorvalue = oldcolorvalue ^ gamma

where color values are from [0, 1]. For colors from [0, 255] this becomes:

newcolorvalue = 255 * ((oldcolorvalue / 255) ^ gamma)

For gamma = 1 the color stays unchanged, for gamma > 1 it is brighter and for gamma < 1 it is darker.

Share this post


Link to post
Share on other sites
yes ... but then you are changing brightnes (gamma) using cpu power ... since you will have to do it at least 1600 * 1200 at minimum 30 frames per second ...

... isn''t there something in hardware that do this?

Share this post


Link to post
Share on other sites