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
Arcev
Posts: 8
Joined: Fri Jan 13, 2023 3:50 pm
Operating System Version (Optional): Windows 11 64-bit
Graphics Processor: nVidia (Modern GZDoom)

Re: Relighting v4.0151b - smart lighting

Post by Arcev »

Dan_The_Noob wrote: Mon Jan 23, 2023 5:02 am
Arcev wrote: Mon Jan 23, 2023 1:18 am Another note, I turned off ALL settings in the mod menu and there is little to no difference in FPS. That includes greyed out options.
Seems like the mod menu doesn't have all the options needed, or it doesn't turn off said feature/s.
Removing the mod seems to restore FPS compared to just turning everything off.

I tested this by loading up UF E2M6 where a heavy use of GL lighting is present AND sub 60 fps.

Current relighting settings:
https://i.gyazo.com/90a90d9b0bba6c205bc ... d91be4.mp4

WITHOUT relighting:
https://i.imgur.com/ScOp5cW.png

WITH Relighting (All Off settings)
https://i.imgur.com/nqVbSx4.png
did you reload the level after turning it off? settings require restart
Forgot to mention this, but yes I restarted the game each time I tested settings.
User avatar
Dan_The_Noob
Posts: 869
Joined: Tue May 07, 2019 12:24 pm
Graphics Processor: nVidia with Vulkan support

Re: Relighting v4.0151b - smart lighting

Post by Dan_The_Noob »

Arcev wrote: Mon Jan 23, 2023 6:54 pm
Forgot to mention this, but yes I restarted the game each time I tested settings.
if this is with 4.0151b it could be related to the shadows coming back on i was coming across too.
it seems like you need to disable each option (even if the top setting being off greys them out) for some reason. maybe an oversight.
keepingitgrimmdark
Posts: 10
Joined: Wed Nov 30, 2022 10:39 am
Preferred Pronouns: He/Him
Operating System Version (Optional): Windows 10

Re: Relighting v4.0151b - smart lighting

Post by keepingitgrimmdark »

the things that seem to give the biggest performance hit for me are lots of sudden dynamic lights (AOD teleport animation and guncasters super shot gun to name some quick examples)
User avatar
Hey Doomer_
Posts: 395
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.0151b - smart lighting

Post by Hey Doomer_ »

keepingitgrimmdark wrote: Mon Jan 23, 2023 8:26 pm the things that seem to give the biggest performance hit for me are lots of sudden dynamic lights (AOD teleport animation and guncasters super shot gun to name some quick examples)
You can try limiting the number of missile lights in Settings and see if that makes a difference.
User avatar
Vcred
Posts: 4
Joined: Tue Jan 10, 2023 2:57 pm
Preferred Pronouns: He/Him

Re: Relighting v4.0151b - smart lighting

Post by Vcred »

Skrell wrote: Sun Jan 22, 2023 9:07 am
Vcred wrote: Sun Jan 22, 2023 7:45 am Which sector light mode is better to use with this mod? (GZDoom)
I asked this same question in a previous post and the author said he uses the "dark" sector mode when testing but hasn't really experimented with a "optimal settings" of gzdoom settings for this mod yet.
viewtopic.php?p=1234674#p1234674
Thank you for your time!
User avatar
Hey Doomer_
Posts: 395
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_ »

Posted v4.0152b

In addition to items noted above, I've added many tweaks to smart lighting and/or linked these to CVars. Smart lighting depends more on the author's lighting now, and the number of dynamic lights has been reduced. I've also made allowances for sectors without any lighting at all vs. some lighting added by the mod. This is logical for the most part although it does have the effect of making dark areas darker. A notable example of this is MAP10, which has side rooms that are brightly lit without any visible light source. These are dimmer, although I haven't gone the route of this mod's previous version in stripping all light from the map.

I also looked at texture names as a key for applying light, since these are somewhat consistent in Doom. They are not consistent in Doom 2 or other games. Still nothing there.

Hopefully all this has the effect of more natural lighting given the author's interpretation. Map load times and performance should be improved, although I've not done extensive testing. The baked lighting routine, for instance, has been trimmed and has fewer iterations. I spent some time going through the code to eliminate redundancies and correct dependencies on CVars.

Let me know what you think!
User avatar
Arcev
Posts: 8
Joined: Fri Jan 13, 2023 3:50 pm
Operating System Version (Optional): Windows 11 64-bit
Graphics Processor: nVidia (Modern GZDoom)

Re: Relighting v4.0152b - smarter lighting

Post by Arcev »

Hey Doomer_ wrote: Fri Jan 27, 2023 3:30 pm Posted v4.0152b

In addition to items noted above, I've added many tweaks to smart lighting and/or linked these to CVars. Smart lighting depends more on the author's lighting now, and the number of dynamic lights has been reduced. I've also made allowances for sectors without any lighting at all vs. some lighting added by the mod. This is logical for the most part although it does have the effect of making dark areas darker. A notable example of this is MAP10, which has side rooms that are brightly lit without any visible light source. These are dimmer, although I haven't gone the route of this mod's previous version in stripping all light from the map.

I also looked at texture names as a key for applying light, since these are somewhat consistent in Doom. They are not consistent in Doom 2 or other games. Still nothing there.

Hopefully all this has the effect of more natural lighting given the author's interpretation. Map load times and performance should be improved, although I've not done extensive testing. The baked lighting routine, for instance, has been trimmed and has fewer iterations. I spent some time going through the code to eliminate redundancies and correct dependencies on CVars.

Let me know what you think!
I'll check it out, hopefully it helps with the performance issues I've been running into.
I will also report any crashes and such.

EDIT: This update helped actually. All the settings are disabled still but getting more FPS. Not enough to keep a stable 60, but instead of a common 30 or lower it goes to 30-45 now. Intensive areas with GL decorations still hurt with a 25 fps sometimes. I think the Author of the UF series knew that performance was an issue and tried to keep a baseline of 60 fps in his maps, because without relighting on multiple maps on my rig hits 60 fps on a lot of them.
User avatar
Dan_The_Noob
Posts: 869
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 »

Arcev wrote: Fri Jan 27, 2023 5:53 pm EDIT: This update helped actually. All the settings are disabled still but getting more FPS. Not enough to keep a stable 60, but instead of a common 30 or lower it goes to 30-45 now. Intensive areas with GL decorations still hurt with a 25 fps sometimes. I think the Author of the UF series knew that performance was an issue and tried to keep a baseline of 60 fps in his maps, because without relighting on multiple maps on my rig hits 60 fps on a lot of them.
play around with the sector light min/max settings i have mine on 200 and 250 i think. seems to hold pretty steady fps
User avatar
Arcev
Posts: 8
Joined: Fri Jan 13, 2023 3:50 pm
Operating System Version (Optional): Windows 11 64-bit
Graphics Processor: nVidia (Modern GZDoom)

Re: Relighting v4.0152b - smarter lighting

Post by Arcev »

Another thing I think that is worth noting is how DISABLING rendering interpolation allows normally 16-20 FPS situations restore to 35 fps but is locked at 35 fps.

Not sure how this plays into rendering and all that, but it might be a good note.
User avatar
Dan_The_Noob
Posts: 869
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 »

Arcev wrote: Fri Jan 27, 2023 9:36 pm Another thing I think that is worth noting is how DISABLING rendering interpolation allows normally 16-20 FPS situations restore to 35 fps but is locked at 35 fps.

Not sure how this plays into rendering and all that, but it might be a good note.
ya, because it is reducing things to 35 refreshes per second instead of 60+
User avatar
Hey Doomer_
Posts: 395
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_ »

Unsolicited explanation of some of the lighting.

Relighting: https://i.postimg.cc/NjGY7C7d/e2m2-rl.png

Vanilla: https://i.postimg.cc/bN9pnfbG/e2m2-vanilla.png

Relighting disables fake contrast (notable in the vanilla shot as all textures pointing in the same direction are similarly lit) and uses smooth wall lighting instead where texture lighting depends on how much light falls on the surface (a simple calculation using the inverse square law). The difference here is subtle, but as you can see it adds variations in lighting. In this case Relighting also reads the ceiling flat as a light source, although that's something that the author hopefully does as well.

Measuring light is much simpler than shadow, although placing a light source itself depends on settings. The minimum area setting is increased by the amount the areas are skewed, a simple correction. The polylabel routine (used to label maps) places a light source in an optimal location with the most distance to the most number of points (point of inaccessibility). At present this also depends on the author's lighting. Measuring shadow is rather crude and depends largely on how far away any light source is; this does not take into account where the light is. Working on that.

As for light sources, these are general sector light sources depending on the size of the sector, author lighting of the sector, and whether it is outside or inside. This can be tweaked in settings, but note it also takes into account the average outdoor and indoor map lighting. Other light sources include decorative lights, which are found by iterating through a sector's things and considering properties and if it has a GLDEF entry. The GLDEF color determines the color of a dynamic light if attached.

Of course there is no directional lighting in GZDoom. All flats are lit the same in any sector. Fog effects (which can be seen in the above where the shotgun is) are possible, but at present there is nothing like oblong shadows on flat surfaces. I'll likely continue to work on refining the baked texture lighting, but at present I don't see any simple way to accomplish the former. Subtractive lights and FLATSPRITES haven't yet panned out. (I suspect the latter might work...) I'm open to suggestions.

Many thanks for your interest and comments!
User avatar
Dan_The_Noob
Posts: 869
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 »

unrelated but, i don't suppose during all this relighting stuff you thought of a way to do an efficient flashlight mod?

so far the brutal doom/project brutality flashlight lags because it's projectile-based and Flashlight++ randomly get dragged down because it penetrates walls.
User avatar
stainedofmind
Posts: 87
Joined: Sun Sep 01, 2019 10:59 am

Re: Relighting v4.0152b - smarter lighting

Post by stainedofmind »

Dan_The_Noob wrote: Sat Jan 28, 2023 3:13 pm unrelated but, i don't suppose during all this relighting stuff you thought of a way to do an efficient flashlight mod?

so far the brutal doom/project brutality flashlight lags because it's projectile-based and Flashlight++ randomly get dragged down because it penetrates walls.
Glad I'm not the only one with this problem. I keep swapping flashlight mods, flipflopping between which style has better performance. Thought the flashlight++ style was better for a while, but I kept running into situations where it bogged down horribly. Makes sense from your explanation now!
User avatar
generic name guy
Posts: 121
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 »

Dan_The_Noob wrote: Sat Jan 28, 2023 3:13 pm Flashlight++ randomly get dragged down because it penetrates walls.
stainedofmind wrote: Sat Jan 28, 2023 4:06 pm Thought the flashlight++ style was better for a while, but I kept running into situations where it bogged down horribly. Makes sense from your explanation now!
Yeah, it's an unfortunate side effect of spotlights, there's nothing i can do, it has to be modified within the engine itself.
User avatar
Hey Doomer_
Posts: 395
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_ »

Dan_The_Noob wrote: Sat Jan 28, 2023 3:13 pm unrelated but, i don't suppose during all this relighting stuff you thought of a way to do an efficient flashlight mod?

so far the brutal doom/project brutality flashlight lags because it's projectile-based and Flashlight++ randomly get dragged down because it penetrates walls.
There are popular flashlight mods, so no. I've been using Flashlight++. I haven't noticed it penetrating walls, unless you mean bleeding into other sectors... all dynamic lights do this. I'm not sure why, since they use the BSP to light textures AFAICT.

I have written flashlight mods, however, and thought of adding one. All of these use a spotlight of one kind of another. And I wonder (really...) in the future will people still be walking around a futuristic base with a Maglite? Won't there be a better way of lighting an area? I guess it doesn't matter, since we are all familiar with the spooky feel of the flashlight. :wink:

Return to “Gameplay Mods”