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

Relighting v4.0165b - blurry shadows w/ rlassets

Post by Hey Doomer_ »

relighting.png

Introducing new and improved Relighting.
  • Any mod.
  • Any map.
  • Any game.
Boring Explanation: The original idea of Relighting was simple: take the game without lighting and light according to textures and flats. This led to performance issues and a struggle to find light sources in the original game. Worse, it only worked with Doom. Worse still, it didn't really give any depth to the world; added dynamic lights were largely static. By the time a ray casting port was released it seemed this project was obsolete. But not every rig can do ray casting. And some people seemed to appreciate the effort. Many thanks.

New stuff: This version fixes a lot of things. Dynamic sprite floor and wall shadows are added, and dynamic lights are sparingly applied for added shadow maps. It still has reflections, colored lights, and dynamic sector lighting. There are no configuration text files, so this works with anything. Performance is greatly improved and should not be an issue on any rig.

More stuff: This version also has baked sidedef lighting that adds a surprising amount of depth as seen here independent of dynamic lighting at no performance cost. (Note: tier sidedef lighting isn't exposed in ZScript. Still looks cool.)

Be aware that this is in beta. I have fixed many bugs, but doubtless there are things that do not work. There are things that could be done better. Also be aware the sprite "shadows" are sprites. They are flat cutouts that will stick out over edges, because they can't be clipped. Can't be helped. Also be aware that sizing is approximate for performance reasons; I have written this to make choices based on minimal calculations with speed in mind. (It still looks really cool.)

If you are having a problem running this, tweak Performance Settings. Anything and everything can be turned off or dialed back. Let me know what you think!



relighting v4.0164b.pk3
New Version:
relighting v4.0165b.pk3
announcement

Changelog
Spoiler:
You do not have the required permissions to view the files attached to this post.
Last edited by Hey Doomer_ on Tue Aug 22, 2023 2:43 pm, edited 47 times in total.
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.0b

Post by generic name guy »

This is fucking insane, i literally do not have any other words to describe this.
User avatar
BROS_ETT_311
Posts: 219
Joined: Fri Nov 03, 2017 6:05 pm

Re: Relighting v4.0b

Post by BROS_ETT_311 »

It's here :shock:

Edit - Performance has definitely been improved somehow, despite the newly added bells and whistles...phenomenal work! That said, I just came across an abort when attempting to load this up with this map: https://www.moddb.com/mods/honte-remastered (HontE). Thought I'd report it here for your records (attached in text file).
You do not have the required permissions to view the files attached to this post.
Last edited by BROS_ETT_311 on Mon Oct 31, 2022 5:13 pm, edited 1 time in total.
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.0b

Post by Hey Doomer_ »

BROS_ETT_311 wrote: Mon Oct 31, 2022 3:01 pm It's here :shock:

Edit - Performance has definitely been improved somehow, despite the newly added bells and whistles...phenomenal work! That said, I just cam across an abort when attempting to load this up with this map: https://www.moddb.com/mods/honte-remastered (HontE). Thought I'd report it here for your records (attached in text file).
Thanks, I'll check that out!

Edit
OK I've figured this out; this is the lightswitch code that expects 3 sectors if this is a door. My guess is this is some special sector with a zero height. I'll have this fixed. In the meantime you can edit the file zscript\hd_actors.zs yourself. Add missing text below at line 36, which should fix it:

Code: Select all

			if (lin.Flags & Line.ML_TWOSIDED)
			{
				if (lin.BackSector != CurSector) sec.Push(lin.BackSector);
				if (lin.FrontSector != CurSector) sec.Push(lin.FrontSector);
			}
		}
		if (sec.Size() < 3)
		{
			Destroy();
			return;
		}

		int light = -1;
		int dark = 256;
		int darkest = -1;
Last edited by Hey Doomer_ on Tue Nov 01, 2022 1:43 am, edited 3 times in total.
Anim8
Posts: 18
Joined: Sun Dec 26, 2021 11:58 pm

Re: Relighting v4.0b

Post by Anim8 »

Does feel more dynamic vs the 3.x version, in particular with the players own shadow which is nice.

One thing I noticed was the shadows on v4 look a bit odd when used with voxels, as I had Voxel Doom v. 1.0 loaded. The shadow ends up overlapping on top/above.

Screenshot:
https://u.cubeupload.com/Anim8/shadowvox.jpg

Voxel Doom:
https://www.moddb.com/mods/doom-voxel-project
User avatar
Dan_The_Noob
Posts: 878
Joined: Tue May 07, 2019 12:24 pm
Graphics Processor: nVidia with Vulkan support

Re: Relighting v4.0b

Post by Dan_The_Noob »

Did this remove the map lighting stuff or just reduce it quite a bit? also the shadows dont seem to work with flashlight++ as far as i can tell. also the player shadow just randomly appears/disappears as it pleases.

using e1m1 on Doom1 to try it.

also, default settings gives armor bonuses and barrels this really bright white dynamic light.

--EDIT--
I figured out a few things.

the "Perceived Light" setting should be more like 100-130
the "*Min" slider being moved down to a 70-80 range
creates a nice moody lighting setup.
Last edited by Dan_The_Noob on Tue Nov 01, 2022 1:32 am, edited 1 time in total.
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.0b

Post by Hey Doomer_ »

Anim8 wrote: Mon Oct 31, 2022 9:12 pm Does feel more dynamic vs the 3.x version, in particular with the players own shadow which is nice.

One thing I noticed was the shadows on v4 look a bit odd when used with voxels, as I had Voxel Doom v. 1.0 loaded. The shadow ends up overlapping on top/above.

Screenshot:
https://u.cubeupload.com/Anim8/shadowvox.jpg

Voxel Doom:
https://www.moddb.com/mods/doom-voxel-project
Thanks, I'll check that out!

Edit
I've checked this out with the voxel mod. Voxels are incompatible with FLATSPRITE, because they are not sprites - they replace sprite pointers. But I'm just guessing on this. Perhaps someone who knows the answer will chime in. I'll make allowances for voxels, but it means anything that's a voxel won't have a sprite shadow. :roll: I suspect there is not a workaround at this time; the voxel cvar is all or nothing.
Last edited by Hey Doomer_ on Tue Nov 01, 2022 2:48 am, edited 3 times in total.
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.0b

Post by Hey Doomer_ »

Dan_The_Noob wrote: Tue Nov 01, 2022 1:14 am Did this remove the map lighting stuff or just reduce it quite a bit? also the shadows dont seem to work with flashlight++ as far as i can tell. also the player shadow just randomly appears/disappears as it pleases.

using e1m1 on Doom1 to try it.

also, default settings gives armor bonuses and barrels this really bright white dynamic light.
For now texture lights have all been removed for compatibility purposes.

It should work with the flashlight++ mod. Most likely there are other light sources, but I'll check that out. Thanks!

Object lights can be dialed down or turned off in Performance Settings.
User avatar
Dan_The_Noob
Posts: 878
Joined: Tue May 07, 2019 12:24 pm
Graphics Processor: nVidia with Vulkan support

Re: Relighting v4.0b

Post by Dan_The_Noob »

Hey Doomer_ wrote: Tue Nov 01, 2022 1:36 am

For now texture lights have all been removed for compatibility purposes.

It should work with the flashlight++ mod. Most likely there are other light sources, but I'll check that out. Thanks!

Object lights can be dialed down or turned off in Performance Settings.
i fiddled with the cosmetic settings a little and got it somewhere closer to what i was after, im not so worried about the shadows part. I'm mostly looking for smoother light transitions and lighting based off of ceilings/floors. so does the job.

is it possible to have lighting adjust based on brightmaps in any way too?
currently my brightmaps are uncoloured, but i might update them if they affected lighting somehow.

--EDIT--
getting this error and sometimes an error about lightswitches.

Code: Select all

Called from hd_postprocessor.Apply at relighting v4.0b.pk3:zscript/hd_postprocessor.zs, line 29
(doesn't let me start the game up with relighting after getting this error) it popped up when turning off reflections
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.0b

Post by Hey Doomer_ »

Dan_The_Noob wrote: Tue Nov 01, 2022 1:49 am
Hey Doomer_ wrote: Tue Nov 01, 2022 1:36 am

For now texture lights have all been removed for compatibility purposes.

It should work with the flashlight++ mod. Most likely there are other light sources, but I'll check that out. Thanks!

Object lights can be dialed down or turned off in Performance Settings.
i fiddled with the cosmetic settings a little and got it somewhere closer to what i was after, im not so worried about the shadows part. I'm mostly looking for smoother light transitions and lighting based off of ceilings/floors. so does the job.

is it possible to have lighting adjust based on brightmaps in any way too?
currently my brightmaps are uncoloured, but i might update them if they affected lighting somehow.

--EDIT--
getting this error and sometimes an error about lightswitches.

Code: Select all

Called from hd_postprocessor.Apply at relighting v4.0b.pk3:zscript/hd_postprocessor.zs, line 29
(doesn't let me start the game up with relighting after getting this error) it popped up when turning off reflections

My bad. The hd_postprocessor code creates an array in the reflections code that is needed below. If you comment out like so it will work 8-)

Code: Select all

//		if (rl_CVar.rl_floor_reflections.GetBool())
//		{
			for(int i = 0; i < Level.Sectors.Size(); i++)
			{
				Sector sec = Level.Sectors[i];
				int tag = 12500 + int(sec.GetTexture(FLOOR));
				AddSectorTag(i, tag);
				limits.Push(int(sec.LightLevel * rl_CVar.rl_dim_min.GetFloat()));
			}
//		}
What error are you getting regarding light switches?

Haven't considered brightmaps but that is an interesting suggestion! I'll check into that.
IDDQD_1337
Posts: 7
Joined: Sun Dec 17, 2017 9:16 am
Operating System Version (Optional): Windows 11
Graphics Processor: nVidia with Vulkan support
Location: Russian Federation

Re: Relighting v4.0b

Post by IDDQD_1337 »

It's good that the mod is back in development and the author is alive, but what happened to you, did you disappear for a long time?
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.0b

Post by generic name guy »

IDDQD_1337 wrote: Tue Nov 01, 2022 6:41 am It's good that the mod is back in development and the author is alive, but what happened to you, did you disappear for a long time?
Considering the fact they're back on a new account, probably just lost the old one
User avatar
mamaluigisbagel
Posts: 524
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 v4.0b

Post by mamaluigisbagel »

I noticed as soon as I started Vanguard, the sky texture was missing, and turning off Relighting restored it.

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.0b

Post by Hey Doomer_ »

mamaluigisbagel wrote: Tue Nov 01, 2022 12:16 pm I noticed as soon as I started Vanguard, the sky texture was missing, and turning off Relighting restored it.

I'll check it out. What mod is that?
User avatar
mamaluigisbagel
Posts: 524
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 v4.0b

Post by mamaluigisbagel »

I was using Lt. Typhon, and the map as I said is Vanguard.

Return to “Gameplay Mods”