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
Hey Doomer_
Posts: 445
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.0165b - blurry shadows w/ rlassets

Post by Hey Doomer_ »

cosmos10040 wrote: Mon Sep 04, 2023 8:57 am Im struggling to understand the differences between relighting and relit, please explain in layman terms and also a short video / gif showing side by side. Either way it looks very interesting.
Fair enough, since this is all rather abstract thus far. I'll give it a go.

Relighting works with any mod, map, or game. It works as well in Strife as it does in Doom, for example. Performance varies depending on the map, and there are many constraints based on sector area, sector light level, and other user settings. One can pretty much make it look quite different with a few settings changed. I've taken that about as far as I want to.

Relit is a Relighting fork (think "Relighting Lite" - I might call it ReLite instead :idea: ). It works best with texture and flat brightmap mods. (RL, note, looks odd using these mods.) The only dynamic lights added are for wall textures. These effectively and (surprisingly) cheaply relight entire areas of the game, 2D bleeding and all. There are (so far) no limits.

Configuration is light to non-existent: don't add GLDEFS, there are no decorative light sources; don't add brightmaps, there are no texture lights or sector colors; don't add blurry shadows (this takes a few seconds to create, and I don't think I can distribute such modified assets), there are no shadows. Outdoor color is based on sky texture. Outdoor, missile, flashlight light sources are built in. That's about it. There are other things that can be done, such as sprite clipping and possible directional shadows, but those are just murky musings at present.

Hope that helps.
User avatar
Dan_The_Noob
Posts: 878
Joined: Tue May 07, 2019 12:24 pm
Graphics Processor: nVidia with Vulkan support

Re: Relighting v4.0165b - blurry shadows w/ rlassets

Post by Dan_The_Noob »

getting the weird bug with the subtract renderstyle again where the enemies show up white.
I think originally you added a setting to ignore lighting a sprite if it is subtract
cosmos10040
Posts: 190
Joined: Mon Dec 20, 2021 6:16 am
Graphics Processor: ATI/AMD (Modern GZDoom)

Re: Relighting v4.0165b - blurry shadows w/ rlassets

Post by cosmos10040 »

Hey Doomer_ wrote: Mon Sep 04, 2023 5:25 pm
cosmos10040 wrote: Mon Sep 04, 2023 8:57 am Im struggling to understand the differences between relighting and relit, please explain in layman terms and also a short video / gif showing side by side. Either way it looks very interesting.
Fair enough, since this is all rather abstract thus far. I'll give it a go.

Relighting works with any mod, map, or game. It works as well in Strife as it does in Doom, for example. Performance varies depending on the map, and there are many constraints based on sector area, sector light level, and other user settings. One can pretty much make it look quite different with a few settings changed. I've taken that about as far as I want to.

Relit is a Relighting fork (think "Relighting Lite" - I might call it ReLite instead :idea: ). It works best with texture and flat brightmap mods. (RL, note, looks odd using these mods.) The only dynamic lights added are for wall textures. These effectively and (surprisingly) cheaply relight entire areas of the game, 2D bleeding and all. There are (so far) no limits.

Configuration is light to non-existent: don't add GLDEFS, there are no decorative light sources; don't add brightmaps, there are no texture lights or sector colors; don't add blurry shadows (this takes a few seconds to create, and I don't think I can distribute such modified assets), there are no shadows. Outdoor color is based on sky texture. Outdoor, missile, flashlight light sources are built in. That's about it. There are other things that can be done, such as sprite clipping and possible directional shadows, but those are just murky musings at present.

Hope that helps.
I think that is very helpful, thank you for taking some time to explain the differences.
User avatar
Hey Doomer_
Posts: 445
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.0165b - blurry shadows w/ rlassets

Post by Hey Doomer_ »

Dan_The_Noob wrote: Tue Sep 05, 2023 7:51 am getting the weird bug with the subtract renderstyle again where the enemies show up white.
I think originally you added a setting to ignore lighting a sprite if it is subtract
That is odd. Nothing has changed affecting that. Where and when?
User avatar
Dan_The_Noob
Posts: 878
Joined: Tue May 07, 2019 12:24 pm
Graphics Processor: nVidia with Vulkan support

Re: Relighting v4.0165b - blurry shadows w/ rlassets

Post by Dan_The_Noob »

Hey Doomer_ wrote: Tue Sep 05, 2023 4:08 pm
Dan_The_Noob wrote: Tue Sep 05, 2023 7:51 am getting the weird bug with the subtract renderstyle again where the enemies show up white.
I think originally you added a setting to ignore lighting a sprite if it is subtract
That is odd. Nothing has changed affecting that. Where and when?
just anywhere that a subtract renderstyle gets applied (corruption cards, certain mod enemies etc)
User avatar
Hey Doomer_
Posts: 445
Joined: Tue Oct 18, 2022 1:59 am
Operating System Version (Optional): Windows 11
Graphics Processor: ATI/AMD with Vulkan/Metal Support

ReLite colors

Post by Hey Doomer_ »

More Progress

I've redone some of the color code. Texture names are not found if the texture is made up of patches, single or otherwise. It's surprising how many textures are made of a single patch. For now I've had to substitute names when deriving colors. This seems unavoidable especially with multiple patches (I only need to read one); it's not much code anyway. Examples:

MAP01 - start
MAP01 - large chamber

Note how the yellow color from the tech wall lights casts into the entryway. In the second image this can also be seen at the bottom of the image, while the window lamp color lights the top of the image. This uses the same color defaults from Relighting.
User avatar
Hey Doomer_
Posts: 445
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.0165b - blurry shadows w/ rlassets

Post by Hey Doomer_ »

Dan_The_Noob wrote: Tue Sep 05, 2023 5:45 pm
Hey Doomer_ wrote: Tue Sep 05, 2023 4:08 pm
Dan_The_Noob wrote: Tue Sep 05, 2023 7:51 am getting the weird bug with the subtract renderstyle again where the enemies show up white.
I think originally you added a setting to ignore lighting a sprite if it is subtract
That is odd. Nothing has changed affecting that. Where and when?
just anywhere that a subtract renderstyle gets applied (corruption cards, certain mod enemies etc)
I'm at a loss, offhand. This line in WorldThingSpawned should prevent what you describe:

Code: Select all

		if (e.thing.GetRenderStyle() == STYLE_Subtract)	PPShader.SetUniform1f("hd_shader", "rl_gamma", 0);
Does this still happen with the shader off?
User avatar
Dan_The_Noob
Posts: 878
Joined: Tue May 07, 2019 12:24 pm
Graphics Processor: nVidia with Vulkan support

Re: Relighting v4.0165b - blurry shadows w/ rlassets

Post by Dan_The_Noob »

Hey Doomer_ wrote: Wed Sep 06, 2023 4:26 am
Does this still happen with the shader off?
just checked, the shader off it goes away. shader on, subtracts are white.
so i guess that check is skipping them somehow?
User avatar
Hey Doomer_
Posts: 445
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.0165b - blurry shadows w/ rlassets

Post by Hey Doomer_ »

Dan_The_Noob wrote: Wed Sep 06, 2023 4:41 am
Hey Doomer_ wrote: Wed Sep 06, 2023 4:26 am
Does this still happen with the shader off?
just checked, the shader off it goes away. shader on, subtracts are white.
so i guess that check is skipping them somehow?
It should not if it worked before. Not sure why. :?
User avatar
Hey Doomer_
Posts: 445
Joined: Tue Oct 18, 2022 1:59 am
Operating System Version (Optional): Windows 11
Graphics Processor: ATI/AMD with Vulkan/Metal Support

ReLite color progress

Post by Hey Doomer_ »

Color Progress

Dived down the texture/patch lumps rabbit hole and used omgifol to create a class returning patches for any texture as a comma-separated string. This in turn can be split into an array for ZScript to use to create a composite texture color.

Code: Select all

# rlpatches.py

######################################################################################################################
# environment
from omg import *
from omg.txdef import *

wad = WAD('DOOM.WAD')

textures = Textures(wad.txdefs)
with open('wallpatch.zs', 'w') as f:
    f.write('class wallpatch\n')
    f.write('{\n')
    f.write('    Array<string> textures;\n')
    f.write('    Array<string> patches;\n')
    f.write('    wallpatch init()\n')
    f.write('    {\n')

    for texname, texture in textures.items():
        f.write('        self.textures.Push("' + texname + '"); self.patches.Push(')
        p = '"'
        for patch in texture.patches:
            p += patch.name + ','
        p = p[:-1]
        f.write(p + '");\n')

    f.write('        return self;\n')
    f.write('    }\n')
    f.write('    string getpatches(string s)\n')
    f.write('    {\n')
    f.write('        if (self.textures.Find(s) != self.textures.Size())\n')
    f.write('        {\n')
    f.write('            return self.patches[self.textures.Find(s)];\n')
    f.write('        }\n')
    f.write('        else\n')
    f.write('        {\n')
    f.write('            return "NOTFOUND";\n')
    f.write('        }\n')
    f.write('    }\n')
    f.write('}\n')

exit()
As POC this reads all patches, which is better for door frame markers for one (red door markers are now red, blue blue, etc). Example of colors:

E1M3 - colors

Note the blue to the left and white to the right. These are colors of dynamic lights attached to respective light strip textures defined as brightmaps. A user won't have to run this Python script; I'll include it in case other game brightmaps are available.

Still testing but that's the idea. 8-)
User avatar
Dan_The_Noob
Posts: 878
Joined: Tue May 07, 2019 12:24 pm
Graphics Processor: nVidia with Vulkan support

Re: Relighting v4.0165b - blurry shadows w/ rlassets

Post by Dan_The_Noob »

maybe for the purpose of lights, have the "brightness/saturation" cap out at a pale version of whatever colour it is, like a little beyond off-white.
User avatar
Hey Doomer_
Posts: 445
Joined: Tue Oct 18, 2022 1:59 am
Operating System Version (Optional): Windows 11
Graphics Processor: ATI/AMD with Vulkan/Metal Support

ReLite - endcam

Post by Hey Doomer_ »

More Progress - Added Endcam

Just a quick note that I've added my "endcam" mod to ReLite. Looks like this:

Example 1
Example 2

This mod installs oscillating security cameras at start, end, and midpoints of a level and shows these at the end in a way similar to Quake. Simple and pretty cool. 8-)

I've added all patch crosswalks for Doom flavors, Heretic, and Hexen to get correct patch colors.

I am finding random map runs of the same map where the game will stutter. I've not found any reason for this; profilethinkers doesn't show any difference in these cases that are obvious. There's simply not a much happening in this mod. It is certainly adding and doing far, far less than either version of Relighting. By comparison it's bare bones. What I'm seeing in loading the same map a number of times is that randomly the ms counter on my screen goes from low single digits to 30-40. I can't make it do it in the same maps and places.

Still investigating. Could be something as simple as a log file being too large. I doubt it's anything in this mod.
cortes2k
Posts: 36
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.0165b - blurry shadows w/ rlassets

Post by cortes2k »

As you know I'm obsessed with lights using your Relighting mod. The focus of this mod is shadows and not lights. Now I see you are working in a new project and looks really good. I once told you in another post an idea that you could use be use Relighting only for shadows and other mod for lights... I think this could be great, if both mods can runs toghether. Is it posible to run together right now only turning of lights in relighting? dheers.
User avatar
Hey Doomer_
Posts: 445
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.0165b - blurry shadows w/ rlassets

Post by Hey Doomer_ »

cortes2k wrote: Wed Sep 13, 2023 11:30 pm As you know I'm obsessed with lights using your Relighting mod. The focus of this mod is shadows and not lights. Now I see you are working in a new project and looks really good. I once told you in another post an idea that you could use be use Relighting only for shadows and other mod for lights... I think this could be great, if both mods can runs toghether. Is it posible to run together right now only turning of lights in relighting? dheers.
No need - the new mod includes shadows with improvements.
cortes2k
Posts: 36
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.0165b - blurry shadows w/ rlassets

Post by cortes2k »

Hey Doomer_ wrote: Fri Sep 15, 2023 10:26 am
cortes2k wrote: Wed Sep 13, 2023 11:30 pm As you know I'm obsessed with lights using your Relighting mod. The focus of this mod is shadows and not lights. Now I see you are working in a new project and looks really good. I once told you in another post an idea that you could use be use Relighting only for shadows and other mod for lights... I think this could be great, if both mods can runs toghether. Is it posible to run together right now only turning of lights in relighting? dheers.
No need - the new mod includes shadows with improvements.
OMY!!... I'm so exited to test the new one!...

Return to “Gameplay Mods”