Jump to content
Search In
  • More options...
Find results that contain...
Find results in...
  • 0
RonnieJamesDiner

Question about Brightness levels in vanilla maps

Question

Perhaps this has been asked & answered somewhere, but I've been wondering why oddly specific - seemingly random (to me) - brightness levels are so often used in vanilla maps. I wasn't sure if perhaps there was some sort of technical aspect to it?

 

For instance, in MAP01: Entryway of the Doom II campaign, the majority of the brighter areas are 224, and the majority of mid-light level areas are 128 or 144. And I've noticed a lot of outdoor areas throughout the campaign have a brightness level of 192.

 

All I was wondering was... is there any technical reason (beyond personal aesthetic preference), for these light levels not to be, say, 225, 130, 145, 200? Or even 230, 130, 150, 200? The numbers they use just seem so randomly specific, and I was always curious. 

Share this post


Link to post

12 answers to this question

Recommended Posts

  • 4
Posted (edited)

In a nutshell, the original vanilla engine didn't differentiate between light levels less than 8 levels apart. So all light levels you'll see on vanilla levels are all multiples of 8, and in reality there are only 32 different light options (starting at 0 and ending at 255 in blocks of 8).

 

In modern true-color source ports all light levels are supported, but people still tend to default to the multiple of 8 levels out of convenience. 

 

Edit: Turns out this isn't true! See below for more detailed answers.

Edited by Bauul

Share this post


Link to post
  • 2

Following on from Baull's reply, Doom actually only differentiated between light levels in increments of 16. Some source ports like Eternity double that precision to allow increments of 8, and some true-color GL source ports like GZDoom are able to make every brightness level actually distinct.

 

Also, the brightest light level is 256, not 255. 255 and 240 are identical in vanilla, this is a mistake that originated in the IWAD maps and was carried over in map editing tools.

Share this post


Link to post
  • 1

The light level is stored in a 16 bit word, so 256 is valid. In most hardware renderers this is clamped to 255, though, because that allows storing the RGBA value for the light as a single DWORD instead of 4 floats.

 

Unfortunately in GZDoom that limit also still exists in a few places, otherwise overexposed light levels would be doable, actually.

 

Share this post


Link to post
  • 0

Sectors can be any height, but the renderer requires textures to be certain sizes (this is more relaxed in modern ports, but it's still common to use power-of-2 sizes, even in newer games), so units of 8/16/32/etc are typically used in maps because they fit the textures most neatly. If your textures are mostly sizes like 128x128 and you're mapping in units of 10 instead of units of 8, things are going to get very awkward when you try doing texture alignment.

Share this post


Link to post
  • 0
Posted (edited)
2 hours ago, esselfortium said:

Also, the brightest light level is 256, not 255. 255 and 240 are identical in vanilla, this is a mistake that originated in the IWAD maps and was carried over in map editing tools.

That's interesting and also makes no sense from a base 16 pov.

 

As for the textures discussion. Yeah this was something that took me a long time to realize I am slightly ashamed to say. I always made the textures at the size I wanted them to be and then more or less forced the game to accept them. So one step texture could be 22 px high rather than 24 etc. Had let me have a lot less headaches had I realized this earlier. But for some reason it wasn't something I picked up on.

Share this post


Link to post
  • 0
2 hours ago, esselfortium said:

Following on from Baull's reply, Doom actually only differentiated between light levels in increments of 16. Some source ports like Eternity double that precision to allow increments of 8, and some true-color GL source ports like GZDoom are able to make every brightness level actually distinct.

 

Also, the brightest light level is 256, not 255. 255 and 240 are identical in vanilla, this is a mistake that originated in the IWAD maps and was carried over in map editing tools.

 

Was it really increments of 16? Wow, I never realized it was that limited. And if 255 and 240 are identical, that means there were just what, 15 light levels? It makes it even more impressive the variety of ways they utilized them in maps.

Share this post


Link to post
  • 0
1 hour ago, esselfortium said:

Sectors can be any height, but the renderer requires textures to be certain sizes (this is more relaxed in modern ports, but it's still common to use power-of-2 sizes, even in newer games), so units of 8/16/32/etc are typically used in maps because they fit the textures most neatly. If your textures are mostly sizes like 128x128 and you're mapping in units of 10 instead of units of 8, things are going to get very awkward when you try doing texture alignment. 

 

That makes even more sense. Thank you for the clarity.

 

I have to echo Bauul's sentiment. Being able to achieve that level of atmosphere and variety with only increments of 16 in brightness is absolutely impressive; it speaks a lot to their creativity!

Share this post


Link to post
  • 0
Posted (edited)
27 minutes ago, Bauul said:

 

Was it really increments of 16? Wow, I never realized it was that limited. And if 255 and 240 are identical, that means there were just what, 15 light levels? It makes it even more impressive the variety of ways they utilized them in maps.

No, it means there are 17. 0 is pitch black and 256 is full bright. (unless I am mistaken and 0 and 16 are both pitch black and we're back to 16)

0,16,32,48,64,80,96,112,128,144,160,176,192,208,224,240,256.

And it was very rare that they used more than a handful in any scene so it didn't really matter much. The big limitation I myself experienced with Doom was that you couldn't make overexposed scenes.

Share this post


Link to post
  • 0
4 hours ago, esselfortium said:

Following on from Baull's reply, Doom actually only differentiated between light levels in increments of 16.

 

Also, the brightest light level is 256, not 255. 255 and 240 are identical in vanilla, this is a mistake that originated in the IWAD maps and was carried over in map editing tools.

“Things you just learned about Doom”

 

I can’t believe I just now noticed light is base-16.. I’ve been setting gradient light levels for years and somehow I’ve always thought it was base-8. Like, the amount of times I’ve gone from 160, to 176, to 192 and not noticed it was 16 between each actually has me embarrassed right now. My brain no math good.

Share this post


Link to post
  • 0
Posted (edited)

If the light level was stored in a single byte, which was very likely in those memory-starved days, then the possible values are 0 - 255.  A light value of 256 would simply be impossible to store in a single byte.  Because of this, 255 is the sole exception to all the light values being multiples of 16.

 

EDIT: I stand corrected by somebody who has actually looked at (and worked with) the code

Edited by Empyre

Share this post


Link to post
  • 0

I had no idea it was this limited. I noticed sharp light transitions where I'd created gradients but just assumed that was down to the diminishing brightness making neighbour sectors appear similar in brightness.

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
×