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
MsrSgtShooterPerson
Posts: 50
Joined: Thu Jan 02, 2020 1:59 am
Location: Lost in the procedural infinite hells and I'm fine with that.

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

Post by MsrSgtShooterPerson »

Hey Doomer, I have a question - how are sectors under sky ceilings colored? I am mostly playing WAD's with custom sky textures but it looks like the outdoor ambience is still tinted by vanilla sky textures. Is there a way for those to perhaps sample the average color or the most saturated pixel color in a custom skybox if one's in use?
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.0159b - better light & shadow

Post by Hey Doomer_ »

MsrSgtShooterPerson wrote: Tue Apr 18, 2023 8:09 am Hey Doomer, I have a question - how are sectors under sky ceilings colored? I am mostly playing WAD's with custom sky textures but it looks like the outdoor ambience is still tinted by vanilla sky textures. Is there a way for those to perhaps sample the average color or the most saturated pixel color in a custom skybox if one's in use?
At present this isn't a fancy thing and just looks at the level's sky texture. Do you have an example of a custom sky texture? I'll check it out. I'll have to look at this in more detail to expand compatibility.
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.0159b - better light & shadow

Post by Hey Doomer_ »

BROS_ETT_311 wrote: Mon Apr 17, 2023 6:11 pm
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
Oh I see what you mean. That may be possible to emulate with dynamic lights similar to what I attempted in the previous version of Relighting.
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.0159b - better light & shadow

Post by Hey Doomer_ »

cosmos10040 wrote: Mon Apr 17, 2023 5:46 am In addition to the request above, how about having the blue/red/yellow posts by the key doors glow?
Honestly I keep going back and forth on these key indicator issues that are mentioned. It's pretty cool to see Relighting work in Doom, Freedoom, Heretic, Hexen, Strife, HACX, and anything that runs on GZDoom, but exception coding that specifically targets one game takes away from that universal application.

However, it's not impossible. Still thinking about this and comments noted. It may take looking at the other games in detail, since the only game I've personally played at length is Doom.

I really appreciate all feedback and comments! That's a big help, since as the person writing the mod I tend to focus and test whatever it is I've coded. I'm probably not the best judge of how all this works in game.
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.0159b - better light & shadow

Post by Hey Doomer_ »

thugsta wrote: Mon Apr 17, 2023 10:28 am 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.
These are great ideas although likely outside the scope of this mod. I'm trying to avoid adding assets.

What does "small light textures to have lens flares/halo's" mean? Just curious.
User avatar
MsrSgtShooterPerson
Posts: 50
Joined: Thu Jan 02, 2020 1:59 am
Location: Lost in the procedural infinite hells and I'm fine with that.

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

Post by MsrSgtShooterPerson »

Hey Doomer_ wrote: Tue Apr 18, 2023 6:36 pm At present this isn't a fancy thing and just looks at the level's sky texture. Do you have an example of a custom sky texture? I'll check it out. I'll have to look at this in more detail to expand compatibility.
Ah, it's nothing complex, just having custom skybox textures entirely - I'm one of the devs on Obsidian Level Generator so I believe the tricky part is that the skyboxes are procedurally generated (based on noise) and different textures appear entirely on different episodes. If it already references sky textures, maybe something's wrong on our end (custom skybox textures are added in patch lumps and redundantly referenced in MAPINFO)

Here are some generated examples:

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.0159b - better light & shadow

Post by Hey Doomer_ »

MsrSgtShooterPerson wrote: Tue Apr 18, 2023 7:50 pm Ah, it's nothing complex, just having custom skybox textures entirely - I'm one of the devs on Obsidian Level Generator so I believe the tricky part is that the skyboxes are procedurally generated (based on noise) and different textures appear entirely on different episodes. If it already references sky textures, maybe something's wrong on our end (custom skybox textures are added in patch lumps and redundantly referenced in MAPINFO)
Thanks, I'll check it out!
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.0159b - better light & shadow

Post by Hey Doomer_ »

Dan_The_Noob wrote: Sun Apr 16, 2023 8:33 pm if i had to suggest 1 exception, it'd be keybar lights.
maybe add a separate, weaker, coloured light for keybars?
I've had a look at this, and I wonder if this can also be done with line actions, which are keyed to color and may be simpler than maintaining a list of textures. I'll have a look at other games using the engine to see how consistent this is. Thanks!

Edit

I tried it. It's possible to detect the more popular games and their specific line actions. However, doors aren't necessarily recessed or even in the same sector as the line action. I did get this working, and it was underwhelming and looked completely out of place. Mapped assets made this pop in the old Relighting, note. More and more it's looking like a short list of textures is needed for this, although I haven't tried reading a texture looking for patterns associated with such textures. Reading an unknown texture is one thing, but if I expect a dominant color range in a texture in a regular pattern that's different.

Maybe. I've also been thinking of this because of textures that are primary colors, such as the red wall texture in E2M1 (and fire textures in other maps). That could be a light source, although Relighting doesn't have any logic to assume so. Similarly there are greenish "moldy" textures that could glow with a phosphorescence. Etc. (And so you see the list of textures grows. :lol: ) There may be more value in extracting the most common colors in a texture and making some assumptions depending on what the other colors are. I'll think about this, since that is a more universal solution.
Last edited by Hey Doomer_ on Wed Apr 19, 2023 4:13 pm, edited 1 time in total.
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.0159b - better light & shadow

Post by Hey Doomer_ »

More Light and Shadow - v4.0160b

Another progress report. This is looking very good in every game I've tried, although I haven't tested that extensively.

map02
map04

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
4/19 - fixed sector light adjustment for baked lighting, added sprite light adjustment for shadow length
Areas previously too dark are more realistically lit as seen above. This is noticeable in most areas. In some cases this is due to texture lights, noticeable on either side of the window in MAP04 (note the shadow moving!), but it's also new calculations adjusting sector light levels after baking (both of the above). I've also added an adjustment for sprite light levels based on shadow length itself (probably faster than re-calculating light levels), although at present texture lights are excluded from casting shadows for performance reasons. Currently I'm testing a minimum distance from a light to bake a texture, since the dynamic light itself casts a light; this prevents doorway and window anomalies in certain areas. The amount of code is about the same, as I have replaced a few irrelevant blocks previously used to fudge lighting with simpler calculations. Also as I understand sidedef lighting increasing sector light levels can make baked lighting more apparent.

Many thanks for suggestions and comments! Release "soon." 8-)
Skrell
Posts: 351
Joined: Mon Mar 25, 2013 11:47 am

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

Post by Skrell »

This is easily looking to be the best release yet! Any ETA??
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.0159b - better light & shadow

Post by Hey Doomer_ »

Skrell wrote: Wed Apr 19, 2023 7:26 pm This is easily looking to be the best release yet! Any ETA??
Possibly later today or tomorrow. Testing looks good. I'm testing shadow maps now. I normally code and test without shadow maps turned on, because I'm avoiding creating effects that depend on them. But this looks good.

e1m3

Note the sergeant shadow isn't triggered by the texture lights to the right; this is deliberate to reduce thinker cycles. For these actors args[0] is set to 0 (a sector light source), 1 (a decorative light source), or 2 (a texture light); each is handled slighting differently. All lights are the same actors with the same StatNum that can only be changed at BeginPlay(). So at present the texture lights are for baking and candy.
cosmos10040
Posts: 164
Joined: Mon Dec 20, 2021 6:16 am
Graphics Processor: ATI/AMD (Modern GZDoom)

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

Post by cosmos10040 »

Hey Doomer_ wrote: Tue Apr 18, 2023 6:45 pm
cosmos10040 wrote: Mon Apr 17, 2023 5:46 am In addition to the request above, how about having the blue/red/yellow posts by the key doors glow?
Honestly I keep going back and forth on these key indicator issues that are mentioned. It's pretty cool to see Relighting work in Doom, Freedoom, Heretic, Hexen, Strife, HACX, and anything that runs on GZDoom, but exception coding that specifically targets one game takes away from that universal application.

However, it's not impossible. Still thinking about this and comments noted. It may take looking at the other games in detail, since the only game I've personally played at length is Doom.

I really appreciate all feedback and comments! That's a big help, since as the person writing the mod I tend to focus and test whatever it is I've coded. I'm probably not the best judge of how all this works in game.
Good points, it's great it works with other games, I did not know the focus was universal. But if you ever feel a need to make something specific for Doom I think that would be a nice touch.
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.0160b - texture lights

Post by Hey Doomer_ »

Posted v4.0160b - texture lights

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
4/19 - fixed sector light adjustment for baked lighting, added sprite light adjustment for shadow length
4/20 - added texture light factor to menu for light placement
In addition to the above, I've exposed the "texture light factor" in settings. Texture lights are applied according to the size and light level of a sector compared to back sectors. A lower light factor results in more texture lights and vice versa. I've set this for demonstration at 1.025 (originally this was 1.10). So this is one way to add light to the game depending on the game and personal taste. As primarily a programmer and not a gamer I've no idea what works best with what game. The default value adds light without any obvious source in Doom II (nothing new). However, I have looked at most Doom levels, many Heretic and Hexen levels, and Strife. This all looks OK.

Many thanks and let me know what you think!
Skrell
Posts: 351
Joined: Mon Mar 25, 2013 11:47 am

Re: Relighting v4.0160b - texture lights

Post by Skrell »

Can I assume if I use a voxel item pikcup mod, the light emanating from the pickups will still apply to the walls?
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.0160b - texture lights

Post by Hey Doomer_ »

Skrell wrote: Fri Apr 21, 2023 1:15 pm Can I assume if I use a voxel item pikcup mod, the light emanating from the pickups will still apply to the walls?
If this is in reference to sidedef light baking, then no. The light source actors are applied in the POIs of target sectors and temporarily along its 2-sided lines. Others are attached to decorative light objects, that is solid non-inventory items such as column lights, torches, etc. A third category is texture lights. All are separate from items with attached dynamic lights such as inventory pickups, missiles, etc.

Return to “Gameplay Mods”