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

Re: another error

Post by Hey Doomer_ »

STRVACT wrote: Tue Jul 02, 2024 7:10 am hello! I tried to play nostalgia wad with your amazing mod and throughout 10 maps everything was OK, but when you are trying to access map11 you will get following error

MAP11 Rapture
UM execution aborted: tried to read from address zero.
Called from hd_shadow.PostBeginPlay at
relite_0.6.7a.pk3:zscript/hd_shadowactors.zs, line 173

I'm using gzdoom 4.11.3 and I can't try 4.12 because ima playing on delta touch but anyways I think this information can be useful for you bc glad to know that you still working on this mod because of release date of 0.6.7 I thought that you abandoned developing but fine to know that you still keep going
Thanks! I've made a note to account for that. It's been a while since I've looked at this.
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

Progress 0.6.8 a

Post by Hey Doomer_ »

Progress 0.6.8 a

Changelog:
Spoiler:
The isLight() function is basic but effective and uses the HSV color wheel to determine what kind of color a texture "mostly" returns based on menu options.

Code: Select all

	bool isLight(Color c, int width)
	{
		bool blight = (c.r == c.g && c.r == c.b && perceived(Color(c.r, c.g, c.b)) >= rl_perceived);
		double hue, saturation, value;
		[hue, saturation, value] = get_hsv(c);
		bool byellow = hue >= 40 && hue <= 80;
		bool bred = hue >= 350 || hue <= 10;
		bool bgreen = hue >= 100 && hue <= 140; 
		bool bblue = hue >= 220 && hue <= 260; 

		return (blight || bred || bgreen || bblue || byellow);
	}
If a texture is a "light" and kept color is greater than 50% of the total bright pixels enough to count as a color and that total exceeds 5% of total pixels (textures are different sizes), then the texture gets a light size. Simple. :lol:

Here is the new menu, complete with footer tool tips. These options interact somewhat unpredictably as one can imagine. "Color Globals" affects how light/color is found, attached to textures and flats, and dispersed. Honestly I haven't played with these settings all that much and these are my original defaults with the exception of "Additive Darkness," which is lowered to 0.25 from 0.40.

Two options affect performance: Light Strength (higher kills performance), Max Light Dispersement (yeah, should be Dispersion... if turned off performance improves). I suppose other settings can be tweaked to eliminate textures or flats as sources of light, which would also help. All depends.

Release "soon"
Skrell
Posts: 362
Joined: Mon Mar 25, 2013 11:47 am

Re: ReLite

Post by Skrell »

Can't wait!
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

Final Testing 0.6.8a

Post by Hey Doomer_ »

Almost done with current changes. There have been many tweaks and improvements, mostly to default values and miscellaneous color coding. For example, I have reduced the intensity of animated textures by rl_additive. I have also added a non-menu variable called rl_debug that will tell you in the console what textures and flats are used as light sources. I have used this for troubleshooting in tweaking menu variables. So far it looks pretty good in Doom and elsewhere:

Doom E3M5
Hexen MAP01

Mind you this represents a major overhaul in terms of light sourcing. Everything is based on texture colors and perceived brightness of those colors. Texture brightmaps can be used and will likely align with my default settings that are "calibrated" to Doom. I don't really play Heretic or Hexen; I can imagine these would need different default settings.

Release likely tomorrow.
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.8a Released

Post by Hey Doomer_ »

Changelog:

Code: Select all

0.6.8
5/27 - added CVars for decorative, texture, flat lights
6/19 - added flat and texture criteria to accept a pixel as a "light"
6/21 - fixed hard-coded animated texture and flat criteria (Doom only)
6/22 - texture/flat lights itself
6/26 - added menu options for light strength, palette adjustment, additive darkness, and light "keep" paramaters
7/3 - added a saturate function and parameters in options for maxlight, saturation, and shade/saturate palette adjustment
7/4 - corrected rl_additive functions, other minor bug fixes in hd_relite_Events code
7/6 - added menu tooltips
7/13 - reduced Side.Top, Side.Bottom light strength, tweaked defaults
As noted many improvements and tweaks. Attaching lights no longer relies on brightmaps.

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

Re: ReLite

Post by cosmos10040 »

It's looks great! I did however noticed some
Lights are red when I thought they might just be white. Maybe I'm doing something wrong or another mod causing it? I could take a screenshot if needed.

Loads great with small maps and medium maps. Large maps still takes a while or does not load on a mobile device, maybe a way to figure out how to reduce number of texture lights or just keep it within a distance or player? im not sure how to suggest improvement , i dont even understand lol. But overall I like the performance and look. Great job.
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: Wed Jul 17, 2024 8:38 am It's looks great! I did however noticed some
Lights are red when I thought they might just be white. Maybe I'm doing something wrong or another mod causing it? I could take a screenshot if needed.

Loads great with small maps and medium maps. Large maps still takes a while or does not load on a mobile device, maybe a way to figure out how to reduce number of texture lights or just keep it within a distance or player? im not sure how to suggest improvement , i dont even understand lol. But overall I like the performance and look. Great job.
Thanks! :)

A screenshot would help. The color settings should catch most lights, but it all depends.

Larger maps with more sectors and more walls will take longer. You can try turning off even or all bias lighting, which loops through all sectors and back sectors to adjust sector lighting. Turning off max lighting and lowering the size of lights will also improve performance.
cosmos10040
Posts: 193
Joined: Mon Dec 20, 2021 6:16 am
Graphics Processor: ATI/AMD (Modern GZDoom)

Re: ReLite

Post by cosmos10040 »

I think it's fine, might have some other addon changing the colors randomly.
Zaibatsu64
Posts: 19
Joined: Sun Nov 27, 2022 9:35 am

Re: ReLite

Post by Zaibatsu64 »

Great work as always! This astonishingly clever mod deserves a lot more attention.

There's one issue I notice, although I'm not sure that it could be easily resolved. Imagine that you had two sectors of equivalent brightness or value, and one of the sectors had coloured light. The brightness of that sector with coloured light would be darker than the sector that didn't have the coloured light. Adding any colour to a white light inherently makes it darker. This has the result that some light sources in game are actually darkening their surroundings. In real life, light sources are additive so would only add brightness.

To use another example, if you're playing on one of the hell levels with a red sky, anything considered an indoor sector such as an overhang or cave will appear to have a white light relative to the outdoor sectors. The indoor sectors will be significantly brighter than the outdoor sectors, even though the only light source in the scene may be the sky.

I wonder if it would be possible to have the coloured sector lights work in an additive way, where they can only add brightness to a scene and not subtract it. It may be necessary to compress and clamp down the other values so that there's room to add value.

Hopefully I've been able to explain myself clearly, and I'd be happy to provide some screenshots if needed. Many thanks again for your excellent work!
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_ »

Zaibatsu64 wrote: Sat Jul 27, 2024 2:27 am Great work as always! This astonishingly clever mod deserves a lot more attention.

There's one issue I notice, although I'm not sure that it could be easily resolved. Imagine that you had two sectors of equivalent brightness or value, and one of the sectors had coloured light. The brightness of that sector with coloured light would be darker than the sector that didn't have the coloured light. Adding any colour to a white light inherently makes it darker. This has the result that some light sources in game are actually darkening their surroundings. In real life, light sources are additive so would only add brightness.

To use another example, if you're playing on one of the hell levels with a red sky, anything considered an indoor sector such as an overhang or cave will appear to have a white light relative to the outdoor sectors. The indoor sectors will be significantly brighter than the outdoor sectors, even though the only light source in the scene may be the sky.

I wonder if it would be possible to have the coloured sector lights work in an additive way, where they can only add brightness to a scene and not subtract it. It may be necessary to compress and clamp down the other values so that there's room to add value.

Hopefully I've been able to explain myself clearly, and I'd be happy to provide some screenshots if needed. Many thanks again for your excellent work!
Wow!! Thanks for your comments!

I'm not a photographer or anything similar, but it seems that your observations about color are generally correct. Perhaps menu options to clamp color effect is one solution.

ReLite applies color to sectors with ceiling flats that are lights and outside sectors; a blend or lighter shade of color "bleeds" to adjacent sectors with a lower ceiling value. I've simplified this since map geometry varies crazily. Walls are colorized by light sources; like sectors this is all or nothing. Dynamic lights - pretty as they are - are a limited source of color and light for performance and aesthetic reasons. Dynamic lights all attenuate, which creates more realistic (albeit dimmer) light. (Additive dynamic lights wash everything out and look unrealistic.)

Sector light levels in colored sectors are adjusted by color lux and "additive darkness" from menu options. AD and bias lighting adjust all lighting. Most menu options affect color and lights.

But sure post screenshots and I'll try to explain what's happening more specifically.
Zaibatsu64
Posts: 19
Joined: Sun Nov 27, 2022 9:35 am

Re: ReLite

Post by Zaibatsu64 »

Hey Doomer_ wrote: Sat Jul 27, 2024 4:45 am Wow!! Thanks for your comments!

I'm not a photographer or anything similar, but it seems that your observations about color are generally correct. Perhaps menu options to clamp color effect is one solution.

ReLite applies color to sectors with ceiling flats that are lights and outside sectors; a blend or lighter shade of color "bleeds" to adjacent sectors with a lower ceiling value. I've simplified this since map geometry varies crazily. Walls are colorized by light sources; like sectors this is all or nothing. Dynamic lights - pretty as they are - are a limited source of color and light for performance and aesthetic reasons. Dynamic lights all attenuate, which creates more realistic (albeit dimmer) light. (Additive dynamic lights wash everything out and look unrealistic.)

Sector light levels in colored sectors are adjusted by color lux and "additive darkness" from menu options. AD and bias lighting adjust all lighting. Most menu options affect color and lights.

But sure post screenshots and I'll try to explain what's happening more specifically.
Thanks for your reply. I appreciate your time, and hope I'm not being bothersome.

https://postimg.cc/QBw470mG

https://i.postimg.cc/GhcLxbK0/image.png

Here are a couple of screenshots. The first screenshot demonstrates the colour of the outdoor sectors bleeding in to the adjacent sectors and getting progressively lighter. Maybe the ceiling flat texture is being interpreted as a light source. I wonder if there could be a default ambient colour to the sectors if there is a sky texture detected in the map. Otherwise, clamping the value/brightness levels sounds like a good idea.

It may be difficult to see in the second screenshot, but the red lights are darkening the sector. In real life, those red lights wouldn't brighten the blue floor much depending on the relative RGB values, but they couldn't make it darker (as far as I understand). Perhaps it's possible to check if a sector is being darkened by a ceiling flat and ignore it if so. I have no idea if that's possible or not.
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_ »

Zaibatsu64 wrote: Sat Jul 27, 2024 6:29 am
https://postimg.cc/QBw470mG

https://i.postimg.cc/GhcLxbK0/image.png

Here are a couple of screenshots. The first screenshot demonstrates the colour of the outdoor sectors bleeding in to the adjacent sectors and getting progressively lighter. Maybe the ceiling flat texture is being interpreted as a light source. I wonder if there could be a default ambient colour to the sectors if there is a sky texture detected in the map. Otherwise, clamping the value/brightness levels sounds like a good idea.

It may be difficult to see in the second screenshot, but the red lights are darkening the sector. In real life, those red lights wouldn't brighten the blue floor much depending on the relative RGB values, but they couldn't make it darker (as far as I understand). Perhaps it's possible to check if a sector is being darkened by a ceiling flat and ignore it if so. I have no idea if that's possible or not.
Interesting and good observations. What maps are these? I would have to see these in action to troubleshoot fully, but here are a few ideas.

Overall lighting is controlled by AD and bias lighting menu options before color is applied.

In the first lighter sectors closest to the sky sector should have a 20% lighter shade of the sky texture. Not sure exactly what is happening, but agreed it looks jarring.

In the second the red ceiling lights will not affect outer sectors except to colorize walls close to them. (The ceiling is lit, but I didn't think about not lighting the floor... not sure that is possible in ZScript.) Sector light is clamped by the lux of the flat color, so in theory is brighter (see code snippet). It looks darker because red looks darker. I would have to look at this to be sure what's happening.

Code: Select all

ssec.LightLevel = clamp(int(ssec.LightLevel + lux * (1 - rl_additive)), 0, 255);
You can type rl_debug = true in the console, and the values for textures and flats will be displayed. This shows which textures and flats are lights as well as their color values and light strengths. That may answer some questions.
Zaibatsu64
Posts: 19
Joined: Sun Nov 27, 2022 9:35 am

Re: ReLite

Post by Zaibatsu64 »

Hey Doomer_ wrote: Sat Jul 27, 2024 10:48 am
Interesting and good observations. What maps are these? I would have to see these in action to troubleshoot fully, but here are a few ideas.

Overall lighting is controlled by AD and bias lighting menu options before color is applied.

In the first lighter sectors closest to the sky sector should have a 20% lighter shade of the sky texture. Not sure exactly what is happening, but agreed it looks jarring.

In the second the red ceiling lights will not affect outer sectors except to colorize walls close to them. (The ceiling is lit, but I didn't think about not lighting the floor... not sure that is possible in ZScript.) Sector light is clamped by the lux of the flat color, so in theory is brighter (see code snippet). It looks darker because red looks darker. I would have to look at this to be sure what's happening.

Code: Select all

ssec.LightLevel = clamp(int(ssec.LightLevel + lux * (1 - rl_additive)), 0, 255);
You can type rl_debug = true in the console, and the values for textures and flats will be displayed. This shows which textures and flats are lights as well as their color values and light strengths. That may answer some questions.
The first map is from a megawad called 2022Ado. The second screenshot is from a megawad called Abscission.

https://postimg.cc/cr5PWfKj

Here's a screenshot from Doom 2 MAP10. This is using the default settings with the exception of the additive darkness settings. I tweaked them to make the image lighter and more visible.

In this image we can see the outdoor sector in the foreground, coloured by the sky texture. Adding any colour at all to a white light simply has to make it darker. The indoor sector has no visible light source and therefore should be darker than the outdoor sector. We can see that the sector appears brighter as it has no colour information.

If the sky colour was used as a kind of default baseline value for the sectors, I think it would avoid this issue. Anyway, I hope I haven't been rambling like a lunatic!
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_ »

Zaibatsu64 wrote: Sat Jul 27, 2024 12:43 pm The first map is from a megawad called 2022Ado. The second screenshot is from a megawad called Abscission.

https://postimg.cc/cr5PWfKj

Here's a screenshot from Doom 2 MAP10. This is using the default settings with the exception of the additive darkness settings. I tweaked them to make the image lighter and more visible.

In this image we can see the outdoor sector in the foreground, coloured by the sky texture. Adding any colour at all to a white light simply has to make it darker. The indoor sector has no visible light source and therefore should be darker than the outdoor sector. We can see that the sector appears brighter as it has no colour information.

If the sky colour was used as a kind of default baseline value for the sectors, I think it would avoid this issue. Anyway, I hope I haven't been rambling like a lunatic!
Far from it! What you describe now makes sense.

What I wrote above is what is happening with those megawads. You are correct in MAP10 that this same effect happens. The covered walkway adjacent to the sky sector is colored but beyond that it is not.

Hmm. :idea:

A light source is placed inside sectors in a "point of inaccessibility" using a modified map labeling algorithm. This is far more accurate than other methods for irregular polygons and generally puts the light source at a point where it is farthest from sector x,y coordinates. I'm thinking that any sector that can be "seen" by the light source would have sector color bled into it, blended or at a different (perhaps darker?) shade. A living room with a large window captures some of a red sunset color provided the living room isn't lit - and maybe the dining room too - but a bedroom out of sight on the other side of the house won't. That kind of thing.

The solution is likely more a line trace from sector two sided lines, but that's the idea.

Great suggestions. Thanks!

EDIT: in the above first screenshot the white rock ceiling is a light source.
Last edited by Hey Doomer_ on Sun Jul 28, 2024 9:27 am, edited 1 time in total.
User avatar
wran
Posts: 57
Joined: Sun Oct 04, 2020 6:43 pm

Re: ReLite

Post by wran »

Just want to echo some of the praise in here, this mod has come a long way since the early days and now is really some kind of a black magic. I hope you keep working on this.

Return to “Gameplay Mods”