Cyberdemon
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 > Doom Editing > Any reason why one would want a light level above 255?
 
Author
All times are GMT. The time now is 04:58. Post New Thread    Post A Reply
Vermil
Senior Member


Posts: 1708
Registered: 03-04


In the Doom engine, one can set a sectors light level to values above 255.

Now this doesn't affect the sector light level, but I was wondering if there are any rendering hacks people have discovered with 255+ light levels?

I have seen a couple of maps over the years with sector light levels of 256 for instance; are these to achieve rendering hacks, or simply the result of mappers mistakenly thinking 256 is the 'max'?

Old Post 12-18-13 19:09 #
Vermil is offline Profile || Blog || PM || Email || Search || Add Buddy IP || Edit/Delete || Quote
Ribbiks
Senior Member


Posts: 1314
Registered: 02-11


if you set sectors to light values above 255 and then have them glow (sector action 8? iirc) they'll stay fullbright longer the higher the value is. This can be used to create cool lighting effects.

Old Post 12-18-13 19:23 #
Ribbiks is offline Profile || Blog || PM || Search || Add Buddy IP || Edit/Delete || Quote
Shadow Hog
Forum Regular


Posts: 747
Registered: 07-09


I suppose you could rewrite the engine/PLAYPAL to allow for "overbright" sectors, similar to the effect you get in Quake when a light source is really close to a wall.

Actually, you could probably do that without engine rewrites by shifting "full bright" down to 224 or 192 or so in PLAYPAL, although I can't imagine it'd look very good. Either way, it'd be totally unsupported in OpenGL...

Honestly, this is the first I'm hearing about light going over 255 at all; I thought that was a hard limit. Apparently not.

Old Post 12-18-13 20:01 #
Shadow Hog is offline Profile || Blog || PM || Homepage || Search || Add Buddy IP || Edit/Delete || Quote
40oz
Forum Spammer


Posts: 6894
Registered: 08-07


I've made that mistake a couple times only because Doombuilder 2, unless entered manually, lets you pick light levels in intervals of 16, so if I look at a whole room and it looks a little dark, (aside from a few ceiling lights that may be lit at 240) I may select all the sectors in the room and change the light level to "++16" which bumps it up one light level higher, naturally making the ceiling light sectors 256 instead of 255, and I just neglect to fix it as it's not a bug that can really be observed in gameplay.

Never heard about that glowing light thing Ribbiks said though. I wonder if it has a similar effect on effect 17, "light flickers"

Old Post 12-18-13 23:33 #
40oz is offline Profile || Blog || PM || Email || Homepage || Search || Add Buddy IP || Edit/Delete || Quote
Memfis
Forum Spammer


Posts: 5705
Registered: 04-07


Uhh, actually 256 is brighter than 255 I think. All brightness values get rounded down to the closest 16*x. So just like 193=192, 255=240, while 256 is brighter.

edit: yep, there is definitely a difference - http://i.imgur.com/wLPs0gh.png (left - 255, right - 256, wad link)

Last edited by Memfis on 12-18-13 at 23:48

Old Post 12-18-13 23:41 #
Memfis is offline Profile || Blog || PM || Email || Search || Add Buddy IP || Edit/Delete || Quote
Crasger
Member


Posts: 526
Registered: 10-13


I'd like to know how to blind Doomguy with the sun please.

__________________
Wow look at this insignificant text.

Old Post 12-18-13 23:49 #
Crasger is offline Profile || Blog || PM || Search || Add Buddy IP || Edit/Delete || Quote
Maes
I like big butts!


Posts: 12648
Registered: 07-06



Memfis said:
Uhh, actually 256 is brighter than 255 I think. All brightness values get rounded down to the closest 16*x. So just like 193=192, 255=240, while 256 is brighter.


This is actually an artifact of the COLORMAP system, and can be changed to obtain coarser or finer light/distance mapping gradients. Of course, with standard 256-color rendering, the maximum number of transitions you can obtain is just 32, since there are 32 colormaps (even though the source code only defines 16 light levels...).

With source ports having true color 24-bit rendering (15-bit HiColor is not enough, as you only get 32 distinct colormaps, tops), you can have 256 truly distinct light levels.

And yeah, I know of a certain banned DW member that has -among others- an obsessios with "superbright" lighting. It's possible to create colormaps with increasingly saturated/bleached color, until they are practically all-white and indistinguishable, and you can in theory have at least as many "overbright" colormaps as there are "underbright" ones.

Old Post 12-19-13 08:39 #
Maes is offline Profile || Blog || PM || Homepage || Search || Add Buddy IP || Edit/Delete || Quote
marineController
Mini-Member


Posts: 58
Registered: 08-12


Light levels greater than 255 appearing brighter only applies to horizontal walls (East - West on automap).
This is because the reduction in brightness that is normally applied to them (by fake contrast) is being removed.

Old Post 12-19-13 10:24 #
marineController is offline Profile || Blog || PM || Homepage || Search || Add Buddy IP || Edit/Delete || Quote
Quasar
Moderator


Posts: 6085
Registered: 08-00


It does have an effect on sector specials that fade light levels up or down. It has to actually "get through" the "overbrightness" before you will start to see the lighting effect. esselfortium says he has used this in maps to achieve different lighting effects than what are available given the stock sector effects and the "normal" range of light level values.

Old Post 12-19-13 17:12 #
Quasar is offline Profile || Blog || PM || Email || Homepage || Search || Add Buddy IP || Edit/Delete || Quote
40oz
Forum Spammer


Posts: 6894
Registered: 08-07



Memfis said:
All brightness values get rounded down to the closest 16*x.


I use one unit light differences to keep middle textures from bleeding through the floor, are we sure there is not the slightest difference, even if it's extremely difficult to detect? I've noticed 240 and 255 are indistinguishable in DB2's visual mode though.

Old Post 12-19-13 22:56 #
40oz is offline Profile || Blog || PM || Email || Homepage || Search || Add Buddy IP || Edit/Delete || Quote
DaniJ
Senior Member


Posts: 2131
Registered: 08-03



40oz said:


I use one unit light differences to keep middle textures from bleeding through the floor, are we sure there is not the slightest difference, even if it's extremely difficult to detect? I've noticed 240 and 255 are indistinguishable in DB2's visual mode though.

Vanilla's lightlevel quantization does not apply there.

Old Post 12-19-13 22:59 #
DaniJ is offline Profile || Blog || PM || Search || Add Buddy IP || Edit/Delete || Quote
esselfortium
A Major Doomworld Concern


Posts: 6609
Registered: 01-02



40oz said:


I use one unit light differences to keep middle textures from bleeding through the floor, are we sure there is not the slightest difference, even if it's extremely difficult to detect? I've noticed 240 and 255 are indistinguishable in DB2's visual mode though.


It depends on the source port you're using. In vanilla, though, anything from 128 through 143 will be drawn identically to 128, with no increase in brightness until it hits 144. So a 1 unit addition from 128 will be identical to it, but a 1 unit subtraction from 128 will be treated the same as 112.

Old Post 12-19-13 23:13 #
esselfortium is online now Profile || Blog || PM || Email || Homepage || Search || Add Buddy IP || Edit/Delete || Quote
plums
Senior Member


Posts: 2011
Registered: 08-13



Ribbiks said:
if you set sectors to light values above 255 and then have them glow (sector action 8? iirc) they'll stay fullbright longer the higher the value is. This can be used to create cool lighting effects.


You can also have negative light values so that rooms stay dark longer.

Old Post 12-19-13 23:32 #
plums is offline Profile || Blog || PM || Search || Add Buddy IP || Edit/Delete || Quote
Ribbiks
Senior Member


Posts: 1314
Registered: 02-11



plums said:
You can also have negative light values so that rooms stay dark longer.



oooh, this I did not know. I must play with this :D

Old Post 12-19-13 23:39 #
Ribbiks is offline Profile || Blog || PM || Search || Add Buddy IP || Edit/Delete || Quote
Joe667
Member


Posts: 569
Registered: 07-13


I always thought that if you gave a sector a light value of over 255 it would cause some weird "negative" light effect. I thought this because of how 255 is the maximum speed when the player is Turbo, but exceeding this would cause them to walk backwards etc.

And at light level 255, no gradual darkness is made (this can be observed using the Line Horizon effect).

Old Post 12-20-13 22:40 #
Joe667 is offline Profile || Blog || PM || Search || Add Buddy IP || Edit/Delete || Quote
Joe667
Member


Posts: 569
Registered: 07-13



plums said:

You can also have negative light values so that rooms stay dark longer.



What if you had a sector with a light value of +255 with action 8 (Light glows 1+ sec.) next to a sector with a light value of -0? It would stay light for a while, then fade smoothly into darkness, and back again. It would make those computer wall mazes more interesting...

Edit: You could even create a lightning effect with it! If your "dark" sector had a light level of -0 but your "bright" sector DIDN'T have a light level of +255.

Old Post 12-20-13 22:43 #
Joe667 is offline Profile || Blog || PM || Search || Add Buddy IP || Edit/Delete || Quote
plums
Senior Member


Posts: 2011
Registered: 08-13



Joe667 said:
I always thought that if you gave a sector a light value of over 255 it would cause some weird "negative" light effect. I thought this because of how 255 is the maximum speed when the player is Turbo, but exceeding this would cause them to walk backwards etc.


In that case speed is stored as an unsigned byte, which has a range of 0-255.

Doom's lighting could be stored in one byte, but for some reason it's a signed short integer (two bytes) instead, meaning a range of -32768 to 32767. The only typically useful values are 0-255 though.

Old Post 12-21-13 00:52 #
plums is offline Profile || Blog || PM || Search || Add Buddy IP || Edit/Delete || Quote
Joe667
Member


Posts: 569
Registered: 07-13


Yeah... I'm trying to follow, but the most technical terms I've ever heard are in GameMaker 7/8's 3D engine... X)

Old Post 12-21-13 13:53 #
Joe667 is offline Profile || Blog || PM || Search || Add Buddy IP || Edit/Delete || Quote
plums
Senior Member


Posts: 2011
Registered: 08-13


Haha, sorry. OK.

Basically the container for speed values is small, 0-255. If you go over the limit of what it can hold, you wrap back around to small numbers.

Doom uses the same numbers for light as it does for speed, 0-255. But the container for light is larger than it needs to be, so it can hold larger or smaller numbers without wrapping around.

Old Post 12-21-13 14:16 #
plums is offline Profile || Blog || PM || Search || Add Buddy IP || Edit/Delete || Quote
Joe667
Member


Posts: 569
Registered: 07-13



plums said:
...The container for light is larger than it needs to be, so it can hold larger or smaller numbers without wrapping around.


And what is its maximum value?

Old Post 12-21-13 14:20 #
Joe667 is offline Profile || Blog || PM || Search || Add Buddy IP || Edit/Delete || Quote
plums
Senior Member


Posts: 2011
Registered: 08-13


Light can go from -32768 to 32767.

One byte = 8 bits = 2^8 different values = 256 values. Generally this is either 0-255 (unsigned, i.e. no +/- sign) or -128 to 127 (signed).

Two bytes = 16 bits = 2^16 values = 65536. Unsigned this is 0-65535, signed is -32768 to 32767.

Old Post 12-21-13 14:36 #
plums is offline Profile || Blog || PM || Search || Add Buddy IP || Edit/Delete || Quote
All times are GMT. The time now is 04:58. Post New Thread    Post A Reply
 
Doomworld Forums : Powered by vBulletin version 2.2.5 Doomworld Forums > Classic Doom > Doom Editing > Any reason why one would want a light level above 255?

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.