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
generic name guy
Posts: 123
Joined: Wed Nov 11, 2020 3:25 pm
Graphics Processor: nVidia with Vulkan support
Location: Brazil

Re: Relighting v4.0159b - better light & shadow

Post by generic name guy »

Hey Doomer_ wrote: Sun Apr 09, 2023 1:30 am This is also noticeable in more subtle ways compared to fake contrast - such as lighting stairways (E1M9) and sides of columns (E2M5) - but that's the idea. It does produce anomalies here and there, and note that side tiers are not available in ZScript.
Oh, i thought it was Half-Life style lightmaps.
Skrell
Posts: 359
Joined: Mon Mar 25, 2013 11:47 am

Re: Relighting v4.0159b - better light & shadow

Post by Skrell »

Hey Doomer_ wrote: Sun Apr 09, 2023 10:29 am
Great answer!! I really appreciate your detailed and meticulous answer!
User avatar
Hey Doomer_
Posts: 446
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.0159b - better light & shadow

Post by Hey Doomer_ »

WIWO v4.0160b

I did experiment with particle lights emitting from decorative light sources, and this is underwhelming in performance and effect. I've shelved that idea for now.

At this point still kicking tires. I think this version of this mod looks and performs well, but the old version was mighty pretty. This was partly because of PBR textures and point lights attached to those textures. I'm not sure how relevant the former is outside of canonical doom, and the latter needs specific configurations that also diminish the universal nature of this version of the mod.

All the same I am looking at texture lighting again and basing choices on sector shape, placement, and lighting while ignoring the textures on the assumption that the author's intent is to create a sector that is "lit." This is scalable and universal in theory, and so far it's only POC. But here are some random screenshots:

e1m2
map02
map04

This is about 15 minutes of work while basically using existing code (treating these like decorative light sources) and just checking a few variables, but it looks interesting enough to continue to develop.
User avatar
Hey Doomer_
Posts: 446
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.0159b - better light & shadow

Post by Hey Doomer_ »

Progress v4.0160b

I have been pruning and categorizing creation of light sources. These are now sector light sources (generally reserved to well lit areas between the median and maximum areas), decorative lights, and texture lights in any sector meeting criteria. The latter are ignored for shadows. The number of light sources is now very small, although this depends on the map. Many light sources are added for light baking alone and subsequently destroyed.

I have also pruned sprite limits depending on the number of potential shadow generators on a map. For highly detailed maps this can easily be in the thousands, which understandably adds many thinkers. It isn't possible to correct for any height curve distortion, since sprite actors tend to be evenly distributed in many levels. More monsters means more ammo and health, etc. Thus I have added a factor based on the number of sprites that could generate shadows, and that factor dynamically affects Settings.

How texture lights work is simple. It doesn't consider the textures, what they are called, or anything like that; the size and ratio of sector lighting to back sectors is considered. This isn't perfect but is surprisingly effective in many cases since it is an interpretation of the author's intent.

Still a bit to do.
Skrell
Posts: 359
Joined: Mon Mar 25, 2013 11:47 am

Re: Relighting v4.0159b - better light & shadow

Post by Skrell »

Really a fan of the insight you provide via these status updates!
User avatar
Hey Doomer_
Posts: 446
Joined: Tue Oct 18, 2022 1:59 am
Operating System Version (Optional): Windows 11
Graphics Processor: ATI/AMD with Vulkan/Metal Support

More Progress v4.0160b

Post by Hey Doomer_ »

More Progress v4.0160b

Code: Select all

v4.0160b

4/13 - added texture lights
4/15 - cap sprite & shadow distance limits by number of actors (scalability)
4/15 - general code cleanup
e1m2
e1m7

The above shows the effects of the new "texture" lights. These are used for light baking and some added point lights and ignored for shadow generation. I've also increased lights that are "extra" and destroyed after light baking. Overall this is looking OK, although the extra light baking increases load times a bit with some maps. That can't be helped.

Another note on texture lighting. These point lights attached to the texture take on the color of that sector and do not consider the texture itself. I have not added any exception coding.

I've played through enough of Doom I, II, and a few Heretic maps to know this is a keeper. Most maps look better, but it is far from perfect. There are areas lit before that are not now and vice versa, and in addition some sprites in some areas appear darker than baked lights suggest where sector light level remains the same. Some areas as before are barely light (there are just no visible sources of light, a common problem in Doom maps in particular) and other areas have light from no obvious source (another problem from the 90s). I'm surprised at how a few small changes have made such dramatic changes in maps. Note, extra light baking doesn't affect game play at all, since this is all calculated in WorldLoaded().

The "code cleanup" includes stuff like adding common functions and moving blocks of code to make more sense / efficiency. Most of what's done in WorldLoaded() is linear and not repetitive, but all the same there are areas for improvement.

Anyway there's a bit more to be done. 8-)

Many thanks for your patience and interest!


Edit

Adding more baked lighting - as texture lighting does - adds more realism but also means adjusting sector light levels. (The warehouse room in MAP10 is a good example of this.) This is far from perfect but getting closer. The net effect adds more light, which is still very good. Examples:

e1m3
e1m7

The calculation here looks at total light (positive numbers) and total shadow (negative numbers) added to wall textures to adjust sector light level. A problem is that sprites are lit according to sector light level and may appear darker or lighter compared to surrounding textures. Currently the default for shadow-casters is to light either in shadow (if their shadow is between themselves and the player) or use the sector light level. The sector light level is a constant, and that causes the anomalies against baked textures. Since I always know how close light is to an actor casting a shadow, tweaking that value is feasible. I'll look at that next.

Still more to do, but so far this looks very good. There is generally more light and where it is expected. 8-)
Last edited by Hey Doomer_ on Mon Apr 17, 2023 5:22 am, edited 2 times in total.
User avatar
Dan_The_Noob
Posts: 878
Joined: Tue May 07, 2019 12:24 pm
Graphics Processor: nVidia with Vulkan support

Re: Relighting v4.0159b - better light & shadow

Post by Dan_The_Noob »

Hey Doomer_ wrote: Sun Apr 16, 2023 7:58 am
Another note on texture lighting. These point lights attached to the texture take on the color of that sector and do not consider the texture itself. I have not added any exception coding.
if i had to suggest 1 exception, it'd be keybar lights.
maybe add a separate, weaker, coloured light for keybars?
User avatar
Hey Doomer_
Posts: 446
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.0159b - better light & shadow

Post by Hey Doomer_ »

Dan_The_Noob wrote: Sun Apr 16, 2023 4:16 pm
Hey Doomer_ wrote: Sun Apr 16, 2023 7:58 am
Another note on texture lighting. These point lights attached to the texture take on the color of that sector and do not consider the texture itself. I have not added any exception coding.
if i had to suggest 1 exception, it'd be keybar lights.
maybe add a separate, weaker, coloured light for keybars?
What do you mean by keybars?
User avatar
Dan_The_Noob
Posts: 878
Joined: Tue May 07, 2019 12:24 pm
Graphics Processor: nVidia with Vulkan support

Re: Relighting v4.0159b - better light & shadow

Post by Dan_The_Noob »

Hey Doomer_ wrote: Sun Apr 16, 2023 4:59 pm
Dan_The_Noob wrote: Sun Apr 16, 2023 4:16 pm
Hey Doomer_ wrote: Sun Apr 16, 2023 7:58 am
Another note on texture lighting. These point lights attached to the texture take on the color of that sector and do not consider the texture itself. I have not added any exception coding.
if i had to suggest 1 exception, it'd be keybar lights.
maybe add a separate, weaker, coloured light for keybars?
What do you mean by keybars?
like the Red/Blue/Yellow bars/skulls around key doors/switches.
User avatar
Hey Doomer_
Posts: 446
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.0159b - better light & shadow

Post by Hey Doomer_ »

Dan_The_Noob wrote: Sun Apr 16, 2023 8:33 pm
Hey Doomer_ wrote: Sun Apr 16, 2023 4:59 pm
Dan_The_Noob wrote: Sun Apr 16, 2023 4:16 pm

if i had to suggest 1 exception, it'd be keybar lights.
maybe add a separate, weaker, coloured light for keybars?
What do you mean by keybars?
like the Red/Blue/Yellow bars/skulls around key doors/switches.
Ok gotcha
cosmos10040
Posts: 193
Joined: Mon Dec 20, 2021 6:16 am
Graphics Processor: ATI/AMD (Modern GZDoom)

Re: Relighting v4.0159b - better light & shadow

Post by cosmos10040 »

In addition to the request above, how about having the blue/red/yellow posts by the key doors glow?
thugsta
Posts: 150
Joined: Mon Jan 21, 2019 10:10 am

Re: Relighting v4.0159b - better light & shadow

Post by thugsta »

Some little ideas If were talking about little neat touches.
What about filling in window slots with glass panes? or at least the ones with a view of the sky to give places more of the illusion they are real locations and not just abstract shapes.

Also an idea is for maybe small light textures to have lens flares/halo's, to give lights a bit of a 'pop'.

Lastly, what about having key doors be used by some kinda animation or something (like the access card shows up to the door, or scan's itself) rather then having a key and just magically that door is now openable, just needs something more immersive but i think this one is further away for this project then the other 2 ideas.
User avatar
BROS_ETT_311
Posts: 219
Joined: Fri Nov 03, 2017 6:05 pm

Re: Relighting v4.0159b - better light & shadow

Post by BROS_ETT_311 »

Not to add to the list of featured ideas, but I'm curious if it's possible to project liquid refraction onto walls?
Spoiler:
User avatar
Hey Doomer_
Posts: 446
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.0159b - better light & shadow

Post by Hey Doomer_ »

BROS_ETT_311 wrote: Mon Apr 17, 2023 5:10 pm Not to add to the list of featured ideas, but I'm curious if it's possible to project liquid refraction onto walls?
Spoiler:
Sorry, not sure what I'm looking at here.
User avatar
BROS_ETT_311
Posts: 219
Joined: Fri Nov 03, 2017 6:05 pm

Re: Relighting v4.0159b - better light & shadow

Post by BROS_ETT_311 »

Hey Doomer_ wrote: Mon Apr 17, 2023 5:27 pm Sorry, not sure what I'm looking at here.
Guess it's a little too subtle in the screenshots, but if you squint enough you should notice the water refracting onto the walls...It's honestly probably more noticeable in action.

Something like this -
Spoiler:
https://imgur.com/RBkh0ea
https://imgur.com/w7VnKPL

Return to “Gameplay Mods”