Relighting Doom v2.321b [Updated 1/19/22] - Now With DL

Projects that alter game functions but do not include new maps belong here.
Forum rules
The Projects forums are ONLY for YOUR 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.

Relighting Doom v2.321b [Updated 1/19/22] - Now With DL

Postby Hey Doomer » Tue Jan 11, 2022 4:56 am

The difference between dynamic lighting and sector lighting is that sector lighting isn't. But what if it was? What if sectors changed light depending on light sources? What if a sector got brighter when a door opened and dark again when it closed?

Screenshots:
Spoiler:


This is my take, called Relighting. This relights the entire game based only on flats and textures configured in text lumps to be light sources. The farther away from a light source, the darker the sector. The gloomier the surroundings, the gloomier the sector. And yes, sector lighting increases or decreases dynamically.

Light sources are defined in text lumps in the pk3 called rl_flats.txt and rl_textures.txt that use this format:

<name>,<color>

Comments begin with a semicolon. Example:

Code: Select allExpand view
; yellow
CEIL3_4,#ffff00
CEIL4_3,#ffff00
TLITE6_1,#ffff00
TLITE6_4,#ffff00
TLITE6_6,#ffff00


Settings control options to adjust the maximum light, "lost" light when a bright sector bleeds into another, minimum light, any added light (a fudge factor in case dark is just too dark), and the color strength. I have configured this for Doom, but this will work with Heretic or Hexen as well. Just edit the text lumps.

Notes:
This works best with texture brightmaps. So for example in E1M1's tech room, brightmaps work best with the planet textures. Currently to optimize performance there's no middle ground in lighting. It's either maximum brightness or gradients of that to a minimum light amount. Also, some sectors (there is a stair in E1M2, for example) may light oddly depending on the math. I have attempted to reduce the number of source and sensor markers to optimize performance. These can be seen by setting rl_debug to true.

Changelog (relighting_events.zs)
Spoiler:


Now at v2.321b

Notes on previous versions:
Spoiler:


Notes on v2.32b:
Spoiler:
You do not have the required permissions to view the files attached to this post.
Last edited by Hey Doomer on Wed Jan 19, 2022 8:12 am, edited 23 times in total.
User avatar
Hey Doomer
 
Joined: 25 Sep 2021
Operating System: Windows 11
OS Test Version: No (Using Stable Public Version)
Graphics Processor: ATI/AMD with Vulkan Support

Re: Relighting Doom [Beta]

Postby Kzer-Za » Wed Jan 12, 2022 4:11 am

Very cool!

For me personally the colored lights seem too colored, I would have preferred them less tinted, but that's just me :)
Kzer-Za
 
Joined: 20 Aug 2017
Operating System: Other Linux 64-bit
Graphics Processor: nVidia (Modern GZDoom)

Re: Relighting Doom [Beta]

Postby Hey Doomer » Wed Jan 12, 2022 4:35 am

Kzer-Za wrote:Very cool!

For me personally the colored lights seem too colored, I would have preferred them less tinted, but that's just me :)


In Settings "Sector Color Strength" (now that I think about it, that should be called something else as it does the opposite) affects color intensity by averaging this value across all three channels. If there are multiple colors in the same sector they are averaged, which may have a similar effect.

Example of "washed out" color:
Screenshot_Doom_20220112_052738-576x324.png


Thus if this value is 255, bright sectors are not colored at all.

I also chose to copy names from Doom Builder with an approach of "red light? #ff0000," if that makes sense. One person's pink is another person's crimson, and it's trivial to change.
You do not have the required permissions to view the files attached to this post.
User avatar
Hey Doomer
 
Joined: 25 Sep 2021
Operating System: Windows 11
OS Test Version: No (Using Stable Public Version)
Graphics Processor: ATI/AMD with Vulkan Support

Re: Relighting Doom [Beta]

Postby Kzer-Za » Wed Jan 12, 2022 5:26 am

Oh, great!
Kzer-Za
 
Joined: 20 Aug 2017
Operating System: Other Linux 64-bit
Graphics Processor: nVidia (Modern GZDoom)

Re: Relighting Doom [Beta]

Postby FelesNoctis » Wed Jan 12, 2022 6:57 pm

This looks awesome!

Out of curiosity, have you gotten to a point of testing how it works in combination with something like DarkDoomZ? Sounds like both mods have minimum/maximum light level checks, so I'm wondering how they'd interact.
User avatar
FelesNoctis
 
Joined: 18 Apr 2020
Discord: Feles Noctis#9086
Github ID: FelesNoctis
Operating System: Windows 10/8.1/8/201x 64-bit
OS Test Version: No (Using Stable Public Version)
Graphics Processor: nVidia with Vulkan support

Re: Relighting Doom [Beta]

Postby Hey Doomer » Thu Jan 13, 2022 5:05 am

FelesNoctis wrote:This looks awesome!

Out of curiosity, have you gotten to a point of testing how it works in combination with something like DarkDoomZ? Sounds like both mods have minimum/maximum light level checks, so I'm wondering how they'd interact.


I haven't, but I assume this will ignore whatever DarkDoomZ or a similar mod does. All sector lighting is changed so that a sector is either a light source or contains light sensors that determine the light level in real time. Setting light levels on level load will have no effect on this.
Last edited by Hey Doomer on Thu Jan 13, 2022 5:25 am, edited 1 time in total.
User avatar
Hey Doomer
 
Joined: 25 Sep 2021
Operating System: Windows 11
OS Test Version: No (Using Stable Public Version)
Graphics Processor: ATI/AMD with Vulkan Support

Re: Relighting Doom v1.0 [Updated 1/13/22] - Now With PLR

Postby Hey Doomer » Thu Jan 13, 2022 5:25 am

If you've every been in bright sunlight and then walked into an indoor location without lights on, you understand the pupillary light reflex. It's also the thing your physician does where a brilliant light is shined in one eye and then the other.

I have added this to Relighting. Here's what it looks like in action:

Spoiler:


These are from E1M2. In the first screenshot the player stands under ceiling lights (a bright sector). Ahead he sees darkness. The second screenshot is after walking into the darkness, and it is suddenly much darker. That's because the bright sector constricted his pupils. As time passes (see Settings) pupils dilate and the sector gradually brightens.

This should not affect gradual changes, such as the tunnel in E1M1 walking up the stairs into the courtyard. The idea is that standing in the light carries an added risk, and it also makes the sector dynamic lighting more responsive to the player. The PLR trigger is determined by the "Lost Sector Light" setting to allow for incremental change. The most dramatic reflex will be seen in going directly from a light source sector into a very dark sector; moving gradually into darkness shouldn't trigger the reflex.

I think this looks pretty cool, but if you don't want this just set Pupillary Light Reflex Time to 0.
You do not have the required permissions to view the files attached to this post.
User avatar
Hey Doomer
 
Joined: 25 Sep 2021
Operating System: Windows 11
OS Test Version: No (Using Stable Public Version)
Graphics Processor: ATI/AMD with Vulkan Support

Re: Relighting Doom v1.0 [Updated 1/13/22] - Now With PLR

Postby Hey Doomer » Thu Jan 13, 2022 3:51 pm

Posted v1.1, which fixes a few minor bugs related to PLR calculations. v1.0 was triggering too soon and the reflex was based on the default values. Other than that no real substantive changes. Also note that dynamic lights are excluded from PLR. So if a sector is "artificially" brightened with dynamic lights it doesn't affect PLR.

Update: v1.15, a minor bug fix with PLR. I've definitely been looking at this for too long today.
Last edited by Hey Doomer on Thu Jan 13, 2022 5:02 pm, edited 1 time in total.
User avatar
Hey Doomer
 
Joined: 25 Sep 2021
Operating System: Windows 11
OS Test Version: No (Using Stable Public Version)
Graphics Processor: ATI/AMD with Vulkan Support

Re: Relighting Doom v1.0 [Updated 1/13/22] - Now With PLR

Postby Armaetus » Thu Jan 13, 2022 4:30 pm

I like this concept, shall you wanna go for the semi-realistic gameplay mechanic.
User avatar
Armaetus
RDND, Maps of Chaos and Obsidian Dev
 
Joined: 13 Mar 2009
Location: New York State
Discord: Armaetus#8512
Github ID: GlaiceOldSchoolRTS
Operating System: Windows 10/8.1/8/201x 64-bit
OS Test Version: No (Using Stable Public Version)
Graphics Processor: ATI/AMD with Vulkan Support

Re: Relighting Doom v2.0b [Updated 1/14/22]

Postby Hey Doomer » Fri Jan 14, 2022 6:00 am

Attached is version 2.0b of Relighting that contains numerous small bug fixes and two new features:

  • Optimized light sensor performance (see below explanation).
  • Small bug fixes throughout.
  • Optional bright sector fog to highlight those sectors. Doom is a dusty, dank environment, and light highlights whatever is floating in the air.
  • Optional HUD PLR icon that shows when pupils are constricted or dilated.

Here's what it looks like in action:
Spoiler:


As the player enters a bright sector a normal pupil appears; after the PLR response time a constricted pupil appears, indicating the player's eyes will need to adjust to darkness. I have made some adjustments so that darker sectors appear proportionally darker when that happens.

However, note that this dynamic lux factor is global for all light sensors, so you may see some weird things. For example, in the middle of courtyard tunnel in E1M1 there is a bright sector that triggers a PLR. If you go forward into one or the other side the sector darkens, and if you turn around you'll see the other sector looks darker as well. Generally this works, but as a global setting this is far from perfect.

This version should be more performance friendly as well. The light sensors work by using CheckProximity in a widening range to see what light sources are seen. I've calculated these in advance in a PostBeginPlay() function for each sensor. This eliminates a large number of CheckProximity calls, especially in indoor areas.

An observation: Doom is a dark game, and I've never noticed how few light sources exist until now. Many areas have no light sources at all in terms of textures or windows and in the real world would be darker than the inside of a cow. Likely I seldom thought of where light was coming from in areas with no visible lighting, but this does have a significant effect on the character of some maps. Hopefully this mod makes lighting consistently logical, although it makes me wonder how areas function when the base isn't wrecked and overrun with monsters and functioning normally. Are workers all walking around with headlamps?
You do not have the required permissions to view the files attached to this post.
User avatar
Hey Doomer
 
Joined: 25 Sep 2021
Operating System: Windows 11
OS Test Version: No (Using Stable Public Version)
Graphics Processor: ATI/AMD with Vulkan Support

Re: Relighting Doom v1.0 [Updated 1/13/22] - Now With PLR

Postby Enjay » Fri Jan 14, 2022 6:30 am

I tried the previous version last night and was going to report quite heavy performance issues even on Doom2 default maps. So here's hoping the new optimisations help with that. I'll check when I get home from work.

You are right about the visible light source texture/flat/item thing. I hadn't noticed how extreme this is myself myself until I decided to try converting a few maps to use dynamic lights and realised that many rooms have no obvious light source whatsoever and, therefore, no logical place to put a light object. :lol:
User avatar
Enjay
Everyone is a moon, and has a dark side which he never shows to anybody. Twain
 
 
 
Joined: 15 Jul 2003
Location: Scotland

Re: Relighting Doom v1.0 [Updated 1/13/22] - Now With PLR

Postby Hey Doomer » Fri Jan 14, 2022 7:10 am

Enjay wrote:I tried the previous version last night and was going to report quite heavy performance issues even on Doom2 default maps. So here's hoping the new optimisations help with that. I'll check when I get home from work.

You are right about the visible light source texture/flat/item thing. I hadn't noticed how extreme this is myself myself until I decided to try converting a few maps to use dynamic lights and realised that many rooms have no obvious light source whatsoever and, therefore, no logical place to put a light object. :lol:


Hopefully this version is performance friendly. It seems to be. 8-)

I'm working on another optimization (probably be done tomorrow) that will combine light sensors that share sectors. That should also help improve performance.
User avatar
Hey Doomer
 
Joined: 25 Sep 2021
Operating System: Windows 11
OS Test Version: No (Using Stable Public Version)
Graphics Processor: ATI/AMD with Vulkan Support

Re: Relighting Doom v1.0 [Updated 1/13/22] - Now With PLR

Postby Enjay » Fri Jan 14, 2022 12:37 pm

Performance is better, but still noticeably affected. However, (as it was last night) the effect is weird. It definitely feels slower; like a lower FPS. The thing is, it feels less like a normal lower FPS and more like a micro-pause every tic or so - like the gameplay is jerky in a very, very small faltering way. Screen updates seem normal - the delay is somewhere else.

To back this up, FPS is also weird. I run with vsync on and normally get 60fps (i.e. capped ay my monitor refresh rate). With relighting.pk3 loaded, I get 65 FPS!

With vsync off, I get a solid 200fps running around in Doom2 map01 (which I think is an internal cap). With relighting.pk3 loaded, FPS sits around 165 but the feel of the slowdowns is much more obvious - more so than it is with vsync on.

Weird.

All the above was with Vulkan and the latest nVidia drivers (511.23 updated today).
User avatar
Enjay
Everyone is a moon, and has a dark side which he never shows to anybody. Twain
 
 
 
Joined: 15 Jul 2003
Location: Scotland

Re: Relighting Doom v1.0 [Updated 1/13/22] - Now With PLR

Postby Hey Doomer » Fri Jan 14, 2022 2:32 pm

Enjay wrote:Performance is better, but still noticeably affected. However, (as it was last night) the effect is weird. It definitely feels slower; like a lower FPS. The thing is, it feels less like a normal lower FPS and more like a micro-pause every tic or so - like the gameplay is jerky in a very, very small faltering way. Screen updates seem normal - the delay is somewhere else.

To back this up, FPS is also weird. I run with vsync on and normally get 60fps (i.e. capped ay my monitor refresh rate). With relighting.pk3 loaded, I get 65 FPS!

With vsync off, I get a solid 200fps running around in Doom2 map01 (which I think is an internal cap). With relighting.pk3 loaded, FPS sits around 165 but the feel of the slowdowns is much more obvious - more so than it is with vsync on.

Weird.

All the above was with Vulkan and the latest nVidia drivers (511.23 updated today).


All very interesting! Thanks for the update. I've noticed some of the "faltering," although I haven't seen the FPS anomalies that you describe. The light sensors only adjust color if the player is within proximity, but that means calling a CheckProximity. I wonder if that's where the problem is. I may try something else. I have been able to eliminate duplicate sensors on the same line, which was another significant performance hit. I may have to reduce those further.

Still working on it.

Update: I think the issue is just too many calls to CheckProximity. I've experimented with a few things, and it seems much better with a longer delay between polling light sources. I don't see as much micro-stuttering with weapon sway. It's subtle but noticeable. I can work on this with a direction, and it may be possible to further reduce light sensors. I discovered another anomaly with these sensors: as the player approached they would drop. I set +NOINTERACTION, which eliminated that. Little stuff like that probably doesn't help performance.

Also, sectors beyond a certain radius don't adjust at all, but that means they all do at least one distance check to the player. It seems about the same with Distance2D and CheckProximity, although I feel the former is probably faster.

Still working on it. Making some progress.

Update:

So I don't load up on screenshots, here is some progress in just reducing the number of light sensors:

https://i.postimg.cc/RCj2LKQt/Screenshot-Doom-20220114-174030.png
https://i.postimg.cc/LXNSCXDP/Screenshot-Doom-20220114-172756.png

So, which screenshot is vanilla Doom, and which is Relighting?

I'm seeing better performance, and while the game is somewhat darker it looks better. Reducing the number of light sensors seems to improve performance. The number of sensors vs. sources is not proportional, so it may be a matter of finding just the right ratio.

Anyway, I'll keep playing with it. I don't know how interesting this stuff is to people, but for me the idea of completely relighting a 30-year old game based on the map author's design instincts is fascinating stuff. I'm amazed it can be done at all. While I may end up abandoning this for performance reasons, I am seeing improvement and should have something to post tomorrow for the curious. Thanks Enjay!
User avatar
Hey Doomer
 
Joined: 25 Sep 2021
Operating System: Windows 11
OS Test Version: No (Using Stable Public Version)
Graphics Processor: ATI/AMD with Vulkan Support

Re: Relighting Doom [Beta]

Postby thugsta » Sat Jan 15, 2022 7:41 am

Hey Doomer wrote:


Any chance of a LZDoom release as well?

It seems only function that is unknown is:-
flat[0].StripRight();
flat[1].StripRight();
text[0].StripRight();
text[1].StripRight();
Last edited by thugsta on Sat Jan 15, 2022 8:33 am, edited 1 time in total.
thugsta
 
Joined: 21 Jan 2019

Next

Return to Gameplay Mods

Who is online

Users browsing this forum: PatCatz2004, Tombstone665 and 13 guests