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

Progress 0.7.0a

Post by Hey Doomer_ »

Progress 0.7.0a

Code: Select all

0.70
8/30 - removed ceiling lights in sectors with lighting specials & player shadow w/o shadows
8/31 - removed floor lighting for animated textures, optimized bias lighting, increased height of decorative lights
9/1 - corrected colorization & inverse square calculation, added colorization cvar
9/3 - corrected inshadow lighting of sprites
9/4 - added circular mean estimation for average colorization w/ multiple light sources
Colorization is interesting enough to share comparisons:

E1M1 with and without - greenish tint from nukage pool
E1M1 with and without - color from lamps
E1M1 with and without - color from overhead lights
E1M1 with and without - color from overhead lights

Most of these effects are subtle but add pleasing depth to otherwise all-or-nothing sector lighting. I don't think I've seen this done on any kind of scale, but perhaps it has.

Note that hues are derived from a standard color wheel of 0-360 degrees at 15 degree increments with locked saturation rates. I'm still playing around with the right mix between pleasing vs obnoxious. Blended hues are surprisingly interesting, and this is also something my smoothing algorithm does. The all-or-nothing nature of sectors, walls, and lights is an unavoidable limitation.

I did have this coded previously but have corrected bugs and streamlined the code so this finally works as intended. Still testing.
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

More Progress 0.7.0a

Post by Hey Doomer_ »

More Progress 0.7.0a

Code: Select all

0.70
8/30 - removed ceiling lights in sectors with lighting specials & player shadow w/o shadows
8/31 - removed floor lighting for animated textures, optimized bias lighting, increased height of decorative lights
9/1 - corrected colorization & inverse square calculation, added colorization cvar
9/3 - corrected inshadow lighting of sprites
9/4 - added circular mean estimation for average colorization w/ multiple light sources
9/10 - added performance toggle
I've added a "Performance" toggle that removes most added dynamic lights and increases shadow lifespans. Examples:

E1M7 - normal
E1M7 - performance mode

As you can see, this is a difference of around 50+ FPS (sprite shadows are similar). Dynamic lights are a big drag on the engine often for mixed effect. Note that "performance" mode retains light source actors for light baking and shadow casting. (Sprite shadows have nothing to do with dynamic lights, only "thinker" light source actors to which dynamic lights may be attached.)

This may help on some low end systems, complex maps, or with complex mods. For larger maps, turning off bias lighting that averages sector lighting with a bias to darker sectors may improve load times. Bias lighting loops through all sectors and all lines twice. Increasing the ceiling grid size will also improve some load times depending on what flats are used. Generally lights bake textures in a narrow range and stop when a ceiling or floor is hit, but it all adds up.

Release likely in a few days.
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

Almost... 0.7.0a

Post by Hey Doomer_ »

Almost... 0.7.0a

Just testing and tweaking. Some of this looks remarkable, and I added parallax textures to test:

E1M4

Ain't that something. Settings in the above are maxlights = off, palette saturation = 0.15 (the mod is interpreting a saturated version of the palette).

More a testament to what GZDoom can do with an essentially flat map, but it is nonetheless interesting. 8-)
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.7.0a Released

Post by Hey Doomer_ »

ReLite 0.7.0a Released

Code: Select all

0.70
8/30 - removed ceiling lights in sectors with lighting specials & player shadow w/o shadows
8/31 - removed floor lighting for animated textures, optimized bias lighting, increased height of decorative lights
9/1 - corrected colorization & inverse square calculation, added colorization cvar
9/3 - corrected inshadow lighting of sprites
9/4 - added circular mean estimation for average colorization w/ multiple light sources
9/10 - added performance toggle
9/12 - increased outside/eave lighting, added caster check for dark rooms without flash
As noted some corrections to light and color and a few optimizations. Examples:

Heretic E1M1
Hexen MAP01

Doom E3M2
Doom E3M6
Doom ][ MAP15

Many thanks for your continued interest and support! Let me know what you think!
Zaibatsu64
Posts: 19
Joined: Sun Nov 27, 2022 9:35 am

Re: ReLite

Post by Zaibatsu64 »

It's excellent as always. Another significant step forward. The colorization is the standout feature this time. It looks great, and the lighting has generally improved. The additional menu options are also welcome.

I've been getting visually pleasing results by cranking the texture and flat lights right up. The dynamic lights do have a large performance impact, it would be great if they could be baked in to the map.

One thing I've noticed is the enemy sprites are often extremely dark for an unknown reason. I prefer to play with sprite shadows disabled, although I'm not sure if that's relevant. Sometimes the textures and flats appear well lit but the sprites are much darker.

Thanks again for your hard work!
cosmos10040
Posts: 195
Joined: Mon Dec 20, 2021 6:16 am
Graphics Processor: ATI/AMD (Modern GZDoom)

Re: ReLite

Post by cosmos10040 »

These new update is really something else. The lighting looks great and the performance toggle makes a difference with big maps! I'm just glad I can run this on my mobile device!
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 Sep 14, 2024 10:30 am It's excellent as always. Another significant step forward. The colorization is the standout feature this time. It looks great, and the lighting has generally improved. The additional menu options are also welcome.

I've been getting visually pleasing results by cranking the texture and flat lights right up. The dynamic lights do have a large performance impact, it would be great if they could be baked in to the map.

One thing I've noticed is the enemy sprites are often extremely dark for an unknown reason. I prefer to play with sprite shadows disabled, although I'm not sure if that's relevant. Sometimes the textures and flats appear well lit but the sprites are much darker.

Thanks again for your hard work!
Thanks!! I appreciate the feedback.

For those playing with shadows:

Enemy sprites are dark partly because of a change I made that I didn't get back to. Try this in hd_shadowactors.zs around line 278, replacing with the current block:

Code: Select all

			// shadow between caster and player
			double inshadow = AbsAngle(players[consoleplayer].mo.Angle, p.Angle);
			if (inshadow > 135)
			{
				p.args[0] = 0;
				caster.LightLevel = caster.CurSector.LightLevel - int(inshadow * 0.3);
			}
			else
			{
				caster.LightLevel = caster.CurSector.LightLevel + int((135 - inshadow) * 0.3);
				p.args[0] = light.flashlight ? 0 : 1;
			}
		}
This puts a sprite "in shadow" when its shadow is between player and sprite. In earlier versions this didn't work well. Another thing (probably what you're noticing) that causes darkness with lights cranked up (something I have seldom tried, my bad) is that all dynamic lights have DYNAMICLIGHT.LF_DONTLIGHTACTORS set. This is because the entire sprite is lit regardless of any light setting, defeating the above. The original code also used distance of the light source casting the shadow - you can see code that I tried that is commented out. :)

Straightforward enough, I just forgot about it. I'll look at that again.

If you prefer the play without shadows, try removing the DONTLIGHTACTORS flag. I'll look at that again. There's no need for that if shadows aren't being used. 8-)

Great feedback.
Last edited by Hey Doomer_ on Sat Sep 14, 2024 3:50 pm, edited 2 times in total.
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 Sep 14, 2024 12:13 pm These new update is really something else. The lighting looks great and the performance toggle makes a difference with big maps! I'm just glad I can run this on my mobile device!
Thanks!! That's great to hear!
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

WIWO 0.7.1a

Post by Hey Doomer_ »

WIWO 0.7.1a

Code: Select all

0.7.1
9/14 - added bias lighting check for same light level
9/14 - corrected sprite in shadow code
9/15 - added dl flag conditional on rl_shadows, check for no region detected, added +2 degrees of shadow freedom, added distance and scaley check in grid iterator search, added alpha correction for brighter sectors
9/16 - added shader with color bleeding effect
I have added several corrections, some noted above, and cleaned up some of the shadow code. The search for iterator regions, for example, is now recursive and includes all seven dof. I've also added other corrections for shadows, some of which optimize light searching. It would be nice to add multiple shadows or allow for combined light sources from different directions, but thinkers drain performance as they must iterate through unsorted items. So... no.

I've added a simple shader that adds "color bleeding" as described here. This is a known photography technique. I've modified this slightly to make it more or less pronounced depending on the brightness of the color, improving Relighting's approach to the same idea:

Code: Select all

	// color bleeding adjustment
	vec3 chsv = rgb2hsv(c);
	if (chsv.z > 0.5)
	{
		// bleed
		vec3 mix = c.gbr + c.brg;
		c.rgb += mix * mix * rl_bleeding * chsv.z;
		res.rgb = c;
	}
Shaders are a bit of a hammer. This effect is subtle:

E1M1 bleeding off
E1M1 bleeding on

The bleeding strength is controlled on the options menu, and this is at the default in the middle of the range.

Still testing but release soon. 8-)
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.7.1a - Reflections

Post by Hey Doomer_ »

Progress 0.7.1a

Code: Select all

0.7.1
9/14 - added bias lighting check for same light level, corrected sprite in shadow code
9/15 - added dl flag conditional on rl_shadows, check for no region detected, added +2 degrees of shadow freedom, added distance and scaley check in grid iterator search, added alpha correction for brighter sectors
9/16 - added shader with color bleeding effect
9/17 - added reflections based on cvars
I've rearranged the menu somewhat and eliminated tooltips (thinking about that, as I don't run this on a mobile app), and added reflections:

E1M1 with reflections

Floor textures that one wishes to reflect are entered in Options (selecting by color doesn't work well for a number of reasons). After finding the next unused tag in the map that tag is added to each sector with a floor texture in Options by a postprocessor routine. Then all sectors with that tag are activated. Simpler than Relighting.

Release "soon"
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

Almost... 0.7.1a

Post by Hey Doomer_ »

Almost... 0.7.1a

Code: Select all

0.7.1
9/14 - added bias lighting check for same light level, corrected sprite in shadow code
9/15 - added dl flag conditional on rl_shadows, check for no region detected, added +2 degrees of shadow freedom, added distance and scaley check in grid iterator search, added alpha correction for brighter sectors
9/16 - added shader with color bleeding effect
9/17 - added reflections based on cvars, restart current level options in options menu
9/20 - (rl_maxlight) increased total light hitting walls, increased outside light
This is "feature" complete now that floor and ceiling reflections have been added.

I've tweaked the color bleeding shader to act on either end of color saturation, effectively making bright colors brighter and dim colors dimmer.

I've also increased the light reach for the "maxlight" option and changed outside settings.

I'm doing some final testing, but for now here are examples of outside sector shadows:

E1M1 Maxlight ON
E1M1 Maxlight OFF

This lighting is baked and not driven by dynamic lights. It's a matter of changing lux strength and stacking distance of light source actors. There is no performance difference. The reason the walls are brighter at the far end of the horseshoe is that the sector's POI (the "center" of this irregular polygon that contains a hole!) is somewhere between the nukage pool and the far window. Generally that works and makes it seem like light is coming from that direction. A matter of taste, but it looks cool. 8-)

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.7.1a Released

Post by Hey Doomer_ »

ReLite 0.7.1a Released

Code: Select all

0.7.1
9/14 - added bias lighting check for same light level, corrected sprite in shadow code
9/15 - added dl flag conditional on rl_shadows, check for no region detected, added +2 degrees of shadow freedom, added distance and scaley check in grid iterator search, added alpha correction for brighter sectors
9/16 - added shader with color bleeding effect
9/17 - added reflections based on cvars, restart current level options in options menu
9/20 - (rl_maxlight) increased total light hitting walls, increased outside light, increased colorization degrees x3
9/21 - adjusted saturation over distance by hue
Contains many optimizations and corrections related to proper lighting of walls and sprites. Light sources are now correctly searched, and shadow alpha is lower in brighter sectors. Outside light and lighting of walls is generally increased (a welcome difference in Brown 2 maps). Degrees of colorization have been increased; note colorization saturation is hard coded by GZDoom. A shader that "bleeds" color has an effect on brighter and darker colors. Ceiling and floor corrections can now be added on the options menu (one has to enter the correct flat name in all caps). This fails if a) tag(s) exist on a sector with the flat, b) the reflection tag is already in the map. A message will display if (b) is true. These two issues can't be helped in GZDoom. Option menu has been simplified.

This is likely the last alpha version.

Again Many Thanks for your invaluable input and continued support!
cosmos10040
Posts: 195
Joined: Mon Dec 20, 2021 6:16 am
Graphics Processor: ATI/AMD (Modern GZDoom)

Re: ReLite

Post by cosmos10040 »

Excellent update as always. I did encounter an error using delta touch but was able to fix it.


**** DIED WITH FATAL ERROR:
Compile Shader 'hd_shader.fp':
ERROR: 0:34: '-' : wrong operand types no operation '-' exists that takes a left-hand operand of type 'const int' and a right operand of type 'float' (or there is no acceptable conversion)
ERROR: 0:34: '*' : wrong operand types no operation '*' exists that takes a left-hand operand of type '3-component vector of float' and a right operand of type 'const int' (or there is no acceptable conversion)
ERROR: 2 compilation errors. No code generated

I just put the decimal on line 34 and works just as new! 😃 delta touch no like that. Thanks for making this possible.
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 Sep 21, 2024 1:03 pm Excellent update as always. I did encounter an error using delta touch but was able to fix it.


**** DIED WITH FATAL ERROR:
Compile Shader 'hd_shader.fp':
ERROR: 0:34: '-' : wrong operand types no operation '-' exists that takes a left-hand operand of type 'const int' and a right operand of type 'float' (or there is no acceptable conversion)
ERROR: 0:34: '*' : wrong operand types no operation '*' exists that takes a left-hand operand of type '3-component vector of float' and a right operand of type 'const int' (or there is no acceptable conversion)
ERROR: 2 compilation errors. No code generated

I just put the decimal on line 34 and works just as new! 😃 delta touch no like that. Thanks for making this possible.
Excellent! Thanks for catching that.
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

WIWO 0.7.2b

Post by Hey Doomer_ »

WIWO 0.7.2b

Code: Select all

0.7.2
9/21 - check for hd_sector.area == 0, optimized build_hd_grid(), optimized find_textures(), check for colorization before light limit, added rl_color_val cvar, added criteria for plasma projectile shadows
9/22 - added checks for area size, height, and line length to optimize load / smoothing time / dynamic light placement, corrected lighting in sectors with lighting specials
I worked with a complex map to drastically reduce load times and increase performance. While ReLite is a "no holds barred" mod, well, it doesn't make sense to look at sectors with extremely tiny areas, tiny volumes, or tiny line lengths. I'm correcting for those. I've also improved colorization to allow for multiple color sources to combine after a wall is lit to capacity and exposed a "color val" CVar to allow a user to say how bright a color has to be to colorize a wall.

To use reflections you have to load a map into a map editor and get a name for a ceiling or floor texture. I doubt there's any way to algorithmically tell what's reflective. Since D2 raytraced shows mirrored lights in MAP02, I've done similar here by adding FLAT2:

MAP02 1
MAP02 2

Release "soon." 8-)

Return to “Gameplay Mods”