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: 362
Joined: Mon Mar 25, 2013 11:47 am

Re: Relighting v4.0150b - sky colors

Post by Skrell »

Anyone know what setting in relighting causes strange black outlined "box" shadows around voxel items? I love relighting but also my voxels!
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.0150b - sky colors

Post by Hey Doomer_ »

Skrell wrote: Sun Jan 08, 2023 10:07 am Anyone know what setting in relighting causes strange black outlined "box" shadows around voxel items? I love relighting but also my voxels!
I did add code to disable sprite shadows for voxels, but you may have to turn off shadows in Settings. Voxels are models in GZDoom and so do not generate a FLATSPRITE actor. At some point it may be possible to pitch a voxel actor, in which case shadows should be possible. (I think the same thing happens in non-accelerated software rendering mode, which ignores the FLATSPRITE.) These are GZDoom issues. Can't be helped at this time.

I'll review the voxel code again. It reads voxel definitions and when one is spawned doesn't add a shadow inventory item that spawns the shadow FLATSPRITE actors. It may also be possible to create a duplicate of a voxel actor that isn't a voxel so the voxel generates sprite shadows from the duplicate... a voxel doppelganger of sorts. I still should know the sprite name.

I'll ponder that. 8-)
Skrell
Posts: 362
Joined: Mon Mar 25, 2013 11:47 am

Re: Relighting v4.0150b - sky colors

Post by Skrell »

Hey Doomer_ wrote: Sun Jan 08, 2023 2:25 pm
Skrell wrote: Sun Jan 08, 2023 10:07 am Anyone know what setting in relighting causes strange black outlined "box" shadows around voxel items? I love relighting but also my voxels!
I did add code to disable sprite shadows for voxels, but you may have to turn off shadows in Settings. Voxels are models in GZDoom and so do not generate a FLATSPRITE actor. At some point it may be possible to pitch a voxel actor, in which case shadows should be possible. (I think the same thing happens in non-accelerated software rendering mode, which ignores the FLATSPRITE.) These are GZDoom issues. Can't be helped at this time.

I'll review the voxel code again. It reads voxel definitions and when one is spawned doesn't add a shadow inventory item that spawns the shadow FLATSPRITE actors. It may also be possible to create a duplicate of a voxel actor that isn't a voxel so the voxel generates sprite shadows from the duplicate... a voxel doppelganger of sorts. I still should know the sprite name.

I'll ponder that. 8-)
If it helps at all... It's not ALL voxels. I can't figure out what the pattern is. Also I disabled pickup shadows and that seemed to help somewhat
User avatar
Dan_The_Noob
Posts: 878
Joined: Tue May 07, 2019 12:24 pm
Graphics Processor: nVidia with Vulkan support

Re: Relighting v4.0150b - sky colors

Post by Dan_The_Noob »

sky lights look good, is there a way to adjust JUST the sky light bleed though?
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.0150b - sky colors

Post by Hey Doomer_ »

Dan_The_Noob wrote: Sun Jan 08, 2023 7:48 pm sky lights look good, is there a way to adjust JUST the sky light bleed though?
Can you explain what you mean? All the flat colors are treated about the same and can be adjusted through the color settings... just not sure what you're getting at with the sky.
User avatar
Dan_The_Noob
Posts: 878
Joined: Tue May 07, 2019 12:24 pm
Graphics Processor: nVidia with Vulkan support

Re: Relighting v4.0150b - sky colors

Post by Dan_The_Noob »

Hey Doomer_ wrote: Mon Jan 09, 2023 6:57 am
Dan_The_Noob wrote: Sun Jan 08, 2023 7:48 pm sky lights look good, is there a way to adjust JUST the sky light bleed though?
Can you explain what you mean? All the flat colors are treated about the same and can be adjusted through the color settings... just not sure what you're getting at with the sky.
the indoor lights colour bleed is ok. but say the red sky in Episode Inferno of Doom 1, it comes out completely red.
it doesn't REALLY matter, but would be nice to have an option to lower just the sky bleed amount.
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.0150b - sky colors

Post by Hey Doomer_ »

Dan_The_Noob wrote: Mon Jan 09, 2023 7:05 am
Hey Doomer_ wrote: Mon Jan 09, 2023 6:57 am
Dan_The_Noob wrote: Sun Jan 08, 2023 7:48 pm sky lights look good, is there a way to adjust JUST the sky light bleed though?
Can you explain what you mean? All the flat colors are treated about the same and can be adjusted through the color settings... just not sure what you're getting at with the sky.
the indoor lights colour bleed is ok. but say the red sky in Episode Inferno of Doom 1, it comes out completely red.
it doesn't REALLY matter, but would be nice to have an option to lower just the sky bleed amount.
Ah gotcha. I'll take a look at that
Zaibatsu64
Posts: 19
Joined: Sun Nov 27, 2022 9:35 am

Re: Relighting v4.0150b - sky colors

Post by Zaibatsu64 »

Thanks for another great update.

I've found that I've unfortunately had to disable the colour bleeding option. This setting works well indoors, but it can lead to some odd results with the coloured skies. The sky should usually be the dominant lighting source in an outdoor scene, but sometimes the texture of the floor is used to determine the colour of the sector. There can be other issues when there's an overhang. I can provide pictures if it's helpful, that may be easier to understand (and easier to explain what I'm talking about).

The coloured skies add tons of atmosphere when everything is working as expected. There are many fringe cases and it must be very difficult to account for them in a way that will work universally. I can't credit you enough for the mod, it's so cleverly done.
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.0150b - sky colors

Post by Hey Doomer_ »

Zaibatsu64 wrote: Mon Jan 09, 2023 11:28 am Thanks for another great update.

I've found that I've unfortunately had to disable the colour bleeding option. This setting works well indoors, but it can lead to some odd results with the coloured skies. The sky should usually be the dominant lighting source in an outdoor scene, but sometimes the texture of the floor is used to determine the colour of the sector. There can be other issues when there's an overhang. I can provide pictures if it's helpful, that may be easier to understand (and easier to explain what I'm talking about).

The coloured skies add tons of atmosphere when everything is working as expected. There are many fringe cases and it must be very difficult to account for them in a way that will work universally. I can't credit you enough for the mod, it's so cleverly done.
Interesting. This is unintentional. Can you give an example where floor texture determines the sky sector color?

In the meantime try changing 967 in relighting.zs to this:

Code: Select all

				else if (!sky && (fc.r + fc.g + fc.b + cc.r + cc.g + cc.b))
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.0150b - sky colors

Post by Hey Doomer_ »

Hey Doomer_ wrote: Sun Jan 08, 2023 2:25 pm
Skrell wrote: Sun Jan 08, 2023 10:07 am Anyone know what setting in relighting causes strange black outlined "box" shadows around voxel items? I love relighting but also my voxels!
I did add code to disable sprite shadows for voxels, but you may have to turn off shadows in Settings. Voxels are models in GZDoom and so do not generate a FLATSPRITE actor. At some point it may be possible to pitch a voxel actor, in which case shadows should be possible. (I think the same thing happens in non-accelerated software rendering mode, which ignores the FLATSPRITE.) These are GZDoom issues. Can't be helped at this time.

I'll review the voxel code again. It reads voxel definitions and when one is spawned doesn't add a shadow inventory item that spawns the shadow FLATSPRITE actors. It may also be possible to create a duplicate of a voxel actor that isn't a voxel so the voxel generates sprite shadows from the duplicate... a voxel doppelganger of sorts. I still should know the sprite name.

I'll ponder that. 8-)
I don't see any issues as described with Relighting and voxels using Vulkan as is. What renderer are you using?
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.0150b - sky colors

Post by Hey Doomer_ »

Hey Doomer_ wrote: Mon Jan 09, 2023 8:04 am
Dan_The_Noob wrote: Mon Jan 09, 2023 7:05 am
Hey Doomer_ wrote: Mon Jan 09, 2023 6:57 am

Can you explain what you mean? All the flat colors are treated about the same and can be adjusted through the color settings... just not sure what you're getting at with the sky.
the indoor lights colour bleed is ok. but say the red sky in Episode Inferno of Doom 1, it comes out completely red.
it doesn't REALLY matter, but would be nice to have an option to lower just the sky bleed amount.
Ah gotcha. I'll take a look at that
The sky color derived from color settings against the palette is applied as is to the sky sector. Originally I set a darker shade to this, which made several outdoor sectors appear extremely dark. However, I wonder if this primary affects red sectors in Doom. (What? Red in Doom? Is there red in Doom's palette? Crazy.)

Code I'm experimenting with in relighting.zs:

Code: Select all

				if (sky && (cc.r + cc.g + cc.b))
				{
					if (cc.r > cc.g && cc.r > cc.b)
					{
						sec.SetColor(shade(cc, 2.5));
					}
					else
					{
						sec.SetColor(shade(cc, -0.8));
					}
				}
There are two related color functions, shade() and tint() borrowed from the original Relighting. In color theory these generally add black or white to a color, but in this case shade() multiplies uniformly while tint() multiplies perceptually. It's the latter function, for example, that makes the blue health bonus items stand out a little more...

In general Relighting adds indoor ceiling colors using different shades of the flat color. It's certainly possible to expose these as CVars, but feel free to experiment with the above and let me know what you think.
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.0150b - sky colors

Post by Hey Doomer_ »

WIWO v4.0151b

Code: Select all

v4.0151b

1/10 - added check for !sky with other colors
1/11 - corrected sky colors
Also a new option called "Smart Lighting." The idea is CVars are dynamically adjusted for a map depending on what kind of map it is (indoor, outdoor, bright, dark, etc). Still an idea but consider (comments in italics):
Spoiler:
I'll be working on tweaking lighting based on map "character" variables. Not sure of a release, but I should have something in a few days. 8-)

Update
Close to releasing. Still working on smart lighting. There should be more light sources in many maps with smart lighting, and at least one calculation has been corrected. This is a subtle enhancement for the most part. Performance impact is minimal or positive so far in testing.
Last edited by Hey Doomer_ on Fri Jan 13, 2023 7:46 am, edited 1 time in total.
Skrell
Posts: 362
Joined: Mon Mar 25, 2013 11:47 am

Re: Relighting v4.0150b - sky colors

Post by Skrell »

Hey Doomer_ wrote: Tue Jan 10, 2023 3:04 am
Hey Doomer_ wrote: Sun Jan 08, 2023 2:25 pm
Skrell wrote: Sun Jan 08, 2023 10:07 am Anyone know what setting in relighting causes strange black outlined "box" shadows around voxel items? I love relighting but also my voxels!
I did add code to disable sprite shadows for voxels, but you may have to turn off shadows in Settings. Voxels are models in GZDoom and so do not generate a FLATSPRITE actor. At some point it may be possible to pitch a voxel actor, in which case shadows should be possible. (I think the same thing happens in non-accelerated software rendering mode, which ignores the FLATSPRITE.) These are GZDoom issues. Can't be helped at this time.

I'll review the voxel code again. It reads voxel definitions and when one is spawned doesn't add a shadow inventory item that spawns the shadow FLATSPRITE actors. It may also be possible to create a duplicate of a voxel actor that isn't a voxel so the voxel generates sprite shadows from the duplicate... a voxel doppelganger of sorts. I still should know the sprite name.

I'll ponder that. 8-)
I don't see any issues as described with Relighting and voxels using Vulkan as is. What renderer are you using?
Interesting! I haven't been using Vulkan, I've been using OpenGL! Is that the issue? So I just tested Vulkan being the preferred renderer. The voxel shadows were still messed up however when I disabled shadows for pickups it seemed to work better and I didn't see any "shadows" still attempting to be rendered for any voxels.
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.0150b - sky colors

Post by Hey Doomer_ »

Skrell wrote: Wed Jan 11, 2023 9:02 am
Hey Doomer_ wrote: Tue Jan 10, 2023 3:04 am
Hey Doomer_ wrote: Sun Jan 08, 2023 2:25 pm

I did add code to disable sprite shadows for voxels, but you may have to turn off shadows in Settings. Voxels are models in GZDoom and so do not generate a FLATSPRITE actor. At some point it may be possible to pitch a voxel actor, in which case shadows should be possible. (I think the same thing happens in non-accelerated software rendering mode, which ignores the FLATSPRITE.) These are GZDoom issues. Can't be helped at this time.

I'll review the voxel code again. It reads voxel definitions and when one is spawned doesn't add a shadow inventory item that spawns the shadow FLATSPRITE actors. It may also be possible to create a duplicate of a voxel actor that isn't a voxel so the voxel generates sprite shadows from the duplicate... a voxel doppelganger of sorts. I still should know the sprite name.

I'll ponder that. 8-)
I don't see any issues as described with Relighting and voxels using Vulkan as is. What renderer are you using?
Interesting! I haven't been using Vulkan, I've been using OpenGL! Is that the issue? So I just tested Vulkan being the preferred renderer. The voxel shadows were still messed up however when I disabled shadows for pickups it seemed to work better and I didn't see any "shadows" still attempting to be rendered for any voxels.
When I use OpenGL (AMD card) the voxels are flattened, like sprites. I just noticed this and switched to Vulkan. I don't normally test with voxels. There shouldn't be any voxel shadows, although I did see them with the flattened voxels in OpenGL. Not sure why.
User avatar
Dan_The_Noob
Posts: 878
Joined: Tue May 07, 2019 12:24 pm
Graphics Processor: nVidia with Vulkan support

Re: Relighting v4.0150b - sky colors

Post by Dan_The_Noob »

how do you get the sky colour? or can you read the texture colour averages somehow? because i think sky colour could help with determining how bright it would be outside. just purely based on saturation.

Return to “Gameplay Mods”