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.
Skrell
Posts: 351
Joined: Mon Mar 25, 2013 11:47 am

Re: Relighting v4.0162b - compatibility and more pitched shadows

Post by Skrell »

Glad I could help! :)
User avatar
MsrSgtShooterPerson
Posts: 50
Joined: Thu Jan 02, 2020 1:59 am
Location: Lost in the procedural infinite hells and I'm fine with that.
Contact:

Re: Relighting v4.0162b - compatibility and more pitched shadows

Post by MsrSgtShooterPerson »

I do have a question about how Perceived Light and the How RGB stuff works - apologies if I'm wrong about this (I feel I most certainly am), but does Perceived Light refer to something like if a certain sector is of a certain brightness, a texture light and sector colorization is most likely to be added on to it? (so therefore, a higher value limits the amount of these?)

For How RGB, if I set these to example to 255, 0, 0, does this mean most texture lights/sector coloring will mostly be red even if let's say the flats in that area is a different color entirely i.e. blue?

Thanks again! I kind of feel the tooltip descriptions appearing on the options could be a bit more comprehensive (and perhaps rewritten to be more towards what the user can expect when changing it, as I feel describing its internal function alone is a bit difficult to grasp otherwise)
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.0162b - compatibility and more pitched shadows

Post by Hey Doomer_ »

MsrSgtShooterPerson wrote: Mon May 15, 2023 10:28 pm I do have a question about how Perceived Light and the How RGB stuff works - apologies if I'm wrong about this (I feel I most certainly am), but does Perceived Light refer to something like if a certain sector is of a certain brightness, a texture light and sector colorization is most likely to be added on to it? (so therefore, a higher value limits the amount of these?)

For How RGB, if I set these to example to 255, 0, 0, does this mean most texture lights/sector coloring will mostly be red even if let's say the flats in that area is a different color entirely i.e. blue?

Thanks again! I kind of feel the tooltip descriptions appearing on the options could be a bit more comprehensive (and perhaps rewritten to be more towards what the user can expect when changing it, as I feel describing its internal function alone is a bit difficult to grasp otherwise)
I am puzzling over how to improve the menus to be more informative, since the options alone do not describe how the mod works as you point out. Not sure of the best approach.

Perceived light is a measure of how bright a color seems to us, and isn't associated with light levels per se. Generally yes, lower thresholds weigh towards that color if it is already present.

Perceived light is based on one of two calculations that estimate luminance, or how bright a color appears. Here is a good explanation. Green (0,255,0) is perceived as much brighter than blue (0,0,255), for example. The mod uses this to decide what colors to keep and what to ignore in interpreting flats, ceiling textures, in some cases GLDEF colors, and how colors bleed from one sector to another. The "How Red/Green/Blue" settings isolate those components in terms of brightness to allow the colored lighting to favor different colors even though this should not happen in reality.

I haven't experimented with these all that much and more or less added defaults that seem to fit Doom's red/brown color scheme. However, it can create interesting effects. I've considered "preset lumps" that can be added by mods that might be run alongside Relighting. Maybe; I've no idea if there would be any interest in such a thing. As an example, if the How Blue slider is changed to 128 E1M1 looks like this. 8-) Essentially this puts more weight on blue, and blue is perceived as a darker and perhaps more claustrophobic color. The algorithm looks at the presets when reading flats and says "Oh this blue texture is a keeper, so I'll apply that color in this sector." If that makes sense.

I'd have to look at the code to be sure of the extent, but this perceived brightness also contributes to sector lighting, dynamic light intensity, and other color-related issues. I'm not a photographer or colorist or anything like that, and my apologies if I've stated all this poorly. I've tried to apply these ideas as I understand them, and I welcome anyone with any knowledge of color science to weigh in.

Hope that helps. :)
User avatar
Dan_The_Noob
Posts: 872
Joined: Tue May 07, 2019 12:24 pm
Graphics Processor: nVidia with Vulkan support
Contact:

Re: Relighting v4.0162b - compatibility and more pitched shadows

Post by Dan_The_Noob »

you could look into implementing the tooltips addon, if you want to add descriptions to each thing.
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.0162b - compatibility and more pitched shadows

Post by Hey Doomer_ »

Dan_The_Noob wrote: Tue May 16, 2023 9:06 pm you could look into implementing the tooltips addon, if you want to add descriptions to each thing.
I saw that and it's cool. I hesitate because reading a video game is a bit like watching an action movie with subtitles. Another idea I've had is to have presets for each of the submenus that let the user see what the options do. Kind of like my example above with the "How Blue" option. Thus rather than create general presets there would be presets for sets of options...
:idea:

Pondering that.
User avatar
Dan_The_Noob
Posts: 872
Joined: Tue May 07, 2019 12:24 pm
Graphics Processor: nVidia with Vulkan support
Contact:

Re: Relighting v4.0162b - compatibility and more pitched shadows

Post by Dan_The_Noob »

Hey Doomer_ wrote: Wed May 17, 2023 4:51 pm
Dan_The_Noob wrote: Tue May 16, 2023 9:06 pm you could look into implementing the tooltips addon, if you want to add descriptions to each thing.
I saw that and it's cool. I hesitate because reading a video game is a bit like watching an action movie with subtitles. Another idea I've had is to have presets for each of the submenus that let the user see what the options do. Kind of like my example above with the "How Blue" option. Thus rather than create general presets there would be presets for sets of options...
:idea:

Pondering that.
you could summarise it down to the basics rather than the detailed explanations.

like "distance before a shadow isn't rendered" or "more/less <blue/green/red> is kept from texture lighting" etc.
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.0162b - compatibility and more pitched shadows

Post by Hey Doomer_ »

WIWO 4.0163b - improved menus

After looking at a few solutions and the GZDoom source I decided on a very basic implementation of tooltips that allows more control over color, size, font, number of lines, etc. Example class for submenu:

Code: Select all

class relighting_sector_lights_Menu : OptionMenu
{
	static const string tips[] =
	{
		"Adds sector based light sources",
		"Smallest sector area for a light source (increase to limit sector light sources, adj @ runtime)",
		"Largest sector area for a light source (decrease to limit sector light sources)",
		"Minimum sector light to allow a light source (color is based on GLDEF if available)",
		"Controls the size of dynamic lights attached to the light source",
		"Controls how the light source bakes textures and how sprite shadows react"
	};
	override void Init(Menu parent, OptionMenuDescriptor desc)
	{
		super.Init(parent, desc);
	}
	override void Drawer()
	{
		super.Drawer();
		string tip = tips[mDesc.mSelectedItem];
		let ofont = OptionFont();
		Screen.DrawText(ofont, Font.CR_WHITE, (Screen.GetWidth() / 2) - ((ofont.StringWidth(tip) / 2 * CleanXfac_1 / 2) * 2), 
			ofont.GetHeight() * CleanYfac_1 * (tips.Size() + 3), tip, DTA_ScaleX, 2.0, DTA_ScaleY, 2.0);
	}
}
This doesn't work for a GZDoom scrolling list of options, but then it's not intended as a universal solution, and the Relighting menus are deliberately short. I also could be missing something obvious in this minimal implementation, as I've just started working on this. Considering adding submenu presets as well.
User avatar
MsrSgtShooterPerson
Posts: 50
Joined: Thu Jan 02, 2020 1:59 am
Location: Lost in the procedural infinite hells and I'm fine with that.
Contact:

Re: Relighting v4.0162b - compatibility and more pitched shadows

Post by MsrSgtShooterPerson »

Thank you very much for the in-depth explanations! I'm still playing around a bit with the sliders but I can confidently say I'm getting more cohesive results so far. The article on Luminance actually helps quite a bit too. I feel I can understand the sliders better and I think I'm bringing my config to a place I like. :o

Regarding the sky tintage and stuff, I was finally able to get it to work on my end but I had to do something weird (screenshots below)

https://imgur.com/a/AUZyXJ7

I continued to get the brownish sky tint so I tried something odd to my IWAD to isolate the issue - I ended up deleting the vanilla sky textures because GZDoom seems to somehow prioritize reading it script-wise over the ones referenced in the MAPINFO. In the second picture, I finally got the sector colors from the sky.

I'm not sure if there's a fix I can recommend on that note though I do feel modifying the IWAD isn't the best solution. :o
cortes2k
Posts: 36
Joined: Mon May 15, 2023 12:13 am
Preferred Pronouns: He/Him
Operating System Version (Optional): Windows 10
Graphics Processor: ATI/AMD (Modern GZDoom)

Re: Relighting v4.0162b - compatibility and more pitched shadows

Post by cortes2k »

What's up Hey Doomer.

Thank you for all your hard work and effort on your Relighting 4 project. I've been using version 3.31b for a long time and have really enjoyed playing Doom with all that new look. I have followed project 4 since version 4.0147 and I have seen many differences with the previous version.

I have also waited a long time for the implementation of the textures with light and finally they are already in the latest versions, only I have seen that many lights are missing in many textures, such as ceiling lamps and grids.

I've been wondering if I'm configuring it wrong or if I have a version of Doom that isn't compatible, or if you just didn't consider putting lights on all the lamp or spotlight textures.

Thank you very much for this project, I am enjoying it a lot.

keep up the good work.

cheers

left, relighting 4, right relighting 3

[imgur]https://i.imgur.com/8BvKHlJ.jpeg[/imgur]

[imgur]https://i.imgur.com/mQmSUu7.jpeg[/imgur]

[imgur]https://i.imgur.com/nfcewx3.jpeg[/imgur]

[imgur]https://i.imgur.com/1aw76cM.jpeg[/imgur]
Last edited by cortes2k on Sat May 20, 2023 11:34 pm, edited 2 times in total.
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.0162b - compatibility and more pitched shadows

Post by Hey Doomer_ »

MsrSgtShooterPerson wrote: Sat May 20, 2023 9:12 pm Thank you very much for the in-depth explanations! I'm still playing around a bit with the sliders but I can confidently say I'm getting more cohesive results so far. The article on Luminance actually helps quite a bit too. I feel I can understand the sliders better and I think I'm bringing my config to a place I like. :o

Regarding the sky tintage and stuff, I was finally able to get it to work on my end but I had to do something weird (screenshots below)

https://imgur.com/a/AUZyXJ7

I continued to get the brownish sky tint so I tried something odd to my IWAD to isolate the issue - I ended up deleting the vanilla sky textures because GZDoom seems to somehow prioritize reading it script-wise over the ones referenced in the MAPINFO. In the second picture, I finally got the sector colors from the sky.

I'm not sure if there's a fix I can recommend on that note though I do feel modifying the IWAD isn't the best solution. :o
Thanks! Great to hear! Would you mind sharing your config? I'd love to try it out. That goes for anyone who has found a sweet spot in the settings.

I'm adding basic tooltips and presets to the next version. Thus far presets for each submenu are "None," "Reset to Defaults," and "Performance," but I'd like to add other settings while I'm overhauling menus.

I did look at sky boxes briefly but completely overlooked MAPINFO. :oops: I'll check that out!! Thanks. One doesn't want to modify an IWAD.

Edit

Hmm...

Editing GZDoom's MAPINFO works. Here is E1M1 with the second episode sky, for example.

This editing trick works with Wadsmoosh pk3 files, also. Here is E1M1 with the third episode sky.

This also works if MAPINFO is loaded in a mod. I've added this to the Relighting MAPINFO as a test, and it works same as above:

Code: Select all

map E1M1 lookup "HUSTR_E1M1"
{
	levelnum = 1
	next = "E1M2"
	secretnext = "E1M10"
	titlepatch = "WILV00"
	sky1 = "SKY3"
	cluster = 1
	par = 30
	music = "$MUSIC_E1M1"
	ExitPic = "$IN_EPI1"
	Author = "$WS_AU_ROMERO"
}
It seems like the Level information for the map is loaded from the last MAPINFO definition.

Note that Relighting expects a Doom texture lump at present and won't find sky patches (TNT and Plutonia), dual skies (Hexen), or sky box textures.
Last edited by Hey Doomer_ on Sun May 21, 2023 11:33 am, edited 2 times in total.
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.0162b - compatibility and more pitched shadows

Post by Hey Doomer_ »

cortes2k wrote: Sat May 20, 2023 11:29 pm What's up Hey Doomer.

Thank you for all your hard work and effort on your Relighting 4 project. I've been using version 3.31b for a long time and have really enjoyed playing Doom with all that new look. I have followed project 4 since version 4.0147 and I have seen many differences with the previous version.

I have also waited a long time for the implementation of the textures with light and finally they are already in the latest versions, only I have seen that many lights are missing in many textures, such as ceiling lamps and grids.

I've been wondering if I'm configuring it wrong or if I have a version of Doom that isn't compatible, or if you just didn't consider putting lights on all the lamp or spotlight textures.

Thank you very much for this project, I am enjoying it a lot.

keep up the good work.

cheers
Wow. Love the screenshots and many thanks for your kind words. I'm glad you enjoy the mod!!

Just a word on the history of this.

The previous version of Relighting was based on the idea of eliminating all lighting and starting from scratch based on textures and flats alone. This turned out to be extremely inefficient and far from universal, pretty aside. I was curious after looking at Nash's shadow mod if it was possible to expand on this idea for sprite shadows, since in general GZDoom's shadows all look the same, point in the same direction, and are completely useless for non-monster items. After a quick Discord demo this got me thinking that this could work for anything running on GZDoom using sprites, and that got me wondering if Relighting could be remade as a universal enhancement mod.

As I've developed this it seems that the color, light baking, and shadows are key components. These depend on light placement, and down that rabbit hole I discovered that most of the calculations in the previous version were based on incorrect assumptions about Doom mapping. (Doom sectors are not stitched corrected for one thing.) Those issues have been corrected and light sources are placed correctly. In this version I also added a basic color analysis of flats and sky textures based on the palette used, something that was done manually in text lumps in the previous version. Flats are tiled and much easier to read, note. The only exceptions that have been added are light specials that I keep intact and flashlight names for compatibility. This has all been to try to make the mod universal and work with Doom, Heretic, Hexen, Strife, and anything else that runs on the engine.

Modders have done incredible work in creating new sprites, new textures, and maps far beyond what the original Id team imagined, and I've tried to work within that and the boundaries of GZDoom with this version. My intention is to honor and respect the hard work and vision of the author creating - with far too many hours - a work of love for game that is loved. I have honestly tried to preserve that with this version, intended to be an "enhancement" mod.

Having bloviated, I am still on the effing fence about specific exceptions for some textures in the original Doom. :lol:
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.0162b - compatibility and more pitched shadows

Post by Hey Doomer_ »

Progress v4.0163b

Code: Select all

v4.0163b

5/19 - adjusted "other" shadows to exclude non-missile, non-player, non-monster, non-inventory
5/20 - added menu tooltips & presets
5/20 - added decorative light sources CVar flag
5/21 - destroy hd_light sources not a lightsource && not defined in GLDEF (performance)
Adding tooltips and presets to menus has uncovered a few interesting things.

For example, hd_lights that are added to the shadow thinkers were added to monsters regardless of lights defined in GLDEF. They are now destroyed if the hd_light isn't linked to a GLDEF color or an actual light source. This is a big performance boost depending on the game. I assume mods exist that have GLDEF entries for monsters; if you're playing Doom you can safely turn monster lights off in v4.0162b for an fps boost. This may also reduce shadow flickering. This code was some of the earliest added, and I've just never really looked at it again until now. (One of those "Wait... that does what?" :) )

Testing. Release "soon."
User avatar
Dan_The_Noob
Posts: 872
Joined: Tue May 07, 2019 12:24 pm
Graphics Processor: nVidia with Vulkan support
Contact:

Re: Relighting v4.0162b - compatibility and more pitched shadows

Post by Dan_The_Noob »

excited for the tooltips, i have a rough idea what most things did. but some eluded me.
Skrell
Posts: 351
Joined: Mon Mar 25, 2013 11:47 am

Re: Relighting v4.0162b - compatibility and more pitched shadows

Post by Skrell »

Hey Doomer_ wrote: Sun May 21, 2023 3:57 pm Progress v4.0163b

Code: Select all

v4.0163b

5/19 - adjusted "other" shadows to exclude non-missile, non-player, non-monster, non-inventory
5/20 - added menu tooltips & presets
5/20 - added decorative light sources CVar flag
5/21 - destroy hd_light sources not a lightsource && not defined in GLDEF (performance)
Adding tooltips and presets to menus has uncovered a few interesting things.

For example, hd_lights that are added to the shadow thinkers were added to monsters regardless of lights defined in GLDEF. They are now destroyed if the hd_light isn't linked to a GLDEF color or an actual light source. This is a big performance boost depending on the game. I assume mods exist that have GLDEF entries for monsters; if you're playing Doom you can safely turn monster lights off in v4.0162b for an fps boost. This may also reduce shadow flickering. This code was some of the earliest added, and I've just never really looked at it again until now. (One of those "Wait... that does what?" :) )

Testing. Release "soon."
And this release will allow us to turn off corpse shadows too?
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.0162b - compatibility and more pitched shadows

Post by Hey Doomer_ »

Skrell wrote: Mon May 22, 2023 4:04 pm
And this release will allow us to turn off corpse shadows too?
Yep.
Post Reply

Return to “Gameplay Mods”