New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Doom does not have sector brightness 256 #499
Comments
256 is a valid value. 240 and 255 are the same light value (for ports that use the vanilla way to calculate light values). See https://github.com/chocolate-doom/chocolate-doom/blob/df1837c1210b85ebc4ec84e42b5edb2001c66463/src/doom/r_segs.c#L96 |
That link did not help me. I guess the DeepSea and Eureka teams got it wrong then. They have their light levels from 0 to 255. A total of 256 light levels. 0 to 256 means there are 257 light levels ? |
Vanilla Doom does this:
For a line that's horizontally on the grid with and a sector brightness of 255:
For a line that's horizontally on the grid with and a sector brightness of 256:
Here's how it looks in Chocolate Doom: |
Interesting. I made a test wad similar to what you have here, compared with choco doom
and doom2 under dosbox, and could not see any difference between 255 or 256 for the sector
brightness. Would you mind emailing me your test wad ?
…________________________________
From: biwa <notifications@github.com>
Sent: Saturday, 14 November 2020 11:33 PM
To: jewalky/UltimateDoomBuilder <UltimateDoomBuilder@noreply.github.com>
Cc: hawkwind3 <hawkwinds_messages@hotmail.com>; Author <author@noreply.github.com>
Subject: Re: [jewalky/UltimateDoomBuilder] Doom does not have sector brightness 256 (#499)
Vanilla Doom does this:
1. bit-shift the brightness to the right by 4 (which is equivalent to taking the whole number part of dividing the brightness by 16)
2.
* for lines that are aligned to the grid horizontally: subtract 1 from the computed light value (this is where the brightness of 256 matters)
* for lines that are aligned to the grid vertically: add 1 to the computed light value
3. clamp the light value between 0 and 15
For a line that's horizontally on the grid with and a sector brightness of 255:
1. bit-shift: 255 >> 4 = 15
2. subtract 1: 15 - 1 = 14
3. clamp between 0 and 15: 14 <-- final light value
For a line that's horizontally on the grid with and a sector brightness of 256:
1. bit-shift: 256 >> 4 = 16
2. subtract 1: 16 - 1 = 15
3. clamp between 0 and 15: 15 <-- final light value
Here's how it looks in Chocolate Doom:
[255_256]<https://user-images.githubusercontent.com/6475593/99147060-db7b7200-267d-11eb-94a4-b4d5e5c90d3e.gif>
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub<#499 (comment)>, or unsubscribe<https://github.com/notifications/unsubscribe-auth/AIMSY6TXTHNYVWY4ZLGVASDSPZ2H5ANCNFSM4TVKV4WA>.
|
Example WAD is attached. I used GRAY1 as a texture to make it more clear. The left half of the wall belongs to a sector with 256 brightness, the right half to a sector with 255 brightness. Note that the lighting also depends on your distance to the line, so if you're walking towards the line you'll see the right half "flip" to a higher brightness. |
Interesting doom quirk. Thank you.
…________________________________
From: biwa <notifications@github.com>
Sent: Sunday, 15 November 2020 12:34 AM
To: jewalky/UltimateDoomBuilder <UltimateDoomBuilder@noreply.github.com>
Cc: hawkwind3 <hawkwinds_messages@hotmail.com>; Author <author@noreply.github.com>
Subject: Re: [jewalky/UltimateDoomBuilder] Doom does not have sector brightness 256 (#499)
Example WAD is attached. I used GRAY1 as a texture to make it more clear. The left half of the wall belongs to a sector with 256 brightness, the right half to a sector with 255 brightness. Note that the lighting also depends on your distance to the line, so if you're walking towards the line you'll see the right half "flip" to a higher brightness.
255-256.zip<https://github.com/jewalky/UltimateDoomBuilder/files/5540770/255-256.zip>
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub<#499 (comment)>, or unsubscribe<https://github.com/notifications/unsubscribe-auth/AIMSY6Q4ZEWMYXVRUWK3NZTSP2BQDANCNFSM4TVKV4WA>.
|
I noticed this in Doom_misc.cfg ...
sectorbrightness
{
256; 240; 224; 208; 192; 176; 160; 144;
128; 112; 96; 80; 64; 48; 32; 16; 0;
}
It should read ...
sectorbrightness
{
255; 240; 224; 208; 192; 176; 160; 144;
128; 112; 96; 80; 64; 48; 32; 16; 0;
}
i.e. 255 insead of 256. easily fixed.
The text was updated successfully, but these errors were encountered: