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.
Post Reply
User avatar
Enjay
 
 
Posts: 27085
Joined: Tue Jul 15, 2003 4:58 pm
Location: Scotland
Contact:

Re: Relighting Doom v2.46b [Updated 1/26/22] w/ Window Light

Post by Enjay »

Cool new version. So far so good. Performance is still good.

MAP02 looks more natural now, though I can see why lighting it is hard.

I did notice that the barriers that open near the start don't match the surrounding water. I *think* it's a shininess issue rather than a brightness one?



Hey Doomer wrote:There is a brightmap in the SBrightmaps pk3 that I brightened:
I don't know what it is about that brightmap, but that sign still looks quite dull to me.

But brightmaps are definitely working:

And I can see that there is a brightmap in the PK3.

[edit]
Hang on, this is the contents of GLDEFS.BM

Code: Select all

brightmap texture DOORBLU {	map "brightmaps/DOORBLU.png" iwad }
brightmap texture DOORRED {	map "brightmaps/DOORBLU.png" iwad }
brightmap texture DOORYEL {	map "brightmaps/DOORBLU.png" iwad }
brightmap texture COMPUTE2 { map "brightmaps/COMPUTE2.png" iwad }
brightmap texture BIGDOOR2 { map "brightmaps/BIGDOOR2.png" iwad }
brightmap texture BIGDOOR3 { map "brightmaps/BIGDOOR2.png" iwad }
brightmap texture BIGDOOR4 { map "brightmaps/BIGDOOR2.png" iwad }
brightmap texture BRWINDOW { map "brightmaps/BRWINDOW.png" iwad }
No mention of EXITSIGN (or EXITSTON for that matter).
[/edit]

Hey Doomer wrote:I don't see a dark pool, really. Maybe it's your sector lighting mode?
Honestly, the pool in your shot looks dark to me as well. Certainly much darker than the pool is in comparison to its surroundings without the mod loaded:



The mod (intentionally) doesn't darken most of the out door area but, for some reason, the pool does seem to get quite a bit darker.




As a suggestion, have you looked into GLDEFS defined glowing flats? They might be of use to you.
Hey Doomer
Posts: 283
Joined: Sat Sep 25, 2021 3:38 am

Re: Relighting Doom v2.47b [Updated 1/27/22] w/ Window Light

Post by Hey Doomer »

exitmap01.png
Fixed.

I'll check out the others too. Thanks!
User avatar
Redneckerz
Spotlight Team
Posts: 1129
Joined: Mon Nov 25, 2019 8:54 am
Graphics Processor: Intel (Modern GZDoom)

Re: Relighting Doom v2.47b [Updated 1/27/22] w/ Window Light

Post by Redneckerz »

Literally the most insane idea i have seen this side of Phobos. I have always wanted something like this, and figured ZDRay, with baked lightmaps would be the end-all,be-all solution.

But then there is this. I am baffled by how this works (Well ZScript, obviously). But can you through the nitty gritty? You say you use text lumps and flats but how are they traced? I assume thatyou trace the lights based on algoritms that determine what a corner is, a door, etc, but how is the lighting computed? From the flats itself? If so, how do you calculate the lighting from these flats?

And this is runnable on the GLES renderer?

This is really a novel approach to lighting if i ever saw one.

Just another proof how important lighting is in any game.
Hey Doomer
Posts: 283
Joined: Sat Sep 25, 2021 3:38 am

Re: Relighting Doom v2.46b [Updated 1/26/22] w/ Window Light

Post by Hey Doomer »

Enjay wrote:Cool new version. So far so good. Performance is still good.

Honestly, the pool in your shot looks dark to me as well. Certainly much darker than the pool is in comparison to its surroundings without the mod loaded:
I think the problem may be animated textures. The color assignment is based on the map name, which is NUKAGE3. I wonder is something happens when NUKAGE1 and NUKAGE2 are loaded...

Update:
I think it may be the sector dynamic lights near the player start...
SLON
Posts: 141
Joined: Fri Feb 10, 2017 2:09 pm
Graphics Processor: nVidia (Modern GZDoom)

Re: Relighting Doom v2.47b [Updated 1/27/22] w/ Window Light

Post by SLON »

And a couple of strange things that I noticed still in previous versions. And yes, I play with a bunch of mods, but none of them should apply to this.
Spoiler:
Hey Doomer
Posts: 283
Joined: Sat Sep 25, 2021 3:38 am

Re: Relighting Doom v2.47b [Updated 1/27/22] w/ Window Light

Post by Hey Doomer »

Redneckerz wrote:Literally the most insane idea i have seen this side of Phobos. I have always wanted something like this, and figured ZDRay, with baked lightmaps would be the end-all,be-all solution.

But then there is this. I am baffled by how this works (Well ZScript, obviously). But can you through the nitty gritty? You say you use text lumps and flats but how are they traced? I assume thatyou trace the lights based on algoritms that determine what a corner is, a door, etc, but how is the lighting computed? From the flats itself? If so, how do you calculate the lighting from these flats?

And this is runnable on the GLES renderer?

This is really a novel approach to lighting if i ever saw one.

Just another proof how important lighting is in any game.
Thanks!

How this works is simple in concept. Sectors are either a light source and spawn a BrightLight actor or a non-light source and spawn a LightSensor actor. LightSensor actors check to see how close the nearest BrightLight is and adjust sector light in steps generally divisible by 8. Light changes when a door opens and closes, for example. Light actors prioritize doors and then two-sided lines. Dynamic lights are essentially the same thing but are attached to texture lines instead of two-sided lines. The exception is a window dynamic light, which is in the middle of the window. Few calculations are needed.

Definition lumps are plain text lists of texture or flat names with a color code, easily edited using any text editor. When a map is loaded and before the game starts the program loops through all sectors and lines checking for textures that are in these lumps to decide what kind of sector it is, what color it is, how strong the light is, and where to place the actors. Almost all the work is done by the LightSensor actors (the bit that Phantombeta optimized so well) once the level starts.

Aside from calculating placement in the middle of a line or texture there are few rules to placing these actors. They can't be too close to the same actor type, and if two LightSensors overlap one "shares" both sectors. There isn't any consideration to corners, stairs, or any other map geometry other than doors and windows. The layout of Doom tends to make this work, since the vast majority of sectors have at least one two sided line. Remarkably, in many cases Relighting looks similar to the original. It looks better in many cases.

Light levels are determined by color; colors we perceive as brighter make sectors brighter. This can be adjusted in the Settings menu, but I'm certainly not any kind of expert in that area. I just understand the general idea and apply it to light levels in the game using standard calculations. Thus each flat and texture in the definition has a color and not a number.

That's generally how it works., if that makes sense.
Hey Doomer
Posts: 283
Joined: Sat Sep 25, 2021 3:38 am

Re: Relighting Doom v2.47b [Updated 1/27/22] w/ Window Light

Post by Hey Doomer »

SLON wrote:And a couple of strange things that I noticed still in previous versions. And yes, I play with a bunch of mods, but none of them should apply to this.
Spoiler:
This is the PLR code doing it's thing, and it's something I need to look at again. The idea here is to simulate a pupillary light reflex when moving from bright to dark areas, but everything else has changed considerably since that was added. In the upper right corner the pupil will indicate constricted, normal, or widened, to indicate the reflex and recovery.

Update: should have this fixed for next release, probably tomorrow.
Hey Doomer
Posts: 283
Joined: Sat Sep 25, 2021 3:38 am

Re: Relighting Doom v2.48b [Updated 1/28/22] w/ Window Light

Post by Hey Doomer »

Just posted 2.48b with the following changes:
  • LightSensors that are far away pause or become dormant, and those sectors now darken, adding to distant gloom
  • Most limits now contingent on Settings variables
  • Added a PLR check for constricted pupils returning into a bright sector
  • Minor tweaks and bug fixes
I tried a few things with dynamic lights, and for the most part they simply enhance sector lighting. They can be easily overused and either completely break lighting, bring everything to a crawl, or both. But defined sector textures such as ICKWALL5 create this with no performance hit:

https://i.postimg.cc/cLwdG7w6/Screensho ... 053108.png

In sectors that are otherwise pitch dark a dark color can be added to a flat or texture to make it a "bright" sector. Here's E3M1 with FLOOR6_2 defined with "ash gray," which the human eye perceives as dark:

https://i.postimg.cc/Y04nF3xH/Screensho ... 065454.png

Anyhoo that's the notion. If it isn't a bright sector it contains LightSensors, and if there are no visible light sources it will remain at the minimum light level in Settings, anyway. This demonstrates the idea, hopefully, but it doesn't help in applying this to specific maps or mods. For example, you may want the sky one color in MAP01 and another in MAP02; currently it's the same per texture for all maps. I'll probably look at that next.

Thanks for all your interest and support!
Hey Doomer
Posts: 283
Joined: Sat Sep 25, 2021 3:38 am

Re: Relighting Doom v2.48b [Updated 1/28/22] w/ Window Light

Post by Hey Doomer »

After all the editorializing about dynamic lights tanking performance for the next release I've added Light Grids in windows. This adds a grid of dynamic lights (1 - 6) depending on the window dimensions for outside windows. I got this idea from looking at the tall windows at the start of E1M1 and thinking a single dynamic light wasn't enough. Here's an example of what this does for MAP11. (The orbs show the grid points.)

https://i.postimg.cc/44D87tq6/Screensho ... 163447.png
User avatar
hitmanx
Posts: 428
Joined: Sat Dec 18, 2004 4:58 am

Re: Relighting Doom v2.48b [Updated 1/28/22] w/ Window Light

Post by hitmanx »

You continually do great work with this. reminds me of the dark places engine for quake.

This would look great with PBR textures but I can't seem to find any that are just the standard textures, I can see PBR doom 64 textures floating around. It would really stand out now with all the dynamic lights.
Hey Doomer
Posts: 283
Joined: Sat Sep 25, 2021 3:38 am

Re: Relighting Doom v2.49b [Updated 1/29/22] w/ Light Grids

Post by Hey Doomer »

Just posted v2.49b with "light grids" in windows. What it does is add additional dynamic lights in a grid pattern to larger window areas to increase and evenly disperse dynamic light. This is certainly a performance hit on some systems depending on map geometry, and I've added options to control this in settings. Light grids are between 1-6 lights. I doubt I'll need more.

Here's a few examples:

MAP11 - note how the sector lighting in foreground and dynamic lighting in the background compliment each other. This map really pops now. Reminds me of miniature golf at night!
https://i.postimg.cc/rmgwTyWK/Screensho ... 052942.png

E1M4 - this is a "window" because it has unpegged textures and goes from a brighter to darker area. This is an excellent example of dispersing light, since there are now two dynamic lights, one at the top and one at the bottom. Previously there was one in the middle.
https://i.postimg.cc/D0ZywVd5/Screensho ... 053048.png

E1M6 - this contains multiple "windows" because of the sky texture and unpegged textures. One thing I'm noticing is an illusion of new map geometry as these point lights interact, as though new sectors are added (they are not).
https://i.postimg.cc/90nX4xL2/Screensho ... 053150.png

MAP10 - good example of everything working together. This includes sector lighting and color, texture lights, and window light grids.
https://i.postimg.cc/KzbNBr03/Screensho ... 055441.png

Other than that a few minor bug fixes:
  • added a minimum area to apply window grids, which helps performance; not generally a problem in original Doom maps, but some of the community maps have odd geometry
  • added a zheight hack for closed windows; the height is originally zero, and I changed this to 32. This works but I may have to come back to it.
  • fixed the TNT sky textures
There are no exceptions coded for specific maps. It's HS geometry and trig - Doom is essentially 2D - and it makes me wish I'd paid more attention to this stuff at the time. (When am I ever going to use this? lol.) The effects are caused by window layout interacting with other elements. I'm still finding many areas of the game lack light altogether, but that's Doom. Perhaps this works differently in Heretic.

Also note I make guesses on colors and use what seems to look good to me at the time. Feel free to experiment and make suggestions. I welcome any input in that area. Thanks for your comments and support, and let me know what you think!
Hey Doomer
Posts: 283
Joined: Sat Sep 25, 2021 3:38 am

Re: Relighting Doom v2.48b [Updated 1/28/22] w/ Window Light

Post by Hey Doomer »

hitmanx wrote:You continually do great work with this. reminds me of the dark places engine for quake.

This would look great with PBR textures but I can't seem to find any that are just the standard textures, I can see PBR doom 64 textures floating around. It would really stand out now with all the dynamic lights.
As a quick experiment, I tried this mod https://www.moddb.com/games/doom/addons/plastic-shaders and removed the "fakelight.pk3" from the zip, which I think adds dynamic lights to highlight the textures. I'm not endorsing this other mod one way or another, just for demonstration of Relighting:

https://i.postimg.cc/nhz8sW25/Screensho ... 063535.png
https://i.postimg.cc/R06jdnjL/Screensho ... 063815.png
https://i.postimg.cc/4yPtmPQf/Screensho ... 065055.png

Ain't that something. 8-)
User avatar
mamaluigisbagel
Posts: 526
Joined: Wed Jul 09, 2014 7:25 pm
Preferred Pronouns: He/Him
Operating System Version (Optional): Windows 11
Graphics Processor: nVidia with Vulkan support

Re: Relighting Doom v2.49b [Updated 1/29/22] w/ Light Grids

Post by mamaluigisbagel »

I assume this is unfixable without disabling reflections or more, but figured I'd point it out because it just looks so weird to me.

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

Re: Relighting Doom v2.49b [Updated 1/29/22] w/ Light Grids

Post by Hey Doomer »

mamaluigisbagel wrote:I assume this is unfixable without disabling reflections or more, but figured I'd point it out because it just looks so weird to me.
I'm not sure what I'm looking at. Are you talking about the artifacts on the FWATER texture?
User avatar
mamaluigisbagel
Posts: 526
Joined: Wed Jul 09, 2014 7:25 pm
Preferred Pronouns: He/Him
Operating System Version (Optional): Windows 11
Graphics Processor: nVidia with Vulkan support

Re: Relighting Doom v2.49b [Updated 1/29/22] w/ Light Grids

Post by mamaluigisbagel »

Its the fact the liquid has a reflection. I dunno, it just makes me think you can dive in the water sometimes because it looks deeper than it actually is.
Post Reply

Return to “Gameplay Mods”