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
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.0147b - fog / STYLE_Subtract hotfix

Post by Hey Doomer_ »

Hey Doomer_ wrote: Wed Dec 14, 2022 4:07 am [*] Materials - while ZScript can't create normal maps etc. ad hoc, an external utility can. It's feasible to write something that creates material assets for all textures and flats (too bad that doesn't include sprites, an inexplicable GZDoom limitation).
Hmm. Possible, note the STARTAN textures: https://i.postimg.cc/6QzNZ8RJ/auto-parallax-POC.gif

POC to at least extract / create normal map / create displacement map / add to GLDEF and use a modified shader. It would take a little to automate, but it is possible. Not sure it's worth it or that it would necessarily enhance maps. :|
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.0147b - fog / STYLE_Subtract hotfix

Post by Hey Doomer_ »

WIWO

https://i.postimg.cc/fykH7m7R/subtractive-poc.png

I'm experimenting with adding tiny subtractive lights to darkened side def textures in certain areas. Subtractive lights generally just make everything darker, but I wonder if they can be used to enhance certain areas of shadow, since there is no true directional lighting.

Another example:

https://i.postimg.cc/52Z6fVK7/subtractive-poc2.png

In both examples there are small subtractive lights on textures that are baked to a negative light value. It does make levels selectively darker, but the idea is to enhance the shadows that the baked lighting creates in uniformly lit sectors. Think of this as a counter to the "positive" lighting in a sector.
User avatar
Dan_The_Noob
Posts: 880
Joined: Tue May 07, 2019 12:24 pm
Graphics Processor: nVidia with Vulkan support

Re: Relighting v4.0147b - fog / STYLE_Subtract hotfix

Post by Dan_The_Noob »

i'm not sure subtractive lights would work correctly in the context of light sources and flashlights etc.
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.0147b - fog / STYLE_Subtract hotfix

Post by Hey Doomer_ »

Dan_The_Noob wrote: Sat Dec 17, 2022 5:12 pm i'm not sure subtractive lights would work correctly in the context of light sources and flashlights etc.
I wondered that as well, but they work fine as sector lights. My struggle is finding anything out of those two screenshots where it's worthwhile. This seems like a niche effect with a small performance cost. Interesting I think but not worth it.
clumsyd
Posts: 4
Joined: Thu Nov 24, 2022 1:19 pm
Operating System Version (Optional): Windows 10
Graphics Processor: nVidia with Vulkan support

Re: Relighting v4.0147b - fog / STYLE_Subtract hotfix

Post by clumsyd »

Is there a specific preferred way of launching this? A recommended set of settings and some additional files, perhaps? Things look... peculiar in fresh-started GZDoom on default settings.
Also this circle around the sky in IWADS. A
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.0147b - fog / STYLE_Subtract hotfix

Post by Hey Doomer_ »

clumsyd wrote: Sun Dec 18, 2022 3:38 am Is there a specific preferred way of launching this? A recommended set of settings and some additional files, perhaps? Things look... peculiar in fresh-started GZDoom on default settings.
Also this circle around the sky in IWADS. A
Interesting. Peculiar, how?

For all testing I use ZDL with GZDoom's lights and brightmaps and flashlight plus plus loaded (sometime parallax textures). Sector mode is "Dark." It probably looks better with a lights.pk3 added, since that's where decoration lights come from, but it doesn't contain any GLDEF information related to dynamic lights.

In Settings there are many options to change color, lighting, and shader options. The only specifics in the mod are known animated textures from the wiki, lighting specials, action specials, and a few actors in common use or actors that cause problems from other mods. Everything else is read from loaded assets, including flats, palettes and GLDEF lumps. (Still thinking about wall textures...)

Relighting doesn't require any other files, and generally load order doesn't matter as it reads all loaded assets. The order of load may affect some colors if there are multiple GLDEF definitions for the same item; it does a Find() it takes the first definition.

I have not seen that circle and offhand don't have an idea what causes that. I need more details.
clumsyd
Posts: 4
Joined: Thu Nov 24, 2022 1:19 pm
Operating System Version (Optional): Windows 10
Graphics Processor: nVidia with Vulkan support

Re: Relighting v4.0147b - fog / STYLE_Subtract hotfix

Post by clumsyd »

I only noticed that white circle on red, hell-themed sky textures, like late TNT and late Doom 2. It disappears upon changing "Tonemap mode" in display options from "Off" to any other option. It's not present without the mod, and it disappears for a moment every time the pallette is changed, like on item pickups and taking damage.
There are just some things that weirded me out:
- the sprite shadows. It's funny how the flames of a torch can cast a shadow, and the shadows float in the air pretty often. I guess I better just disable them on my end. screenshot
- Some of the sectors that are supposed to be reflective are not reflective. screenshot 1, screenshot 2. Could be related to tags and actions assigned to such sectors.
- a single stray projectile (or something else I missed?) can illuminate a huge outdoor section for a moment. screenshot 1 (illuminated), screenshot 2 (not illuminated)
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.0147b - fog / STYLE_Subtract hotfix

Post by Hey Doomer_ »

clumsyd wrote: Sun Dec 18, 2022 11:59 am I only noticed that white circle on red, hell-themed sky textures, like late TNT and late Doom 2. It disappears upon changing "Tonemap mode" in display options from "Off" to any other option. It's not present without the mod, and it disappears for a moment every time the pallette is changed, like on item pickups and taking damage.
There are just some things that weirded me out:
- the sprite shadows. It's funny how the flames of a torch can cast a shadow, and the shadows float in the air pretty often. I guess I better just disable them on my end. screenshot
- Some of the sectors that are supposed to be reflective are not reflective. screenshot 1, screenshot 2. Could be related to tags and actions assigned to such sectors.
- a single stray projectile (or something else I missed?) can illuminate a huge outdoor section for a moment. screenshot 1 (illuminated), screenshot 2 (not illuminated)
Very interesting. Thanks for the list. Let's see...

Shaders often conflict, which probably is causing the white line. It's possible that it's the color bleeding, which can be turned off in Settings (set to 0).

Sprite shadows are sprites and can't be clipped; they are simple FLATSPRITE and WALLSPRITE actors. They can be turned off selectively on the menu. I haven't yet looked at showing these depending on the geometry except for Line.ML_TWOSIDED with different plane heights. I also haven't programmed any specifics for those that are animated, although that's an idea. This can also be changed by the Min and Max Sprite Size settings, although this doesn't check the entire DECORATE or Actor definition.

Reflections can also be turned off / turned down / adjusted in Settings. This is based on the perceived light of the flat color per the last palette loaded, which is what GZDoom uses. Indeed the entire look of the mod can be changed by tweaking color settings. I've picked settings that show what it does more than anything.

Missiles illuminating sectors can be turned off as well on Settings under Dynamic Sectors. This isn't a bug but intended behavior to use Doom's sector lighting and the color of the missile. I get that this isn't everyone's thing, but it can be turned off. At this time that option also turns off the doorway light switches.

Again just about everything and anything this mod does can be tweaked, dialed back, or turned off in the settings. There aren't instructions yet on what all of these do.

Hope that helps!
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.0147b - fog / STYLE_Subtract hotfix

Post by Hey Doomer_ »

WIWO for v4.0148b

Incremental update with bug fixes and more accurate calculations.

Code: Select all

v4.0148b

12/14 - corrected float/int comparison in shader (BUG)
12/17 - moved constant definitions outside of sidedef lighting loop (optimize)
12/18 - corrected inverse square calculation
12/18 - removed calculation for 2-sided lines on same planes
12/19 - corrected lighting scale for volume, brightness
There are optimizations to the code that may shorten loading times depending on the number of lines. I also corrected lighting calculations (they were scaled too high) and corrected the light source scales e.g. less light is emitted from a smaller but brighter sector.

Unfortunately tier side lights are not exposed in ZScript, so this is imperfect. I haven't changed the wall shadow code, which surprisingly is not invoked that often. There is generally more light in the game than one would think (even in Doom 2) but it's the level geometry that matters most. There are other variables such as when lighting is polled for a lighting special sector when the baking takes place. Trying to reach a compromise between realism and speed (leaning toward speed). 8-)

Should have a release tomorrow.
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.0148b - improved lighting

Post by Hey Doomer_ »

Just posted v4.0148b


This is an incremental update that corrects a few bugs but also adds light in some areas while decreasing the size of many dynamic lights. Static lighting attached to objects has been set to light other actors, which is an improvement, and I've tweaked the GLDEF colors a little. Most of these changes are subtle.

What doesn't work: 3d shadow slopes, per tier lighting on side def textures (not exposed in ZScript). I've made some allowances for the latter, but AFAIK this can only be parsed in UDMF formatted maps.

What I found in rabbit holes and abandoned: Specific lighting for specific textures; this either happens too infrequently or doesn't look that impressive. Subtractive lighting in shadowed areas: same comment. Tweaking lighting on textures depending on color of light, placement of light, size of light, etc; this all sounds good but has very little effect because of the rapid dissipation of any light. Light from outside going inside is generally a little stronger, and that's about it.

You'll find that blue GLDEF colors are tinted a little brighter while others are tinted a little darker; I like the way this looks. This can be changed under "Other Shadows" and "GLDEF Lights."

No changes at all to the sprite shadow code. Almost all of these changes tweak the baked texture lighting.


Many Thanks for your enthusiasm and support!
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.0148b - improved lighting

Post by Hey Doomer_ »

There's a Mod DB comment that this crashes Brutal Doom Platinum, and sure enough that is true. It looks like the caster is gone in some cases after the thinker routine in the hdshadow Tick() function. I am testing a fix for this. For those interested add this after the if (think) block:

Code: Select all

		if (!caster)
		{
			if (caster_type == "MISSILE")
			{
				Event.missile_shadows--;
			}
			else if (caster_type == "MONSTER")
			{
				Event.monster_shadows--;
			}
			else
			{
				Event.other_shadows--;
			}
			Destroy();
			return;
		}
This is the same block as the top of the function. Everywhere else (I think) there are checks for master or caster things, but this is the only dependent thinker.

Also working on adding other checks for items that will not cast shadows or lights that will improve performance.
User avatar
Keldyn
Posts: 2
Joined: Tue Nov 15, 2022 12:32 am
Operating System Version (Optional): Windows 11
Graphics Processor: ATI/AMD with Vulkan/Metal Support

Re: Relighting v4.0148b - improved lighting

Post by Keldyn »

I just wanted to thank you for the work you are doing on this. I acknowledge what an immense task it must be and you should know we are grateful. It has made a tremendous difference to the look and feel of DOOM and it has honestly, never looked better. Cheers!
cosmos10040
Posts: 200
Joined: Mon Dec 20, 2021 6:16 am
Graphics Processor: ATI/AMD (Modern GZDoom)

Re: Relighting v4.0148b - improved lighting

Post by cosmos10040 »

I agree this is one of the best graphic addon mods I have seen along with some others. Works great even on delta touch. Only issue I get are huge maps( long loads, fps drop), probably loading everything at once. Is there a way to maybe change the settings for big maps to not load everything unless within a certain range? Or maybe there is already a good tweak, what are the recommended settings for big maps?
User avatar
Dan_The_Noob
Posts: 880
Joined: Tue May 07, 2019 12:24 pm
Graphics Processor: nVidia with Vulkan support

Re: Relighting v4.0148b - improved lighting

Post by Dan_The_Noob »

cosmos10040 wrote: Mon Dec 26, 2022 10:24 am what are the recommended settings for big maps?
Toward the bottom there's a "min" and "max" setting, i think increasing "min" is the one that helps with bigger maps. I think mine is at around 250-260
Ryantch
Posts: 1
Joined: Tue Dec 27, 2022 6:22 pm
Preferred Pronouns: No Preference
Operating System Version (Optional): Windows 11
Graphics Processor: nVidia with Vulkan support

Re: Relighting v4.0148b - improved lighting

Post by Ryantch »

This looks amazing, but when playing brutal doom; the destructible lights don't *actually* go away, there's just an invisible light source giving off light in the area. It usually happens when I have solid shadows turned on. [which makes the game look better, for sure.] I tried to see if it was dynamic sectors or ghost lights but those didn't effect it. Just kinda bothers me a lil bit but it's definitely not a big deal.
Keep up the good work!

Return to “Gameplay Mods”