Relighting Doom v3.31b [Updated 4/8/22]

Projects that alter game functions but do not include new maps belong here.
Forum rules
The Projects forums are only for projects. If you are asking questions about a project, either find that project's thread, or start a thread in the General section instead.

Got a cool project idea but nothing else? Put it in the project ideas thread instead!

Projects for any Doom-based engine (especially 3DGE) are perfectly acceptable here too.

Please read the full rules for more details.
slayer87
Posts: 13
Joined: Wed Dec 22, 2021 8:52 pm
Graphics Processor: nVidia (Modern GZDoom)

Re: Relighting Doom v2.6b [Updated 2/7/22] - Light & Color

Post by slayer87 »

I will keep my eye on this. This looks promising and I wish you well. Don't get discouraged! it look really good so far.

Having said that, I'd like to share my experience. I noticed in a few levels how great the lighting now looks, as it naturally fades in, or away, in a sector from a light source. It's great. However, there are some oddities and problems, which I'm sure you're aware of. Below are some screenshots. Again, it looks great, what you have done is awesome and I hope you keep at it!







But....at this moment, I was blown away. Look at how awesome the light naturally fades away! Looks AWESOME! Of course, it looked a little wonky when I was facing the other direction, but still :)
User avatar
RastaManGames
Posts: 379
Joined: Wed Mar 12, 2014 11:13 pm
Graphics Processor: nVidia with Vulkan support
Location: Russian Federation, Krasnoyarsk

Re: Relighting Doom v2.6b [Updated 2/7/22] - Light & Color

Post by RastaManGames »

"DarkDoomZ" flashlight works well with this re-lighting mod.
But i saw something like "BD Flashlight" addon recently.
Which one is better for your mod on your opinion?
Hey Doomer
Posts: 283
Joined: Sat Sep 25, 2021 3:38 am

Re: Relighting Doom v2.7b Even Closer

Post by Hey Doomer »

The asthmatic canary also has Covid-19 complications. Of course. In looking at the code I have added several additional assumptions:
  • Previous code looked at the closest visible light, and an environment is lit by available light. If the former were true, you could make your house darker in broad daylight by turning on a lamp.
  • The amount of light emitted is different for these purposes than the sector light level. A small sector that is bright such as a narrow sector between two lights won't emit the same light as a large room if both have a light level of 255. So I've made that allowance for sector lighting.
  • Likewise the amount of light received by a sector is more or less diluted over the volume of that sector. I've made a small adjustment for that as well as the maximum emitted light that can be received. (Your house can't be bright than it is outdoors in the daylight if that's the only light, even if there are also lights on outside.)
Stuff like that became obvious once some of the uglier bugs were squashed. This has the effect of making things more accurate, but it means intubating the canary again. Screenshots to show this from MAP04:

Red doors closed
One red door open - small lit hallway, a little light
Both red doors open - huge bright area beyond, much more light
Window open
Window closed

This changes quite a bit of what the mod is doing, but as you can see it's more accurate. It's impressive to see in real time and far less dependent on added dynamic lights. Unsurprisingly areas that didn't seem to have much light have more and vice versa. I'm just working through a few remaining details. Soon.

Update:

Since emitted light isn't evenly dispersed - to put it mildly - but depends on area and placement of sectors, I've added nearby light sensors to the polling to allow for light that "bleeds" into one sector from another. This doesn't impact performance, but it makes stairs work, for example. Previously this was done inelegantly. I am definitely getting much closer. It's interesting that it isn't just about primary light but also nearby ambient light, as in life.
Hey Doomer
Posts: 283
Joined: Sat Sep 25, 2021 3:38 am

Re: Relighting Doom v2.7b - Almost

Post by Hey Doomer »

This is almost ready. It's far from perfect, but many problems have been solved and performance has been very good. Here are screenshots showing emitted color as well as light:

E1M1 - nukage glow in the next room creating new textures
Door closed and open. Note the color flooding the hallway.

Likely tomorrow.
Hey Doomer
Posts: 283
Joined: Sat Sep 25, 2021 3:38 am

Re: Relighting Doom v2.6b [Updated 2/7/22] - Light & Color

Post by Hey Doomer »

RastaManGames wrote:"DarkDoomZ" flashlight works well with this re-lighting mod.
But i saw something like "BD Flashlight" addon recently.
Which one is better for your mod on your opinion?
I haven't tried the BD Flashlight, but the DarkDoomZ flashlight is excellent.
Hey Doomer
Posts: 283
Joined: Sat Sep 25, 2021 3:38 am

Re: Relighting Doom v2.7b [Updated 2/12/22] - Better Light

Post by Hey Doomer »

Just posted v2.7b with many changes, most of which streamlined or fixed problems with old code. I'm still looking at color definitions, but overall this version has more realistic lighting (mathematically, anyway) and far fewer dynamic lights. Here's a summary:
  • Removed the old mod's limits.
  • As described I rewrote almost all of the light code to refactor gradients based on the inverse square law. I've made allowances for emitted, ambient, and volume dispersed light with a few adjustments for very close light sources.
  • Instead of getting the closest light, all visible light is found.
  • Refactored and clamped dynamic lighting to eliminate banding.
For now the PLR works but doesn't gradually increase. I also revised and simplified the menus (some of which dealt with limits I've removed), and I'm still working through that. Some of the colors are also odd looking, since I corrected many of the lighting and color issues. That took waaaaaaaaaaaaaaaaaaaaaay too much time.

Screenshots (compass direction is North all all shots):

MAP11
MAP06
MAP14
E1M3 - that actually looks cold
E1M1 - note the light direction and nukage tint bleeding onto the structure
MAP05
E1M4

But, well, see for yourself. :D

So while what this does is no longer that simple - well, it's 2000 steps of simple - again it starts with whatever the minimum light level is and works up from there based only on definition files. Hopefully this is more realistic. Most of those screenshots were taken just now, some in areas I've not seen with the new code ("Inmost Dens" looks incredible, I think). Let me know what you think!

Update: FYI bug fix for the adventuresome in "relighting_actors.zs" line 238 - change first calculation to this:

Code: Select all

clamp(nearby[i].args[SECVOLUME] / 4096, 0.666, 20)
This fixes some stairway glitches and the closet at the start of E1M4. Probably other stuff.

Another tweak for areas such as MAP02. A recessed area can provide minimal ambient light with this new code. Add this to the end of "rl_textures.txt"

Code: Select all

; platinum
SPACEW3,#e5e4e2
Hey Doomer
Posts: 283
Joined: Sat Sep 25, 2021 3:38 am

Re: Relighting Doom v2.71b [Updated 2/12/22] - Better Light

Post by Hey Doomer »

Posted a quick fix (v2.71b) that includes the above fixes and an extra dynamic light definition. This is looking really good.

E1M3
MAP02
E1M2

That's with the volume fix and dynamic light.
User avatar
Enjay
 
 
Posts: 27316
Joined: Tue Jul 15, 2003 4:58 pm
Location: Scotland
Contact:

Re: Relighting Doom v2.71b [Updated 2/12/22] - Better Light

Post by Enjay »

I was about to post that several areas of MAP02 were far too dark, but the fixed version... well, fixes that. :)

However, I'd suggest that this area could do with a bit of attention:

The area that I am standing in is really dark, but it is right next to an outdoor area. surely the light from the outdoor area would lighten the covered area much more?
Hey Doomer
Posts: 283
Joined: Sat Sep 25, 2021 3:38 am

Re: Relighting Doom v2.71b [Updated 2/12/22] - Better Light

Post by Hey Doomer »

Enjay wrote: The area that I am standing in is really dark, but it is right next to an outdoor area. surely the light from the outdoor area would lighten the covered area much more?
It could be the direction of the light. That's a menu option or the cvar rl_compass.
User avatar
Enjay
 
 
Posts: 27316
Joined: Tue Jul 15, 2003 4:58 pm
Location: Scotland
Contact:

Re: Relighting Doom v2.71b [Updated 2/12/22] - Better Light

Post by Enjay »

You're right - south makes this area very dark but all other directions are brighter. I'd still argue that a corridor open to daylight on one side should be brighter than the south setting makes it though, even if the position of the "Sun" means that it is in shadow. My room at work - a sizeable room - only has north facing windows but if it is daylight outside, I'm not grubbing around in the dark trying to see stuff simply because the sun is coming from the south (northern hemisphere 57.4459° north). ;)
Plasmazippo
Posts: 115
Joined: Sat Sep 25, 2021 11:55 am
Graphics Processor: ATI/AMD with Vulkan/Metal Support

Re: Relighting Doom v2.6b [Updated 2/7/22] - Light & Color

Post by Plasmazippo »

RastaManGames wrote:"DarkDoomZ" flashlight works well with this re-lighting mod.
But i saw something like "BD Flashlight" addon recently.
Which one is better for your mod on your opinion?
DDZ's flashlight has a number of cool presets, but I prefer the more customizable Flashlight+ by RicardoLuis0. It's also better for performance since you can tone down its range to distances below DDZ's "Simple Incandescent" setting.
Hey Doomer
Posts: 283
Joined: Sat Sep 25, 2021 3:38 am

Re: Relighting Doom v2.71b [Updated 2/12/22] - Better Light

Post by Hey Doomer »

Enjay wrote:You're right - south makes this area very dark but all other directions are brighter. I'd still argue that a corridor open to daylight on one side should be brighter than the south setting makes it though, even if the position of the "Sun" means that it is in shadow. My room at work - a sizeable room - only has north facing windows but if it is daylight outside, I'm not grubbing around in the dark trying to see stuff simply because the sun is coming from the south (northern hemisphere 57.4459° north). ;)
Yeah I've been mulling over several approaches. Bright markers in sky sectors might spawn with an argument that changes their intensity according to their direction, perhaps.
Ozymades
Posts: 21
Joined: Thu Dec 10, 2020 4:37 am
Graphics Processor: nVidia (Modern GZDoom)

Re: Relighting Doom v2.71b [Updated 2/12/22] - Better Light

Post by Ozymades »

This version is a big step up, I'd say. But I only tested E1M1-M3 in Maps of Chaos so far. Will test more tomorrow.
User avatar
r&r
Posts: 294
Joined: Fri Sep 08, 2017 2:54 pm

Re: Relighting Doom v2.71b [Updated 2/12/22] - Better Light

Post by r&r »

is there a way to make the light change shadow directions automatically?
by making a fake sun or light source that slowly turns around map's location?

even tho that might be off topic?
Hey Doomer
Posts: 283
Joined: Sat Sep 25, 2021 3:38 am

Re: Relighting Doom v2.72b [Updated 2/13/22] - Better Light

Post by Hey Doomer »

Just posted v2.72b with a few color tweaks (some areas were just too dark). This is an update that adds plane and sidedef perceived color light. This correct color glitches e.g. E3M6.

I've also added weight to the directional light (not on changelog) so it doesn't only come from one direction (thanks, Enjay, for pointing this out).

North
East
South
West

Still working on issues such as dynamic light banding in a few places. But at least this release fixes the above two. :D Let me know what you think!

Update: different colors can help as here in E1M3 (this color switched from golden brown to orange salmon).

Code: Select all

; orange salmon
BRNPOIS2,#c47451
Last edited by Hey Doomer on Sun Feb 13, 2022 6:06 am, edited 1 time in total.
Post Reply

Return to “Gameplay Mods”