Severed bunny head
User Profile | Member List | F.A.Q | Privacy Policy | New Blog | Search Forums | Forums Home
Doomworld Forums : Powered by vBulletin version 2.2.5 Doomworld Forums > Classic Doom > Source Ports > Gamma -x
 
Author
All times are GMT. The time now is 05:47. Post New Thread    Post A Reply
joe-ilya
I once dreamt of a humanic penetration interaction


Posts: 3663
Registered: 10-12


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?

Old Post Oct 19 2013 15:30 #
joe-ilya is offline || Blog || PM || Post History || Add Buddy IP || Edit || Quote
fraggle
Filled with the code of Doom


Posts: 8243
Registered: 07-00


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.

Old Post Oct 19 2013 18:58 #
fraggle is offline Twitter account Youtube Twitch Github || Blog || PM || Post History || Add Buddy IP || Edit || Quote
wesleyjohnson
Senior Member


Posts: 1143
Registered: 04-09


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

Old Post Oct 22 2013 05:46 #
wesleyjohnson is offline || Blog || PM || Post History || Add Buddy IP || Edit || Quote
All times are GMT. The time now is 05:47. Post New Thread    Post A Reply
 
Doomworld Forums : Powered by vBulletin version 2.2.5 Doomworld Forums > Classic Doom > Source Ports > Gamma -x

Show Printable Version | Email this Page | Subscribe to this Thread

 

Forum Rules:
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is OFF
vB code is ON
Smilies are OFF
[IMG] code is ON
 

< Contact Us - Doomworld >

Powered by: vBulletin Version 2.2.5
Copyright ©2000, 2001, Jelsoft Enterprises Limited.