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: 400
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.0160b - texture lights

Post by Hey Doomer_ »

tuintje wrote: Thu Apr 27, 2023 10:27 am i noticed with voxel mod from cheello the mod produces artifacts around the player any fix for this?
That's a bug caused when I moved the code from WorldSpawned to PlayerSpawned to make the inventory item persistent, but there were other issues as well. I should have that fixed in the next update likely in a few days. Here's the new block in PlayerSpawned() you can try in the meantime where I've added an if statement for the CVar check. That should let you turn off player shadows in Settings and run Relighting with Voxel Doom.

Code: Select all

		if (rl_Cvar.rl_player_shadows.GetBool())
		{
			players[consoleplayer].mo.A_GiveInventory("hd_shade", 1);
			Actor ptr = players[consoleplayer].mo.FindInventory("hd_shade");
			if (ptr)
			{
				ptr.PostBeginPlay();
			}
		}
User avatar
Hey Doomer_
Posts: 400
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.0160b - texture lights

Post by Hey Doomer_ »

Progress v4.0161b

Code: Select all

v4.0161b

4/23 - fixed skewness for sectorless maps (bug fix)
4/24 - added hack in shadow PostBeginPlay() for player sprite in voxel array
4/24 - added lifespan variable to hd_light actor (performance)
4/25 - added check for rl_Cvar.rl_player_shadows.GetBool() in PlayerSpawned() (bug fix)
4/28 - change ghostmissile fail to sector light level

The ghostmissile actor fail chance was 50 when of course this is n in 256 change. Obvious. :roll:

I tried a few ideas with voxels without any success and have been cleaning up bugs here and there. I tried recalculating the average light level to omit zero light level sectors, but it seems to integrate better with those sectors. I did add this to the texture lighting block:

Code: Select all

								if (back_light *  rl_Cvar.rl_texture_light_factor.GetFloat() < indoor_light)
								{
									two_sided++;
									back_light += back.LightLevel;
								}
This should prevent overly bright sectors from causing texture lights, although that depends on the map design. I've also noticed the big drain is the shadow thinkers. I have a few remaining ideas to try. Still testing, and I have yet to test with other games and mods. Still I don't expect this will take long and it should be worth the wait. 8-)
User avatar
Hey Doomer_
Posts: 400
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.0160b - texture lights

Post by Hey Doomer_ »

Just a note on texture lighting factor

default
0.75

Testing to be sure this adds light where the author intends. 8-)
Skrell
Posts: 351
Joined: Mon Mar 25, 2013 11:47 am

Re: Relighting v4.0160b - texture lights

Post by Skrell »

Hey Doomer_ wrote: Sat Apr 29, 2023 8:11 am Just a note on texture lighting factor

default
0.75

Testing to be sure this adds light where the author intends. 8-)
What was the value for the default?
User avatar
Hey Doomer_
Posts: 400
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.0160b - texture lights

Post by Hey Doomer_ »

Skrell wrote: Sat Apr 29, 2023 2:55 pm
Hey Doomer_ wrote: Sat Apr 29, 2023 8:11 am Just a note on texture lighting factor

default
0.75

Testing to be sure this adds light where the author intends. 8-)
What was the value for the default?
1.025
User avatar
Hey Doomer_
Posts: 400
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.0161b - bug fixes and improvements

Post by Hey Doomer_ »

Posted v4.0161b - bug fixes and improvements

Code: Select all

v4.0161b

4/23 - fixed skewness for sectorless maps (bug fix)
4/24 - added hack in shadow PostBeginPlay() for player sprite in voxel array
4/24 - added lifespan variable to hd_light actor (performance)
4/25 - added check for rl_Cvar.rl_player_shadows.GetBool() in PlayerSpawned() (bug fix)
4/28 - change ghostmissile fail to sector light level
4/29 - cut second shadow if > 1/4 shadow distance (performance)
Tested with Doom, Doom II, Freedoom, Heretic, Hexen, Strife, HACX, Action2, and several mods including Beautiful Doom, Brutal Doom, LiTDoom, UACultra, NEIS, Knee Deep in the ZDoom, Sigil, and various obsidian maps. A few others I don't recall. No errors or crashes encountered, but again I don't play these games. Performance is noticeably improved in some of the maps.

A significant change and performance boost is in eliminating dual shadows beyond a quarter of the shadow distance. Much of the time any dual shadows weren't noticeable beyond that distance; it eliminates many shadow actors from iterating lights and improves performance without sacrificing visuals. That may depend on the map, but in testing I probably looked at 100+ maps without anything noticeable (to a non-gamer).

Many Thanks as always for your continued support and interest! I appreciate it!!
Skrell
Posts: 351
Joined: Mon Mar 25, 2013 11:47 am

Re: Relighting v4.0161b - bug fixes and improvements

Post by Skrell »

How do you reset the settings to default? I see there is an option for it but it simply has an "on/off" state which I don't understand?
User avatar
Hey Doomer_
Posts: 400
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.0161b - bug fixes and improvements

Post by Hey Doomer_ »

Skrell wrote: Sun Apr 30, 2023 3:57 pm How do you reset the settings to default? I see there is an option for it but it simply has an "on/off" state which I don't understand?
Set to On and reload/restart.
albinobigfoot
Posts: 4
Joined: Mon Mar 23, 2020 1:10 am

Re: Relighting v4.0161b - bug fixes and improvements

Post by albinobigfoot »

Sorry if you've answered this question before, but how would I go about adding dynamic lights to mod weapons that don't have them? (e.g. muzzle flashes and projectiles)
User avatar
Enjay
 
 
Posts: 26536
Joined: Tue Jul 15, 2003 4:58 pm
Location: Scotland

Re: Relighting v4.0161b - bug fixes and improvements

Post by Enjay »

You would probably need to make a custom GLDEFS lump for that.
User avatar
Hey Doomer_
Posts: 400
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.0161b - bug fixes and improvements

Post by Hey Doomer_ »

albinobigfoot wrote: Mon May 08, 2023 5:43 pm Sorry if you've answered this question before, but how would I go about adding dynamic lights to mod weapons that don't have them? (e.g. muzzle flashes and projectiles)
That all depends. If you want Relighting to do this, then it generally adds lights to actors with sprites large enough to cast a shadow. This is most dramatic with missiles, since their dynamic light often changes shadow direction. These lights exist for the life of the object, and for very small objects may not last very long if at all. The light color is taken from average GLDEF colors associated with the actor (Relighting reads all GLDEF lumps, and the order of load can change a color if there are multiple definitions). Default color is white.

A few Settings will affect this. One is Min Sprite Size, which determines how small an object has to be to generate a shadow / light. This is also adjusted in WorldLoaded if there are too many map actors. Next are Missile Lights Size and Other Lights Size. Generally Size determines the size (or intensity) of the dynamic light, and Scale determines the effect on shadows. Defaults highlight missiles, which are both dynamic and dramatic objects. I haven't tried playing around with these to see if tiny objects can emit significant light, although I don't see why it can't be possible.

Muzzle flashes and other player sprites are drawn on the HUD and are not actors per se. These are ignored (at present) by the mod, although missiles etc. spawned by the player follow the above.

As Enjay points out you can write a custom GLDEF lump for your purpose. Since Relighting reads all GLDEF lumps, it's possible to have one lump that enhances multiple mods. I haven't tried that either.

Hope that helps! :)
User avatar
Hey Doomer_
Posts: 400
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.0161b - bug fixes and improvements

Post by Hey Doomer_ »

WIWO v.4.0162b

Code: Select all

v4.0162b

5/6 - added check for saved light level in hd_light
5/11 - added BD mod flashlight compatibility
So far the above are both BD compatibility issues.

I checked the sky color code, and with the exception of Hexen's double skies and sky patches this should be correct (checked with a random Obsidian texture). Note that these (and all colors) are read and interpreted according to perceived brightness as well as how red/green/blue threshholds in the Color Options menu. Tweaking these can lead to interesting effects. The "Color Bleeding" effect on this menu is for color bleeding from a colored to a non-colored sector, and is different from the shader option.

I don't play with these options very much in testing and in general the defaults are set to look most like vanilla. For example, changing "Perceived Light" to 100 allows more color to bleed into other sectors as seen here. As you can see the bridge is tinted from the nukage pit, and the end of the hallway is tinted from the red lighting in the tech room. It might be interesting to adjust these on the fly depending on flats, ceiling, and sky textures in a level. Maybe.
User avatar
Hey Doomer_
Posts: 400
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_ »

Posted v4.0162b - compatibility and more pitched shadows

Code: Select all

v4.0162b

5/6 - added check for saved light level in hd_light
5/11 - added BD mod flashlight compatibility
5/12 - added pitch for decorative and missile lights
5/12 - tweaked shadow lifespan
A wee update after trying a few things.

There is a bug in BD where firing the plasma rifle resets the sector light to 0. That has been fixed.

I've added compatibility for the native BD flashlight, which is controlled by inventory items only. This now works as expected.

I've added pitch for decorative and missile lights. As a missile from above fires down, all wall shadows will pitch appropriately. 8-)

I've also allowed no distance modification for shadow lifespans 1-3. Depending on your rig, this is a cosmetic/performance enhancer. I've left the default at 3, but if you see performance problems this can be increased to 4 to lengthen lifespan depending on distance from the player.

Let me know what you think!
Skrell
Posts: 351
Joined: Mon Mar 25, 2013 11:47 am

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

Post by Skrell »

Another great release! Quick question: What do I disable to completely remove corpse shadows from appearing? I thought simply disabling monster shadows would do it but I still see them? Perhaps these are gzdoom's own shadows?
User avatar
Hey Doomer_
Posts: 400
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: Sun May 14, 2023 3:44 pm Another great release! Quick question: What do I disable to completely remove corpse shadows from appearing? I thought simply disabling monster shadows would do it but I still see them? Perhaps these are gzdoom's own shadows?
Thanks! At this time it doesn't seems like those can be removed, and those are not GZDoom shadows. Looks like I completely missed that or forgot to include it when I optimized shadows for TNT1 actors. I'll check it out!

Edit
Now that I look at this I think I've missed a shadow caster category - namely those sprites that are not missiles, monsters, inventory, or solid. I'll think on this. Quite possibly I'll make "other" turn everything not player, missile, or monster off. Good catch!

Return to “Gameplay Mods”