Archvile
Register | 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 09:26. Post New Thread    Post A Reply
joe-ilya
Senior Member


Posts: 1815
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 10-19-13 15:30 #
joe-ilya is offline Profile || Blog || PM || Email || Search || Add Buddy IP || Edit/Delete || Quote
fraggle
Filled with the code of Doom


Posts: 7468
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 10-19-13 18:58 #
fraggle is offline Profile || Blog || PM || Email || Homepage || Search || Add Buddy IP || Edit/Delete || Quote
wesleyjohnson
Forum Regular


Posts: 988
Registered: 04-09


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

Old Post 10-22-13 05:46 #
wesleyjohnson is offline Profile || Blog || PM || Search || Add Buddy IP || Edit/Delete || Quote
All times are GMT. The time now is 09:26. 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.