ReLite

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: 448
Joined: Tue Oct 18, 2022 1:59 am
Operating System Version (Optional): Windows 11
Graphics Processor: ATI/AMD with Vulkan/Metal Support

ReLite Progress 0.6.2a

Post by Hey Doomer_ »

Progress 0.6.2a

Code: Select all

0.6.2
10/13 - fixed truncated double in shadow code
10/14 - added sprite color to decorative light routine
10/14 - exclude self as light source in shadow code
10/17 - added hd_png class to identify PNG images
10/20 - added converted Python zlib.decompress() for PNG pixel data (https://pyokagan.name/blog/2019-10-18-zlibinflate/)
10/22 - added brightmap exclusion criteria
10/22 - removed placement and colorizing exclusions
10/22 - corrected casting sprites in shadow
10/23 - corrected shade() function to keep same hue
10/23 - excluded light source textures from colorization
10/25 - added hsv criteria to keep function
10/26 - corrected patch color reading function
Despite the list of changes this is mostly bug fixes, some of which date back to original Relighting functions. Removing limits exposed flaws in color reading e.g. weird purple colors, etc. I tracked this to my patch color reading function and refactored this to match pseudocode here. Terribly obvious but one of those things :roll: . Adding saturation criteria to the color keep function also helps it return pure colors. Here are examples of corrected colors:

e1m6
e2m2
e2m7
e4m2
map04
map04

Note white lights are actually white and cast white light as expected. Current colorization is only 12 degrees of hue, which I will likely double in a future release. (This is easy and involves editing the gldefs file.)

Release likely in a few days. 8-)
cosmos10040
Posts: 196
Joined: Mon Dec 20, 2021 6:16 am
Graphics Processor: ATI/AMD (Modern GZDoom)

Re: ReLite

Post by cosmos10040 »

I can no longer play doom without this mod 😂
User avatar
Airehnr66
Posts: 19
Joined: Sun Nov 27, 2022 6:04 pm
Preferred Pronouns: He/Him
Operating System Version (Optional): Linux(ChimeraOS), macOS 14.4(Sonoma)
Graphics Processor: Not Listed

Re: ReLite

Post by Airehnr66 »

I've been meaning to play through Doom I, II, and Final Doom again lately, but I'm honestly just holding off until this next release now!
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

ReLite 0.6.2a Released

Post by Hey Doomer_ »

Just posted 0.6.2a

This is mostly bug fixes, and some of those date back to original Relighting code. These include refactoring how patch files are read, correcting colors, and correcting miscellaneous shadow-related issues. Generally the top third of decorative sprites are read for color, and this produces purer colors for torches. I've also added a library that reads PNG files (including decompressing the image itself); for this version it reads and analyzes brightmap files to exclude textures as light sources.

The options menu has been greatly simplified. One thing I've done is added sliders for bias lighting so you can adjust how dark or bright levels are. I've chosen defaults that are somewhat brighter and allow colors to stand out.

This has been tested with Ultimate Doom, Doom II, Sigil, and a handful of other maps and mods. It has only been tested with bmplustextures; I will write a regex engine for the next version to be able to more easily read text files. Anyway very likely there are bugs even though I have greatly improved the code and performance in this version.

Many thanks for your interest and support!
cosmos10040
Posts: 196
Joined: Mon Dec 20, 2021 6:16 am
Graphics Processor: ATI/AMD (Modern GZDoom)

Re: ReLite

Post by cosmos10040 »

Okay time for report, so the game hangs on E1M1, not sure why, I can't even load up the log, says not enough memory! However it runs just fine on doom 2. I tried it with no rest for the living and got some errors:


----------------------------------------

NV_MAP01 - The Earth Base

xlat/doom.txt, line 42: syntax error
PIPEWAL1 fails signature
PIPEWAL1 fails signature
SPCDOOR1 Only color types 0, 2, 4, 6 supported
PIPEWAL1 fails signature
PIPEWAL1 fails signature
VM execution aborted: array access out of bounds. Size = 30, current index = 256

Called from hd_png.inflate_block_data at relite_0.6.2a.pk3:zscript/hd_image.zs, line 535
Called from hd_png.inflate_block_dynamic at relite_0.6.2a.pk3:zscript/hd_image.zs, line 449
Called from hd_png.inflate at relite_0.6.2a.pk3:zscript/hd_image.zs, line 392
Called from hd_png.decompress at relite_0.6.2a.pk3:zscript/hd_image.zs, line 365
Called from hd_png.read_chunk_data at relite_0.6.2a.pk3:zscript/hd_image.zs, line 320
Called from hd_png.Init at relite_0.6.2a.pk3:zscript/hd_image.zs, line 175
Called from hd_relite_Events.add_textures at relite_0.6.2a.pk3:zscript/hd_relite_events.zs, line 444
Called from hd_relite_Events.find_textures at relite_0.6.2a.pk3:zscript/hd_relite_events.zs, line 467
Called from hd_relite_Events.WorldLoaded at relite_0.6.2a.pk3:zscript/hd_relite_events.zs, line 34
]
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: ReLite

Post by Hey Doomer_ »

cosmos10040 wrote: Sat Oct 28, 2023 12:20 pm Okay time for report, so the game hangs on E1M1, not sure why, I can't even load up the log, says not enough memory! However it runs just fine on doom 2. I tried it with no rest for the living and got some errors:


----------------------------------------

NV_MAP01 - The Earth Base

xlat/doom.txt, line 42: syntax error
PIPEWAL1 fails signature
PIPEWAL1 fails signature
SPCDOOR1 Only color types 0, 2, 4, 6 supported
PIPEWAL1 fails signature
PIPEWAL1 fails signature
VM execution aborted: array access out of bounds. Size = 30, current index = 256

Called from hd_png.inflate_block_data at relite_0.6.2a.pk3:zscript/hd_image.zs, line 535
Called from hd_png.inflate_block_dynamic at relite_0.6.2a.pk3:zscript/hd_image.zs, line 449
Called from hd_png.inflate at relite_0.6.2a.pk3:zscript/hd_image.zs, line 392
Called from hd_png.decompress at relite_0.6.2a.pk3:zscript/hd_image.zs, line 365
Called from hd_png.read_chunk_data at relite_0.6.2a.pk3:zscript/hd_image.zs, line 320
Called from hd_png.Init at relite_0.6.2a.pk3:zscript/hd_image.zs, line 175
Called from hd_relite_Events.add_textures at relite_0.6.2a.pk3:zscript/hd_relite_events.zs, line 444
Called from hd_relite_Events.find_textures at relite_0.6.2a.pk3:zscript/hd_relite_events.zs, line 467
Called from hd_relite_Events.WorldLoaded at relite_0.6.2a.pk3:zscript/hd_relite_events.zs, line 34
]
The "fails signature" error means whatever file this is has an invalid header for a PNG. Are you running this with bmplus_textures? If so PIPEWAL1 is a valid PNG.

No idea why it hangs on E1M1 in Doom. I didn't test on the above mod. But I'll check it out!
cosmos10040
Posts: 196
Joined: Mon Dec 20, 2021 6:16 am
Graphics Processor: ATI/AMD (Modern GZDoom)

Re: ReLite

Post by cosmos10040 »

Yes I'm using bmp_textures. I'm using violent Doom with legion monster pack. I will try again, I have other graphical mods running like flat textures glow and probably something else, I will do a process of elimination to see what cause e1m1 to hang.
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: ReLite

Post by Hey Doomer_ »

cosmos10040 wrote: Sat Oct 28, 2023 3:06 pm Yes I'm using bmp_textures. I'm using violent Doom with legion monster pack. I will try again, I have other graphical mods running like flat textures glow and probably something else, I will do a process of elimination to see what cause e1m1 to hang.
I loaded NRFTL NV_MAP01 without errors.

Note --

ReLite reads brightmaps for textures and flats that exist on a map. In this version only brightmap PNGs are analyzed to exclude textures or flats from being light sources. My parsing routine to extract filenames has tested successfully with bmplus, hence my question. It doesn't look like NERVE.WAD has brightmaps, so perhaps it is another mod?

In this version all textures, flats, and sprites are read from WAD lumps and not from PNG images. My PNG class can handle it, I just need to know where to find them. I am adding a basic regex engine to fix that (ZScript lacks regex support, just like it lacks zlib support), because many additional graphics are configured in text files. Parsing a text file is normally extremely messy, but regex is specifically designed to handle variations by searching for text patterns.
cosmos10040
Posts: 196
Joined: Mon Dec 20, 2021 6:16 am
Graphics Processor: ATI/AMD (Modern GZDoom)

Re: ReLite

Post by cosmos10040 »

Hey Doomer_ wrote: Sat Oct 28, 2023 3:09 pm
cosmos10040 wrote: Sat Oct 28, 2023 3:06 pm Yes I'm using bmp_textures. I'm using violent Doom with legion monster pack. I will try again, I have other graphical mods running like flat textures glow and probably something else, I will do a process of elimination to see what cause e1m1 to hang.
I loaded NRFTL NV_MAP01 without errors.

Note --

ReLite reads brightmaps for textures and flats that exist on a map. In this version only brightmap PNGs are analyzed to exclude textures or flats from being light sources. My parsing routine to extract filenames has tested successfully with bmplus, hence my question. It doesn't look like NERVE.WAD has brightmaps, so perhaps it is another mod?

In this version all textures, flats, and sprites are read from WAD lumps and not from PNG images. My PNG class can handle it, I just need to know where to find them. I am adding a basic regex engine to fix that (ZScript lacks regex support, just like it lacks zlib support), because many additional graphics are configured in text files. Parsing a text file is normally extremely messy, but regex is specifically designed to handle variations by searching for text patterns.
I think I found the culprit, I removed doom prb 256, it did not hang or crash after that. Also removed doom HD textures, as there were slight fps drop.
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

ReLite WIWO 0.6.3a

Post by Hey Doomer_ »

WIWO 0.6.3a

Code: Select all

0.6.3
10/28 - added PLTE chunk to hd_png
10/29 - added converted Python Regex-Engine (https://github.com/BertilBraun/Regex-Engine/tree/main/src)
The PLTE chunk is a palette chunk before the IDAT compressed blocks containing the pixel data. All color types are now supported, and this has been debugged. Interestingly this is very similar to the LMP format for Doom images.

I've added converted Python code for a regex engine, and this tests OK. This has to be modified to account for a ZScript parsing bug when terminating a string with a backslash. The escape character will be a forward slash, and I'll convert backslashes to forward for search purposes. What this will do is search for patterns in text files and make allowances for small variations in how text is written. My current implementation is to assume everything is formatted like bmplus_textures e.g.

Code: Select all

brightmap texture blodgr1  { map "brightmaps/textures/doom/blodrip1.png" iwad }
But here's Brutal Doom, for example:

Code: Select all

brightmap texture BLODGR1
{
	map "brightmaps/doom/Textures/BLODRIP1.png"
	//iwad
}
These and other differences can be eliminated using regex patterns (for those not familiar with regex). I'm not sure if I'll implement this by 0.6.3, but the engine is in place.

Since I am reading brightmaps, I can interpret where lights are on the texture. Consider this image, which has visible point lights on metal. The reason for this is these textures are METAL7, which has a light bar on the bottom of the texture that isn't visible. I can now locate where those lights are and a) not add a light if the light isn't visible as in the screenshot or b) add the light on the light source if it is instead of the middle of the texture.

I'll be working on that for 0.6.3, since that should be simple.
cortes2k
Posts: 40
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: ReLite

Post by cortes2k »

Hi dude. I've tested new version but I can't do it as I wish.
When I try to load the E1M1 the music start but not the level, then I restart and uncheck the normals, pbr, and hd textures, some times level starts and looks great, thenk I use idclev to select new level E2M2 and level never starts, then restarted the gzdoom widhout brutal doom platinum, normal doom guy, level stats normal, idclev to E2M2 ok, E2M5 ok but when I try with BD, Platinum, Black Edition, using idclev, gzdoom freezes. I tested several times changing the loading order of the ReLite with different rerults, sometimes freezes sometimes works. Playing Doom II looks more playable but If I try my own custom map, level never starts. Tested with latest gzdoom dev. ver. and final 4.11.1 stable ver. Last test I used BD Platinum, Ultimate Doom Visor, DOOM_PBR_512, LPT V6.8, flashlight_plus_v8_5, LiveReverb, Damage Direction Indicator, works great until I finished E2M4, when doom tries to load E2M5 music start but level never starts. Cheers... great new lights looks very natural, great job. Some pics here https://imgur.com/a/aA3iKTo I think has some issues with BD

I tried using all my stuff like DKs Textures, DHTP+PBR, DOOM_PBR_512, DHTP_normals, Ultimate doom visor, etc., etc., but without Brutal doom... I could play without problems images here https://imgur.com/a/9sivPlj using idclev in all these levels, all levels started without problems even E2M5. Cheers.
cortes2k
Posts: 40
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: ReLite

Post by cortes2k »

I noticed another thing, in my custom map I set some lights aroun an area, and I see lights in the texture, great, but, there is no light in some of them and other links are out of the "lamp", the light is set at the middle of the texture, is this an issue you are going to fix?, other thing I see is that yellow and red scull texture has light but the blue one not, is the texture missplace? images here https://imgur.com/a/BweAQn1
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: ReLite

Post by Hey Doomer_ »

cortes2k wrote: Sun Oct 29, 2023 7:09 pm Hi dude. I've tested new version but I can't do it as I wish.
When I try to load the E1M1 the music start but not the level, then I restart and uncheck the normals, pbr, and hd textures, some times level starts and looks great, thenk I use idclev to select new level E2M2 and level never starts, then restarted the gzdoom widhout brutal doom platinum, normal doom guy, level stats normal, idclev to E2M2 ok, E2M5 ok but when I try with BD, Platinum, Black Edition, using idclev, gzdoom freezes. I tested several times changing the loading order of the ReLite with different rerults, sometimes freezes sometimes works. Playing Doom II looks more playable but If I try my own custom map, level never starts. Tested with latest gzdoom dev. ver. and final 4.11.1 stable ver. Last test I used BD Platinum, Ultimate Doom Visor, DOOM_PBR_512, LPT V6.8, flashlight_plus_v8_5, LiveReverb, Damage Direction Indicator, works great until I finished E2M4, when doom tries to load E2M5 music start but level never starts. Cheers... great new lights looks very natural, great job. Some pics here https://imgur.com/a/aA3iKTo I think has some issues with BD

I tried using all my stuff like DKs Textures, DHTP+PBR, DOOM_PBR_512, DHTP_normals, Ultimate doom visor, etc., etc., but without Brutal doom... I could play without problems images here https://imgur.com/a/9sivPlj using idclev in all these levels, all levels started without problems even E2M5. Cheers.
Thanks for the updates! This looks like an issue with Brutal Doom Black Edition. (I've only tested this with BD21.) I'll have to troubleshoot what the issue is.

PBR and hi-res textures won't affect ReLite. 0.6.2 ignores PNG textures that are not brightmaps. (See edit below)

As far as your other post and image, I don't think it's possible to change how point lights look next to hi-res textures in GZDoom. Likely some are missing because of text formatting issues I've mentioned.

Edit

The BDBE problem is decorative lights read from GLDEFS. This could be a sprite naming issue, possibly an embedded class name; I'll have to look into this further but I have a comment in my code about this as an issue. You can get around this by commenting out this line in WorldLoaded() of hd_relite_Events.zs:

Code: Select all

//		add_decorativelights();
This means decorative lights (torches, lamps, etc) won't cast shadows or light nearby textures but won't affect anything else.

Edit

The problem is the BDBE GLDEFS points to a sprite in PNG format, something not yet implemented. I've added a workaround for the next version, as it may be a bit before I analyze PNG files.
cortes2k
Posts: 40
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: ReLite

Post by cortes2k »

Ok dude.
I already applied the comment at the code you said.
// add_decorativelights();
And now I can test the usual levels including my own map and works!. https://imgur.com/a/oyC19LJ
Testing with classic doom not BD at the left side and BD Platinum at the right side, I really didn't see any difference only at the barres of the E2M2 map, I can see a glowing green color around the area, look cool but using Patinum Ed. unfortunately the green color gone. 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

ReLite Progress 0.6.3a

Post by Hey Doomer_ »

Progress 0.6.3a

Code: Select all

0.6.3
10/28 - added PLTE chunk to hd_png
10/29 - added converted Python Regex-Engine (https://github.com/BertilBraun/Regex-Engine/tree/main/src)
10/30 - added temporary check for sprite namespace
10/31 - added light placement exclusion based on brightmaps
Light placement exclusion is an interesting tweak. The center of the texture light is known from counting the number of lights per column and row per brightmap, and the height of the sector where the texture is placed is known. Ignoring x/y offsets and scaling (for now :) ) it's a simple calculation to determine if a light can be seen or not. METAL7 in MAP03, which has a light source on the bottom of the texture, is a good POC:

map03

Placing light accurately is slightly more complicated, since this may involve moving x along a vector; not all light sources are horizontally centered. But most are, so I'll likely ignore that for the next release that will otherwise also include mostly accurate placement of dynamic lights on textures. 8-)

Release "soon."

Many thanks for your testing, comments, and interest!

Return to “Gameplay Mods”