Relighting v4.0165b - blurry shadows w/ rlassets

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.
User avatar
Dan_The_Noob
Posts: 878
Joined: Tue May 07, 2019 12:24 pm
Graphics Processor: nVidia with Vulkan support

Re: Relighting v4.0152b - smarter lighting

Post by Dan_The_Noob »

flashlight++ going through walls is really only noticeable in co-op, but it can cause huge amounts of lag because depending what is there.
I have mine set to a fairly limited distance, but was just curious what other kind of flashlight type mod you might have fiddled with or if any ideas came up for such a thing.

i mostly use the flashlight so i can play with a slightly lower average lighting level, makes things like gunflashes and projectile lighting stand out more.
Zaibatsu64
Posts: 19
Joined: Sun Nov 27, 2022 9:35 am

Re: Relighting v4.0152b - smarter lighting

Post by Zaibatsu64 »

Hi, I was wondering if it's possible to take a look at this issue. In the screenshot below, we can see that the tower has some architectural elements with a ceiling texture. The colour of the sector is then derived from the ceiling texture which looks strange in this example.

https://imgur.com/a/w3FVP6p

Another suggestion would be to have a menu option to control the Doom 64 style additive lighting on the walls. If we look at the same screenshot, the sky is quite dark but the light that's added at the top of the walls is very bright.

Thanks again for the excellent mod, it's become a permanent fixture in my load order!
User avatar
Hey Doomer_
Posts: 448
Joined: Tue Oct 18, 2022 1:59 am
Operating System Version (Optional): Windows 11
Graphics Processor: ATI/AMD with Vulkan/Metal Support

Re: Relighting v4.0152b - smarter lighting

Post by Hey Doomer_ »

Zaibatsu64 wrote: Sun Jan 29, 2023 2:18 am Hi, I was wondering if it's possible to take a look at this issue. In the screenshot below, we can see that the tower has some architectural elements with a ceiling texture. The colour of the sector is then derived from the ceiling texture which looks strange in this example.

https://imgur.com/a/w3FVP6p

Another suggestion would be to have a menu option to control the Doom 64 style additive lighting on the walls. If we look at the same screenshot, the sky is quite dark but the light that's added at the top of the walls is very bright.

Thanks again for the excellent mod, it's become a permanent fixture in my load order!
Thanks for the comments, much appreciated!

Sidedef tiers are not exposed in ZScript, so any additional lighting is applied to the entire side. You're correct that color is applied based on the ceiling texture - and the last palette loaded. Additive color is also added to sidedefs, but color and dimness bleeding are restricted to indoor areas in this version. That probably accounts for some of the strange effects.

What map is this? I'll take a look and see if I can see exactly what's happening.

Sidedef light is in Settings under "Sidedef Add Lights" and "Sidedef Sub Lights." Decorative lights (candelabras etc) are controlled largely by the GLDEF definitions loaded outside Relighting. Note also that settings under "Colored Sectors" will change how flats are interpreted to a degree and how color is applied to sectors. Generally reds and greens are brighter and seem brighter (and closer) than blues. These all use standard color formulas. I've kept most of the default values either conservative or tweaked to demonstrate what the mod can do.
User avatar
Dan_The_Noob
Posts: 878
Joined: Tue May 07, 2019 12:24 pm
Graphics Processor: nVidia with Vulkan support

Re: Relighting v4.0152b - smarter lighting

Post by Dan_The_Noob »

would it be possible to detect ceilings adjacent to skybox? like. "if next to sky and floor same height" or something
Zaibatsu64
Posts: 19
Joined: Sun Nov 27, 2022 9:35 am

Re: Relighting v4.0152b - smarter lighting

Post by Zaibatsu64 »

Hey Doomer_ wrote: Sun Jan 29, 2023 6:49 pm
Zaibatsu64 wrote: Sun Jan 29, 2023 2:18 am Hi, I was wondering if it's possible to take a look at this issue. In the screenshot below, we can see that the tower has some architectural elements with a ceiling texture. The colour of the sector is then derived from the ceiling texture which looks strange in this example.

https://imgur.com/a/w3FVP6p

Another suggestion would be to have a menu option to control the Doom 64 style additive lighting on the walls. If we look at the same screenshot, the sky is quite dark but the light that's added at the top of the walls is very bright.

Thanks again for the excellent mod, it's become a permanent fixture in my load order!
Thanks for the comments, much appreciated!

Sidedef tiers are not exposed in ZScript, so any additional lighting is applied to the entire side. You're correct that color is applied based on the ceiling texture - and the last palette loaded. Additive color is also added to sidedefs, but color and dimness bleeding are restricted to indoor areas in this version. That probably accounts for some of the strange effects.

What map is this? I'll take a look and see if I can see exactly what's happening.

Sidedef light is in Settings under "Sidedef Add Lights" and "Sidedef Sub Lights." Decorative lights (candelabras etc) are controlled largely by the GLDEF definitions loaded outside Relighting. Note also that settings under "Colored Sectors" will change how flats are interpreted to a degree and how color is applied to sectors. Generally reds and greens are brighter and seem brighter (and closer) than blues. These all use standard color formulas. I've kept most of the default values either conservative or tweaked to demonstrate what the mod can do.
Thanks for the detailed response.

The map in that screenshot is e3m1 from No End in Sight. Here's another example from the same level. It's not shown in the picture, but there's a ceiling with a green marble texture which is being treated as a bright light source. It seems like quite a difficult problem to solve. https://imgur.com/MKJloPk

I couldn't find many examples in the original Doom 1 levels, perhaps due to the relatively simplistic geometry.
User avatar
Hey Doomer_
Posts: 448
Joined: Tue Oct 18, 2022 1:59 am
Operating System Version (Optional): Windows 11
Graphics Processor: ATI/AMD with Vulkan/Metal Support

Re: Relighting v4.0152b - smarter lighting

Post by Hey Doomer_ »

Zaibatsu64 wrote: Mon Jan 30, 2023 2:24 am Thanks for the detailed response.

The map in that screenshot is e3m1 from No End in Sight. Here's another example from the same level. It's not shown in the picture, but there's a ceiling with a green marble texture which is being treated as a bright light source. It seems like quite a difficult problem to solve. https://imgur.com/MKJloPk

I couldn't find many examples in the original Doom 1 levels, perhaps due to the relatively simplistic geometry.
I'll check that out.

I don't think the green marble is treated as a light source; color is not applied to that sector because color doesn't bleed from sky areas into non-sky areas. Adding color to a sector changes the perceived light level of the sector, and red is generally not perceived as bright. I'll check out the wad, but this looks like normal behavior for Relighting. You can see something similar in E3M5 of Doom 1. The green gargoyle textures appear to be independently lit, but they are not. It's that they are not colored.

One would think it's a simple matter to bleed color and dimness, but map structure isn't remotely designed for anything like that. Sectors and lines within the sectors are not sorted (for example, line vertices must be reordered to calculate area). They appear to be structured as created, flipped linedefs and all. I'm still working on color and dimness bleeding issues. I hope to fix those for the next release.

Update:

Work on some of the color bleeding for upcoming release.
https://i.postimg.cc/W3rFsgSW/e3m5-1.png
https://i.postimg.cc/yxHJxxbV/e3m5-2.png

This has the effect of making some sectors darker as expected, but I'm working on baked light sources also...
User avatar
StraightWhiteMan
Posts: 60
Joined: Thu Jul 02, 2020 8:07 pm
Graphics Processor: nVidia (Modern GZDoom)

Re: Relighting v4.0152b - smarter lighting

Post by StraightWhiteMan »

Just to chime in on the flashlight discussion from a little earlier, have you guys tried Dark DoomZ? I think it looks cool with Relighting a lot of times and personally think it has the best flashlight I've come across, and I've tried them all AFAIK. If you don't want to use the lighting changes it offers, you can turn everything off in the settings and only use the flashlight portion which has a bunch of it's own options. It also doesn't lag whatsoever and doesn't penetrate walls. If it does I've never noticed it once in numerous years.
User avatar
generic name guy
Posts: 123
Joined: Wed Nov 11, 2020 3:25 pm
Graphics Processor: nVidia with Vulkan support
Location: Brazil

Re: Relighting v4.0152b - smarter lighting

Post by generic name guy »

StraightWhiteMan wrote: Mon Jan 30, 2023 8:55 pm Just to chime in on the flashlight discussion from a little earlier, have you guys tried Dark DoomZ? I think it looks cool with Relighting a lot of times and personally think it has the best flashlight I've come across, and I've tried them all AFAIK. If you don't want to use the lighting changes it offers, you can turn everything off in the settings and only use the flashlight portion which has a bunch of it's own options. It also doesn't lag whatsoever and doesn't penetrate walls. If it does I've never noticed it once in numerous years.
Eh, i've noticed that if you lower the Intensity in F++, it runs better, so that's probably what DDZ does.
User avatar
Dan_The_Noob
Posts: 878
Joined: Tue May 07, 2019 12:24 pm
Graphics Processor: nVidia with Vulkan support

Re: Relighting v4.0152b - smarter lighting

Post by Dan_The_Noob »

oh ya i tried DarkDoomZ too. that's how i originally stumbled upon the old relighting post
User avatar
Hey Doomer_
Posts: 448
Joined: Tue Oct 18, 2022 1:59 am
Operating System Version (Optional): Windows 11
Graphics Processor: ATI/AMD with Vulkan/Metal Support

Re: Relighting v4.0152b - smarter lighting

Post by Hey Doomer_ »

WIWO v4.0153b - more lights

Code: Select all

v4.0153b

1/30 - added more color bleeding
1/30 - added code to darken sectors where total_light == 0
1/31 - added temporary light sources for baked sidedefs

Aside from the color bleeding changes noted above, I've tweaked sector lighting when there are no light sources. Example from MAP10; at the end of the hallway there are a large chamber with a light value of 192 on the map but no obvious lighting.

https://i.postimg.cc/d1CGM51K/MAP10.png

I've also tweaked the threshold for added light. These are integer values, so any fraction less than 1.5 is added to the darkened value. That way light is still "seen" by the texture.

I've also added temporary lights for the purposes of sidedef baking. These don't generate dynamic lights and a destroyed before gameplay, so there is no impact on performance. In large sectors where the POI is around a corner but the lit sector is very visible, for example, I've added temporary lights to 2-sided linedefs. These are weaker than the POI light source but still have an impact in some areas. Differences are subtle, as the amounts of added light are generally small. It all depends on level geometry.

I still have a bit of work to do on this.
User avatar
StraightWhiteMan
Posts: 60
Joined: Thu Jul 02, 2020 8:07 pm
Graphics Processor: nVidia (Modern GZDoom)

Re: Relighting v4.0152b - smarter lighting

Post by StraightWhiteMan »

After playing a lot more with this mod lately, I noticed that the Player and Enemy shadows are active even if the options for them are turned off. It seems to be map based because, if I just play the regular Doom 2 maps, the shadows won't show up unless I turn them on, but then on other maps (Altars of Madness for example) they will be active no matter what. Just throwing that out there.
cosmos10040
Posts: 193
Joined: Mon Dec 20, 2021 6:16 am
Graphics Processor: ATI/AMD (Modern GZDoom)

Re: Relighting v4.0152b - smarter lighting

Post by cosmos10040 »

Mod just keeps getting better with every update. I tried running this mod with the silent hill Map on deltatouch, I know it's a crazy idea. But it loads up and runs real slow I actually got outside and then it force close, I think I ran out of ram but my phone has 12gb ram lol. The map runs with all.my other addons. Can you check that mpa out please? I'm thinking if maybe there's a way to tweak huge maps with relighting it will be even better!
User avatar
Dan_The_Noob
Posts: 878
Joined: Tue May 07, 2019 12:24 pm
Graphics Processor: nVidia with Vulkan support

Re: Relighting v4.0152b - smarter lighting

Post by Dan_The_Noob »

cosmos10040 wrote: Fri Feb 03, 2023 8:48 am Mod just keeps getting better with every update. I tried running this mod with the silent hill Map on deltatouch, I know it's a crazy idea. But it loads up and runs real slow I actually got outside and then it force close, I think I ran out of ram but my phone has 12gb ram lol. The map runs with all.my other addons. Can you check that mpa out please? I'm thinking if maybe there's a way to tweak huge maps with relighting it will be even better!
tweak the min* slider toward the lower end of the options. set it to around 200+. makes a big difference
User avatar
Hey Doomer_
Posts: 448
Joined: Tue Oct 18, 2022 1:59 am
Operating System Version (Optional): Windows 11
Graphics Processor: ATI/AMD with Vulkan/Metal Support

Re: Relighting v4.0153b - more light and shadow

Post by Hey Doomer_ »

Posted v4.0153b

Code: Select all

v4.0153b

1/30 - added more color bleeding
1/31 - added temporary light sources for baked sidedefs
2/3 - added sector light adjustments for total light & shadow

This overhauls much of the lighting to reduce the number of dynamic lights, add criteria for smaller sectors that may need light, and add tweaks to baked lights and sector light levels. Many of these effects are subtle.

E1M2 - note how the building has more realistic lighting
E1M6 - shadows are deepened and the skylight seems more intense
E2M6 - pseudo-directional lighting around posts
MAP05 - more light outside filtering inside

I struggled in particular with balancing the author's original lighting vs. natural and decorative light sources, so compromises had to be made. Some areas of the game are inexplicably lit and others barely lit, but in general there is more light and shadow with this version. In general there are the same or fewer light sources, although temporary sources are added for baked texture lighting. Various corrections have been made if colors have been added.

Default settings have remained the same.
User avatar
Hey Doomer_
Posts: 448
Joined: Tue Oct 18, 2022 1:59 am
Operating System Version (Optional): Windows 11
Graphics Processor: ATI/AMD with Vulkan/Metal Support

Re: Relighting v4.0152b - smarter lighting

Post by Hey Doomer_ »

cosmos10040 wrote: Fri Feb 03, 2023 8:48 am Mod just keeps getting better with every update. I tried running this mod with the silent hill Map on deltatouch, I know it's a crazy idea. But it loads up and runs real slow I actually got outside and then it force close, I think I ran out of ram but my phone has 12gb ram lol. The map runs with all.my other addons. Can you check that mpa out please? I'm thinking if maybe there's a way to tweak huge maps with relighting it will be even better!
Thanks, I'll check it out!

The new version should reduce the number of lights or defaults can be changed as Dan suggests.

Explanation

Generally lights are placed according to the light level in a sector and how big it is. All sector areas are calculated initially filtered by min and max areas in settings, and then these are adjusted to the skew (tail) of the curve. Invariably this is skewed at the lower end, so the minimum area is multiplied by a factor usually between 1-5. (Detailed maps notoriously have many tiny sectors, and Doom map sectors areas are generally negatively skewed.) The median of this population is found, and between those three values and light levels the main light source actors are places at the POI in each sector. I also take into account the average indoor and outdoor lighting for each map.

What this version does that is slightly different is it chooses median to max areas and applies different criteria between min and median. That reduces the number of light sources (and probably dynamic lights) and may improve performance. I've also added temporary light actors to the perimeters of these sectors for light baking. Usually these don't add much light, but it all depends on the geometry. Note that this can increase load times in some maps, since it iterates through all lines in the sector. Other factors I've considered are dimmer sectors that are brighter than the minimum surrounding light, and other dimmer sectors. These don't add strong light sources and certainly not enough to generate a dynamic light, but it helps gather all available light. Doom maps e.g. Tom Hall and Sandy Peterson, lack obvious light sources.

So be aware in tweaking min and max areas in settings that you may exclude entire areas of the map from being lit depending on your rig. You could be better off tweaking sector light size and scale.

Sorry for the long explanation (although it may be of interest to some), but it may not be obvious what this mod does. I think it probably helps to understand how map geometry, complexity, and lighting may affect its performance.


Again Many Thanks for comments! I appreciate the interest!!

Return to “Gameplay Mods”