Sign in to follow this  
Followers 0

Gamma -x

Just a techie question : Why when the gamma is negative (ex: gamma -1) the color gets messed up and looks like doomguy is missingno?
Something to think about?

Share this post


Link to post

There's no real mystery to it. Doom's gamma correction works using lookup tables - one table for each of the different gamma correction levels (0-4). When the palette is set, the brightness of each of the RGB values gets translated into a different brightness, making the screen brighter by some amount.

The tables are stored in an array. If the index is outside the range 0-4, you're now reading outside that array: for example, gammatable[-1] is a chunk of memory used for something in the Doom exe (probably other global variables or bits of compiled machine code). That memory is used as a gamma table but it doesn't make any sense as a gamma table, so colors just get mapped to arbitrary values that don't make any sense. Hence the screen ends up as a mess.

Share this post


Link to post

Except DoomLegacy which does not use lookup tables anymore, and has finer gamma correction values.

Share this post


Link to post

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0