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.01631b - smooth shadow hotfix

Post by Skrell »

Hey Doomer_ wrote: Tue Jun 13, 2023 3:40 pm
cortes2k wrote: Tue Jun 13, 2023 2:02 am Dude... I have to tell you.
I tested again but not using release 4.10.0, I used 4.11 beta and have no crashes using Platinum Edition and Last Relighting version. Access violation was because the version of gzdoom.
Keep up the good work.
Yep I agree
Where can I download the beta?
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.01631b - smooth shadow hotfix

Post by Hey Doomer_ »

Skrell wrote: Tue Jun 13, 2023 6:49 pm
Hey Doomer_ wrote: Tue Jun 13, 2023 3:40 pm
cortes2k wrote: Tue Jun 13, 2023 2:02 am Dude... I have to tell you.
I tested again but not using release 4.10.0, I used 4.11 beta and have no crashes using Platinum Edition and Last Relighting version. Access violation was because the version of gzdoom.
Keep up the good work.
Yep I agree
Where can I download the beta?
Here
Skrell
Posts: 362
Joined: Mon Mar 25, 2013 11:47 am

Re: Relighting v4.01631b - smooth shadow hotfix

Post by Skrell »

Hey Doomer_ wrote: Wed Jun 14, 2023 2:40 am
Skrell wrote: Tue Jun 13, 2023 6:49 pm
Hey Doomer_ wrote: Tue Jun 13, 2023 3:40 pm

Yep I agree
Where can I download the beta?
Here
That's not an official beta I think. I assume you're using the one from June?
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.01631b - smooth shadow hotfix

Post by Hey Doomer_ »

Skrell wrote: Wed Jun 14, 2023 12:39 pm
Hey Doomer_ wrote: Wed Jun 14, 2023 2:40 am
Skrell wrote: Tue Jun 13, 2023 6:49 pm

Where can I download the beta?
Here
That's not an official beta I think. I assume you're using the one from June?
Yes. The latest build.
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.01631b - smooth shadow hotfix

Post by Hey Doomer_ »

Progress v4.0164b - "blurred" shadows

Wall shadows are somewhat "blurry" because they are sprites projected onto a wall with a limited lifespan. I've simplified and applied this idea to floor and ceiling shadows. This creates an overlapping "blur" effect when a shadow moves. Thus far this seems to have no performance impact and makes floor and ceiling similar to wall shadows in appearance.

Here's an example from E1M1.

This effectively adds shadows without adding shadow thinkers. I'm on the fence in testing this and will likely add this as a Settings option for the next version. It does seem a bit less stark than FLATSPRITE actors and adds movement to shadows. 8-)
cosmos10040
Posts: 193
Joined: Mon Dec 20, 2021 6:16 am
Graphics Processor: ATI/AMD (Modern GZDoom)

Re: Relighting v4.01631b - smooth shadow hotfix

Post by cosmos10040 »

That looks very promising, anything that improves performance is very welcome!
cortes2k
Posts: 37
Joined: Mon May 15, 2023 12:13 am
Preferred Pronouns: He/Him
Operating System Version (Optional): Windows 10
Graphics Processor: ATI/AMD (Modern GZDoom)

Re: Relighting v4.01631b - smooth shadow hotfix

Post by cortes2k »

Look at this little cute guy, he has a real devil inside him hahaha https://imgur.com/a/OK3CtGC
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.01631b - smooth shadow hotfix

Post by Hey Doomer_ »

Progress v4.0164b - shadow and light improvements

Code: Select all

v4.0164b

6/15 - added floorshadow actors for "blurry" shadows similar to wall shadow actors
6/15 - added distance check for shadows behind the player
6/16 - added rl_blur_shadows CVar
6/16 - corrected rl_lifespan in shadow Tick() function
6/17 - adjust warea limit for texture baking by sidedef variables

As noted above, floor shadows now have an option to project on the floor similar to the way wall shadows project, creating a "blurry" effect (dunno what else to call it). In addition to this, I've added a distance check for shadows behind the player so closer shadows are still rendered. I've linked lifespan to the Tick() functions for shadows and lights; increasing this improves performance at the cost of less smooth shadows. Finally I've attached the sidedef variable ratio to the routine that adds decorative and baked lighting; this improves performance and load time depending on the map.

Early testing is good and plays well with some of the presets (mileage etc):

E2M2 - more light (I find this particularly striking :) )
E1M1 - more light, more shadow
E1M1 - less light, less shadow
E3M5 - more light, more shadow, more color

Note that generally "more color" generally darkens sectors but also affects how flats and textures are interpreted. There is as I've noted a huge variation in size, complexity, and color usage in Doom engine mapping. I've wondered if there is some way to link presets to maps or mods ahead of time with a text lump. Probably futile given the variety of platforms and monitors.

Still testing. Release "soon."
cortes2k
Posts: 37
Joined: Mon May 15, 2023 12:13 am
Preferred Pronouns: He/Him
Operating System Version (Optional): Windows 10
Graphics Processor: ATI/AMD (Modern GZDoom)

Re: Relighting v4.01631b - smooth shadow hotfix

Post by cortes2k »

cortes2k wrote: Sat Jun 17, 2023 3:00 pm E2M2 - more light (I find this particularly striking :) )
E1M1 - more light, more shadow
E1M1 - less light, less shadow
E3M5 - more light, more shadow, more color
Dude, that light in e2m2 looks super!...

I have a question.
Do you remember my comparison images with relighting 3 and 4?
https://imgur.com/a/qq5FVg0
I noticed there is no light in this kind of texture usung relighting 4, this image is from doom E1M3. Why doesn't this type of texture have light in relighting 4? There is more textures like this in E1M1 and no lights also. It looks weird, like the bulbs are out.
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.01631b - smooth shadow hotfix

Post by Hey Doomer_ »

cortes2k wrote: Sat Jun 17, 2023 3:00 pm I have a question.
Do you remember my comparison images with relighting 3 and 4?
https://imgur.com/a/qq5FVg0
I noticed there is no light in this kind of texture usung relighting 4, this image is from doom E1M3. Why doesn't this type of texture have light in relighting 4? There is more textures like this in E1M1 and no lights also. It looks weird, like the bulbs are out.
Good question. The answer is... well, I'll give it a try.

Relighting 3 starts with no light and lights everything according to predefined flats and textures. Each has a strength and a color, and special sources are defined. It ignores lighting specials and the author's original lighting. Gradient lighting is determined by light emitter and sensor actors that (unfortunately) use functions with random elements. (Much of the math is wrong as well although hard to notice.) It does other things such as numerous added point lights that are pretty but hurt performance. Note also that a texture-based approach makes Doom 2 incredibly dark, a problem with R3. Theoretically text lumps can be added to make R3 work with other games and mods. I just never did that.

Relighting 4 started as a test of dynamic shadows on Discord - I noticed that GZDoom sprite shadows are more or less black panties around monster ankles - and then I thought I could apply shadows and lighting effects to a new version of Relighting. I also wanted this to work with any mod, map, or game. Why not?

Thus R4 leaves map and author lighting largely intact and reads flats and sky textures to create color. There are no predefined textures, which is why it looks like bulbs are out; they aren't defined in the first place. Gradient lighting is determined by light sources placed in a "point of inaccessibility" in a sector (Doom has many irregular polygon sectors to put it mildly) and textures are lit according to how light reaches them. This is all done on load, so there isn't any performance impact. This is an efficiency trade off for universality if that makes sense.

(Math is corrected in R4. This makes a big difference in light placement.)

R4 does add "texture lights" according to author's lighting, but this isn't the same as R3. It's certainly possible to add texture based point lights to have the best of 3 and 4. That's just something I haven't committed to because of the universal goal of this mod. :| I can imagine that Doom is the most popular game in this discussion, but R4 looks pretty good with Heretic, Hexen, and others. And countless authors have spent untold hours (and possibly ruined relationships :lol: ) creating maps and mods with custom textures and sprites. I can't possibly define all of them.

It's easy enough to read textures but tricky (not impossible) to discern a pattern that indicates a light. Pondering that. Been pondering that.

Hope that helps!
cortes2k
Posts: 37
Joined: Mon May 15, 2023 12:13 am
Preferred Pronouns: He/Him
Operating System Version (Optional): Windows 10
Graphics Processor: ATI/AMD (Modern GZDoom)

Re: Relighting v4.01631b - smooth shadow hotfix

Post by cortes2k »

Hey Doomer_ wrote: Sat Jun 17, 2023 4:12 pm Good question. The answer is... well, I'll give it a try.

Relighting 3 starts with no light and lights everything according to predefined flats and textures. Each has a strength and a color, and special sources are defined. It ignores lighting specials and the author's original lighting. Gradient lighting is determined by light emitter and sensor actors that (unfortunately) use functions with random elements. (Much of the math is wrong as well although hard to notice.) It does other things such as numerous added point lights that are pretty but hurt performance. Note also that a texture-based approach makes Doom 2 incredibly dark, a problem with R3. Theoretically text lumps can be added to make R3 work with other games and mods. I just never did that.

Relighting 4 started as a test of dynamic shadows on Discord - I noticed that GZDoom sprite shadows are more or less black panties around monster ankles - and then I thought I could apply shadows and lighting effects to a new version of Relighting. I also wanted this to work with any mod, map, or game. Why not?

Thus R4 leaves map and author lighting largely intact and reads flats and sky textures to create color. There are no predefined textures, which is why it looks like bulbs are out; they aren't defined in the first place. Gradient lighting is determined by light sources placed in a "point of inaccessibility" in a sector (Doom has many irregular polygon sectors to put it mildly) and textures are lit according to how light reaches them. This is all done on load, so there isn't any performance impact. This is an efficiency trade off for universality if that makes sense.

(Math is corrected in R4. This makes a big difference in light placement.)

R4 does add "texture lights" according to author's lighting, but this isn't the same as R3. It's certainly possible to add texture based point lights to have the best of 3 and 4. That's just something I haven't committed to because of the universal goal of this mod. :| I can imagine that Doom is the most popular game in this discussion, but R4 looks pretty good with Heretic, Hexen, and others. And countless authors have spent untold hours (and possibly ruined relationships :lol: ) creating maps and mods with custom textures and sprites. I can't possibly define all of them.

It's easy enough to read textures but tricky (not impossible) to discern a pattern that indicates a light. Pondering that. Been pondering that.

Hope that helps!
Oh, now I totally get it, now I see that the main base of R4 was the shadows and not the lighting. That makes me think that R4 and R3 could run at the same time, one mod applying the lights from the light sources like the light grids, poles, ceiling lights, etc., and the other mod just the shadows. Although yes, I clearly see that the performance is totally different between both mods, I even realized that running the latest version of gzdoom 4.11 increased the framerate on my computer.

Personally, I really like the lighting of R3 and I really like the shadows of R4 and I see the effort that has been put into the new version by integrating lights and it's actually much better because it's not just lights, I see that it uses the textures to create those colored lights that look great.

Meanwhile you work every weekend infront your computer, we'll continue to enjoy playing dwith Relighting.

I congratulate you again for your time and your talent. Just great!

Cheers
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.01631b - smooth shadow hotfix

Post by Hey Doomer_ »

cortes2k wrote: Sat Jun 17, 2023 8:56 pm Personally, I really like the lighting of R3 and I really like the shadows of R4 and I see the effort that has been put into the new version by integrating lights and it's actually much better because it's not just lights, I see that it uses the textures to create those colored lights that look great.
Thanks!! Much appreciated!
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.0164b - "blur" shadows

Post by Hey Doomer_ »

Posted v4.0164b

Code: Select all

v4.0164b

6/15 - added floorshadow actors for "blurry" shadows similar to wall shadow actors
6/15 - added distance check for shadows behind the player
6/16 - added rl_blur_shadows CVar
6/16 - corrected rl_lifespan in shadow Tick() function
6/17 - adjust warea limit for texture baking by sidedef variables
6/18 - tweak strength of decorative/texture lights

As noted the shadows aren't really "blurry" - impossible with sprites - so much as projected to floors and ceilings like wall shadows. This effect can be turned off in Settings.

The rl_lifespan CVar has been corrected and increasing this will improve performance at the cost of shadow smoothness.

Many thanks for comments and support! Let me know what you think!
cosmos10040
Posts: 193
Joined: Mon Dec 20, 2021 6:16 am
Graphics Processor: ATI/AMD (Modern GZDoom)

Re: Relighting v4.0164b - "blur" shadows

Post by cosmos10040 »

Newest update is very smooth and works perfectly! There is only one issue, when running relighting with jw dwelling sin, it crashed upon pricking up a sprite, no crash log is generated. Only solution is to disable pickup shadow sprite. Anyway to fix? Thanks
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.0164b - "blur" shadows

Post by Hey Doomer_ »

cosmos10040 wrote: Thu Jun 29, 2023 4:55 am Newest update is very smooth and works perfectly! There is only one issue, when running relighting with jw dwelling sin, it crashed upon pricking up a sprite, no crash log is generated. Only solution is to disable pickup shadow sprite. Anyway to fix? Thanks
I see that error noted here with a log.

The crash report is a C0000005 (Access Violation), which happens when an application tries to access an invalid memory location. I don't think this has anything to do with Relighting, or more specifically it isn't related to anything in ZScript's VM. It's something happening with GZDoom.

Interesting that disabling pickup shadows fixes this.

Does this happen with dev builds as well?

Return to “Gameplay Mods”