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.
cosmos10040
Posts: 171
Joined: Mon Dec 20, 2021 6:16 am
Graphics Processor: ATI/AMD (Modern GZDoom)

Re: Relighting v4.011b

Post by cosmos10040 »

I would like to report a shader issue with floats on deltatouch which I fixed but then a vm abort and have confirmed with generic the same

VM execution aborted: array access out of bounds. Size = 157, current index = 157

Called from hd_light.PostBeginPlay at relighting v4.011b.pk3:zscript/hd_actors.zs, line 236
]
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.011b

Post by Hey Doomer_ »

cosmos10040 wrote: Tue Nov 15, 2022 2:38 pm I would like to report a shader issue with floats on deltatouch which I fixed but then a vm abort and have confirmed with generic the same

VM execution aborted: array access out of bounds. Size = 157, current index = 157

Called from hd_light.PostBeginPlay at relighting v4.011b.pk3:zscript/hd_actors.zs, line 236
]
Great, thanks for this. What did you fix in the shader?

Also what map were you playing when you got the vm abort?
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.011b

Post by Hey Doomer_ »

Hey Doomer_ wrote: Tue Nov 15, 2022 2:55 pm
cosmos10040 wrote: Tue Nov 15, 2022 2:38 pm I would like to report a shader issue with floats on deltatouch which I fixed but then a vm abort and have confirmed with generic the same

VM execution aborted: array access out of bounds. Size = 157, current index = 157

Called from hd_light.PostBeginPlay at relighting v4.011b.pk3:zscript/hd_actors.zs, line 236
]
Great, thanks for this. What did you fix in the shader?

Also what map were you playing when you got the vm abort?
Ah I see it...

Code: Select all

		else if (Event.lobj.Find(cname) != Event.lobj.Size())
		{
			glcolor = Event.cobj[Event.lobj.Find(cname)];
lobj and cobj should have the same numbers, but depending on gldefs that may not be true (working on that). Here's a quick fix for that:

Code: Select all

		else if (Event.lobj.Find(cname) != Event.lobj.Size())
		{
			if (Event.lobj.Find(cname) < Event.cobj.Size())	glcolor = Event.cobj[Event.lobj.Find(cname)];

It would help if I knew which lights file or mod you were running... string processing is what it is, but it will help to see how it happened.
cosmos10040
Posts: 171
Joined: Mon Dec 20, 2021 6:16 am
Graphics Processor: ATI/AMD (Modern GZDoom)

Re: Relighting v4.011b

Post by cosmos10040 »

Hey Doomer_ wrote: Tue Nov 15, 2022 2:55 pm
cosmos10040 wrote: Tue Nov 15, 2022 2:38 pm I would like to report a shader issue with floats on deltatouch which I fixed but then a vm abort and have confirmed with generic the same

VM execution aborted: array access out of bounds. Size = 157, current index = 157

Called from hd_light.PostBeginPlay at relighting v4.011b.pk3:zscript/hd_actors.zs, line 236
]
Great, thanks for this. What did you fix in the shader?

Also what map were you playing when you got the vm abort?
All I did was added a decimal (1.0) to hd_shader.fp look below:

c = pow(c, vec3(1.0/rl_gamma));

I was trying to play e1m1
cosmos10040
Posts: 171
Joined: Mon Dec 20, 2021 6:16 am
Graphics Processor: ATI/AMD (Modern GZDoom)

Re: Relighting v4.011b

Post by cosmos10040 »

Hey Doomer_ wrote: Tue Nov 15, 2022 3:12 pm
Hey Doomer_ wrote: Tue Nov 15, 2022 2:55 pm
cosmos10040 wrote: Tue Nov 15, 2022 2:38 pm I would like to report a shader issue with floats on deltatouch which I fixed but then a vm abort and have confirmed with generic the same

VM execution aborted: array access out of bounds. Size = 157, current index = 157

Called from hd_light.PostBeginPlay at relighting v4.011b.pk3:zscript/hd_actors.zs, line 236
]
Great, thanks for this. What did you fix in the shader?

Also what map were you playing when you got the vm abort?
Ah I see it...

Code: Select all

		else if (Event.lobj.Find(cname) != Event.lobj.Size())
		{
			glcolor = Event.cobj[Event.lobj.Find(cname)];
lobj and cobj should have the same numbers, but depending on gldefs that may not be true (working on that). Here's a quick fix for that:

Code: Select all

		else if (Event.lobj.Find(cname) != Event.lobj.Size())
		{
			if (Event.lobj.Find(cname) < Event.cobj.Size())	glcolor = Event.cobj[Event.lobj.Find(cname)];

It would help if I knew which lights file or mod you were running... string processing is what it is, but it will help to see how it happened.
Currently using subtle lights and darkdoomz. I will try that fix
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.011b

Post by Hey Doomer_ »

cosmos10040 wrote: Tue Nov 15, 2022 4:43 pm
Hey Doomer_ wrote: Tue Nov 15, 2022 2:55 pm
cosmos10040 wrote: Tue Nov 15, 2022 2:38 pm I would like to report a shader issue with floats on deltatouch which I fixed but then a vm abort and have confirmed with generic the same

VM execution aborted: array access out of bounds. Size = 157, current index = 157

Called from hd_light.PostBeginPlay at relighting v4.011b.pk3:zscript/hd_actors.zs, line 236
]
Great, thanks for this. What did you fix in the shader?

Also what map were you playing when you got the vm abort?
All I did was added a decimal (1.0) to hd_shader.fp look below:

c = pow(c, vec3(1.0/rl_gamma));

I was trying to play e1m1
Awesome thanks
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.011b

Post by Hey Doomer_ »

cosmos10040 wrote: Tue Nov 15, 2022 4:50 pm
Hey Doomer_ wrote: Tue Nov 15, 2022 3:12 pm
Hey Doomer_ wrote: Tue Nov 15, 2022 2:55 pm

Great, thanks for this. What did you fix in the shader?

Also what map were you playing when you got the vm abort?
Ah I see it...

Code: Select all

		else if (Event.lobj.Find(cname) != Event.lobj.Size())
		{
			glcolor = Event.cobj[Event.lobj.Find(cname)];
lobj and cobj should have the same numbers, but depending on gldefs that may not be true (working on that). Here's a quick fix for that:

Code: Select all

		else if (Event.lobj.Find(cname) != Event.lobj.Size())
		{
			if (Event.lobj.Find(cname) < Event.cobj.Size())	glcolor = Event.cobj[Event.lobj.Find(cname)];

It would help if I knew which lights file or mod you were running... string processing is what it is, but it will help to see how it happened.
Currently using subtle lights and darkdoomz. I will try that fix
It's not subtle lights. While that has a gldef, there's nothing Relighting would use. I don't see anything in DarkDoomZ either (and didn't see the error), other than it should be loaded before Relighting. Very interesting... :|
cosmos10040
Posts: 171
Joined: Mon Dec 20, 2021 6:16 am
Graphics Processor: ATI/AMD (Modern GZDoom)

Re: Relighting v4.011b

Post by cosmos10040 »

So I tried the fix and it works now. Thanks foe the quick fix. Not sure what could have caused it. I did have d64fier and put it back on and thar worked too. I changed the load order and works good.
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.011b

Post by Dan_The_Noob »

it's a shame there's no way to do an entire wad at once for a big load then have the game run after.
unless there was a way to make this an external thing you could dump wads into.
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.011b

Post by Hey Doomer_ »

Dan_The_Noob wrote: Tue Nov 15, 2022 5:46 pm it's a shame there's no way to do an entire wad at once for a big load then have the game run after.
unless there was a way to make this an external thing you could dump wads into.
Agree it would be nice if common elements during a session could be read only once. Still thinking about that.

Combinations of possible games and mods make any kind of preloading ahead of time not very useful... Everyone has different likes in add-ons, so they really need to be read on the fly.

I suspect I can improve efficiency using a dictionary structure that reduces string processing, however. Working on that.

Edit
I am seeing that the same lump is loaded many, many times. Not sure why, since this is a simple loop, but that's wasted time for sure.

Edit
The problem is how this searches for lumps. These file handles are thousands apart, and the loop checks each lump in turn until it catches up. This yields expected results:

Code: Select all

		while (true)
		{
			int fhnd = Wads.FindLump("gldefs", startlump, Wads.ANYNAMESPACE);
			if (fhnd == -1)
			{
				break;
			}
			console.printf("%i %i",fhnd,startlump);
			startlump = int(fhnd + 1);
		}
startlump starts at 0 and has to be incremented so the function continues normally, since the handles are thousands apart. So for each one of these it's necessary to replace this

Code: Select all

				int fhnd = Wads.FindLump("gldefs", startlump++, Wads.ANYNAMESPACE);
				if (fhnd == -1) break;
with this

Code: Select all

				int fhnd = Wads.FindLump("gldefs", startlump, Wads.ANYNAMESPACE);
				if (fhnd == -1) break;
				startlump = fhnd + 1;
That is the load bottleneck or one of them.

Maintenance fix pending.


Edit
Load time is a second. Seems that fixes it. 8-)
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.012b

Post by Hey Doomer_ »

Posted 4.012b, a small but significant maintenance update. This fixes load times.

This also adds several performance tweaks (on the Settings menu) that affect the lifespan of shadows and their visibility. Turning on "Actors Hide Shadows" (true by default) makes a significant difference in fire fights with many monsters. Anything in the background obscured by monsters in front of you can now be skipped. This and increasing the lifespan of the shadows can improve performance although may cause some visual glitches.

Many thanks.
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.012b

Post by Dan_The_Noob »

Hey Doomer_ wrote: Tue Nov 15, 2022 7:10 pm Posted 4.012b, a small but significant maintenance update. This fixes load times.

This also adds several performance tweaks (on the Settings menu) that affect the lifespan of shadows and their visibility. Turning on "Actors Hide Shadows" (true by default) makes a significant difference in fire fights with many monsters. Anything in the background obscured by monsters in front of you can now be skipped. This and increasing the lifespan of the shadows can improve performance although may cause some visual glitches.

Many thanks.
sweet, i'm glad i sparked some inspiration to find that loop

--EDIT--
holy shit, that's near-instant now. night and day haha!

--EDIT--
tried this on a normal sized Obsidian generated map and FPS tanks but loadtime is still near-instant. any idea which settings would cause the most lag after initial load? (~100 enemies)
--UPDATE--
toggling every setting one at a time and resetting between, none of them have any effect on the performance drop.
must be something that runs in the background/consistently. because it's basically a locked 1fps (though turning off quality shadows does improve frametime, as expected.)
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.012b

Post by Hey Doomer_ »

Dan_The_Noob wrote: Tue Nov 15, 2022 7:31 pm
Hey Doomer_ wrote: Tue Nov 15, 2022 7:10 pm Posted 4.012b, a small but significant maintenance update. This fixes load times.

This also adds several performance tweaks (on the Settings menu) that affect the lifespan of shadows and their visibility. Turning on "Actors Hide Shadows" (true by default) makes a significant difference in fire fights with many monsters. Anything in the background obscured by monsters in front of you can now be skipped. This and increasing the lifespan of the shadows can improve performance although may cause some visual glitches.

Many thanks.
sweet, i'm glad i sparked some inspiration to find that loop

--EDIT--
holy shit, that's near-instant now. night and day haha!

--EDIT--
tried this on a normal sized Obsidian generated map and FPS tanks but loadtime is still near-instant. any idea which settings would cause the most lag after initial load? (~100 enemies)
--UPDATE--
toggling every setting one at a time and resetting between, none of them have any effect on the performance drop.
must be something that runs in the background/consistently. because it's basically a locked 1fps (though turning off quality shadows does improve frametime, as expected.)
Try changing Area Min and Max under Sector Lights or the Min (light min) setting. These affect how many sectors get dynamic light sources that generate the shadows. I changed these to 256/0/240, and this seemed to work for me (upper limit of 0 is unlimited but that can also be changed of course to limit lights). Obsidian doubtless generates too many small, bright sectors. I'll take a look at 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.012b

Post by Dan_The_Noob »

Hey Doomer_ wrote: Wed Nov 16, 2022 2:36 am

Try changing Area Min and Max under Sector Lights or the Min (light min) setting. These affect how many sectors get dynamic light sources that generate the shadows. I changed these to 256/0/240, and this seemed to work for me (upper limit of 0 is unlimited but that can also be changed of course to limit lights). Obsidian doubtless generates too many small, bright sectors. I'll take a look at that!
OK I see, I'll give that a try.
and yeah it might be worth finding a good default to work in as many maps as possible.
or even set up a presets menu.

--EDIT--
seems to have worked, ill play with the setting to find a good balance.
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.012b

Post by Hey Doomer_ »

Dan_The_Noob wrote: Wed Nov 16, 2022 4:05 am
Hey Doomer_ wrote: Wed Nov 16, 2022 2:36 am

Try changing Area Min and Max under Sector Lights or the Min (light min) setting. These affect how many sectors get dynamic light sources that generate the shadows. I changed these to 256/0/240, and this seemed to work for me (upper limit of 0 is unlimited but that can also be changed of course to limit lights). Obsidian doubtless generates too many small, bright sectors. I'll take a look at that!
OK I see, I'll give that a try.
and yeah it might be worth finding a good default to work in as many maps as possible.
or even set up a presets menu.

--EDIT--
seems to have worked, ill play with the setting to find a good balance.
I'll work on a more intelligent analysis of the map. Currently it sorts by size and changes tactics at the median, but this doesn't account for skew. Thanks again.
Post Reply

Return to “Gameplay Mods”