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.
Boring Explanation: The original idea of Relighting was simple: take the game without lighting and light according to textures and flats. This led to performance issues and a struggle to find light sources in the original game. Worse, it only worked with Doom. Worse still, it didn't really give any depth to the world; added dynamic lights were largely static. By the time a ray casting port was released it seemed this project was obsolete. But not every rig can do ray casting. And some people seemed to appreciate the effort. Many thanks.
New stuff: This version fixes a lot of things. Dynamic sprite floor and wall shadows are added, and dynamic lights are sparingly applied for added shadow maps. It still has reflections, colored lights, and dynamic sector lighting. There are no configuration text files, so this works with anything. Performance is greatly improved and should not be an issue on any rig.
More stuff: This version also has baked sidedef lighting that adds a surprising amount of depth as seen here independent of dynamic lighting at no performance cost. (Note: tier sidedef lighting isn't exposed in ZScript. Still looks cool.)
Be aware that this is in beta. I have fixed many bugs, but doubtless there are things that do not work. There are things that could be done better. Also be aware the sprite "shadows" are sprites. They are flat cutouts that will stick out over edges, because they can't be clipped. Can't be helped. Also be aware that sizing is approximate for performance reasons; I have written this to make choices based on minimal calculations with speed in mind. (It still looks really cool.)
If you are having a problem running this, tweak Performance Settings. Anything and everything can be turned off or dialed back. Let me know what you think!
8/19 - fixed DIV/0 error
8/20 - added distance check to lights/shadows beyond FOV
8/21 - added length check to texture lights
8/22 - fixed bug in flashlight scale
8/22 - added rlassets to create blurry shadows
v4.0164b
6/15 - added floorshadow actors for "blurry" shadows similar to wall shadow actors
6/15 - added distance check for shadows behind the player
6/16 - added rl_blur_shadows CVar
6/16 - corrected rl_lifespan in shadow Tick() function
6/17 - adjust warea limit for texture baking by sidedef variables
6/18 - tweak strength of decorative/texture lights
v4.01631b
6/4 - hotfix: removed lifespan on hd_light for smoother shadows
v4.0163b
5/19 - adjusted "other" shadows to exclude non-missile, non-player, non-monster, non-inventory
5/20 - added menu tooltips & presets
5/20 - added decorative light sources CVar flag
5/21 - destroy hd_light sources not a lightsource && not defined in GLDEF (performance)
5/24 - added override to set preset with ENTER
5/25 - added a CVar for shadow Scale.Y
v4.0162b
5/6 - added check for saved light level in hd_light
5/11 - added BD mod flashlight compatibility
5/12 - added pitch for decorative and missile lights
5/12 - tweaked shadow lifespan
v4.0161b
4/23 - fixed skewness for sectorless maps (bug fix)
4/24 - added hack in shadow PostBeginPlay() for player sprite in voxel array
4/24 - added lifespan variable to hd_light actor (performance)
4/25 - added check for rl_Cvar.rl_player_shadows.GetBool() in PlayerSpawned() (bug fix)
4/28 - change ghostmissile fail to sector light level
4/29 - cut second shadow if > 1/4 shadow distance (performance)
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
v4.0159b
3/27 - adjust sprite min/max by number of sprites (optimize)
3/28 - double shadow lifespan for actors > 1/4, 1/2, 3/4 distance (optimize)
3/29 - fixed DIV/0 error line 1321
3/30 - fixed shadow generating bug for player when finishing a level
3/30 - hd_shadow.zs: int tests for distance; args[0] for isFlashlight; z calc in LightCheckSight; (bugs)
4/1 - light calculations linked to CVars (accuracy)
4/2 - fixed hdspot added hdlightsources (accuracy)
4/3 - corrected Pos.z for temp hd_lightsource & corrected LightSightCheck functions (accuracy / optimize)
4/4 - separated baked sidedef block from rl_sector_lights
4/6 - added smart lighting for brighter sector light sources
4/7 - added support for beamflashlightmod
4/8 - corrected skewness upper clamp to allow for min_area > max_area
v4.0158b
3/25 - used Thinker.STAT_HDLIGHT for hd_light actors (optimize)
3/25 - limit reflections on non-anim flats by rl_colored_perceived only (optimize)
3/25 - added sprite height check for TNT1A0 actors in hd_shadow (optimize)
3/25 - fixed DIV/0 error line 1754
3/25 - adjust dynamic light intensity per # hd_lights (optimize)
3/25 - limit shadows within fov (optimize)
3/25 - eliminated sight function checks for player shadow (optimize)
3/25 - eliminated BlockedCheckSight for non-monster casters (optimize)
3/27 - adjust visible light distance by light scale (optimize)
v4.0157b
3/14 - clamped light level to avoid DIV/0 error
3/15 - added check for no/null sprite in shadow caster, deleted exception coding
3/17 - added light size adjustment based on color settings
3/17 - checks for caster lights, bug fixes for shadow pitching of long shadows (bug fix)
3/17 - check for 3d distance of light (performance)
3/17 - search animated texture lumps instead of list
3/18 - added wall shadow alerts
3/21 - added "Death" decoration/missile state spotlights
3/22 - reorganized menus with tips
3/22 - added ceiling shadows for SPAWNCEILING actors
v4.0156b
3/4 - fixed DIV/0 in skew function
3/4 - added window lights, post baking hdlightsources for wall shadows
3/4 - added alpha adjustment for elevated floor shadows
3/7 - added CVar for player shadows on self
3/10 - minor bug fixes in shadow spawn code, added exception for BD headshottargets, pitched shadows
3/11 - added player pitch to flashlight, harsh vs. diffuse lit shadows
v4.0155b
2/24 - added larger wall shadows farther away (long shadows)
2/27 - fixed DIV/0 errors
2/27 - fixed display of shadows on different line segments
v4.0154b
2/7 - added +NOTELESTOMP to ghostlight actor
2/9 - fixed DIV/0 calculation error
2/15 - added optional subtractive lighting
2/16 - changed lower area limit of conditional hdlightsource (performance)
v4.0153b
1/30 - added more color bleeding
1/31 - added temporary light sources for baked sidedefs
2/3 - added sector light adjustments for total light & shadow
v4.0152b
1/17 - adjusted smart lighting sector light limit
1/22 - added more smart lighting, weighted baked lighting, added dimness bleeding
1/25 - tweaked hdlightsource Scale.Y and link to CVar
v4.0151b
1/10 - added check for !sky with other colors
1/11 - corrected sky colors
1/12 - corrected decorative light scale
1/14 - added smart lighting
v4.0150b
1/2 - corrected shadows for solid objects e.g. trees
1/2 - added sky colors for outside sectors
v4.0149b
12/23 - added check for spawned things that should not generate a shadow or light (optimize)
12/23 - added check for Death state to remove hdlight (BD & variants)
12/28 - added checks for master/caster/AAPTR_MASTER (BD & variants)
12/30 - added check for player flashlight (cosmetic)
12/30 - added sidedef checks for very large maps (optimize)
v4.0148b
12/14 - corrected float/int comparison in shader (BUG)
12/17 - moved constant definitions outside of sidedef lighting loop (optimize)
12/18 - corrected inverse square calculation (accuracy)
12/18 - removed calculation for 2-sided lines on same planes (optimize)
12/19 - corrected lighting scale for volume, brightness (accuracy)
12/22 - increased light outside. GLDEF color tints per type. Objects light others. (cosmetic, performance)
v4.0147b
12/13 - added sector fog (cosmetic)
12/14 - turned off gamma correction for STYLE_Subtract (cosmetic)
v4.0146b
12/10 - destroy light switches that are not needed (optimize)
12/10 - fixed polylabel min, max, seed cells; added regular rectangle calculation; remove nan distance cells; fixed triangle centroid calculation (BUGS)
12/11 - light scale adjustment for hd_lightsource actor (performance)
12/11 - added exception for MilDoom3 "fake" actors
v4.0145b
12/7 - check for empty area array
12/9 - fixed hdlightsource scale calculation
12/9 - code cleanup
12/10 - increase light for objects if FindState("Death")
v4.0144b
12/7 - added corrections for tall lights (accuracy)
v4.0143b
12/3 - added additive lighting for colored sectors
12/4 - optimized polylabel to eliminate lines crossing other sectors
12/4 - added switch/exit lighting
12/5 - minor bug fixes
12/5 - added PSprite shadow
12/6 - removed fake contrast
v4.0142b
11/29 - fixed polygon area with stitching routine. No more fudge. (light placement accuracy)
12/1 - fixed stitching in centroid function
12/2 - fixed vertex array in polylabel function, added optimizations, added triangle calculation (optimized)
12/2 - add decreased light level for actors cast in shadow
12/2 - added CVars for sidedef baking
v4.0141b
11/26 - added check for DIV/0 in skewness (avoid VM abort)
11/26 - no hdlights behind the player (performance)
11/26 - no shadow thinkers behind the player (performance)
11/26 - increased skew correction (performance)
11/27 - polygon area fudge for enclosed polygons, parallel lines
v4.014b
11/20 - added ceiling and floor lights
11/20 - added line activation correction for floor donut
11/21 - added light correction for sidedef shadows
11/23 - fixed polygonarea calculation and scaled to DoomPlayer
11/23 - added line activation check for lightswitches
11/25 - fixed volume, color corrections
v4.0132b
11/20 - hotfix to correct for GLDEFS missed entries
v4.0131b
11/20 - hotfix for GLDEFS reading error
v4.013b
11/17 - fixed reading GLDEFS objects and colors
11/18 - added skewness correction for minimum area
11/18 - clamped missile lights (Cvar)
11/18 - added pulsing lights based on perceived color brightness
11/19 - added lightsource based sidedef lighting
v4.012b
11/15 - added lifespan/interpolation CVars for shadows
11/15 - added shadow distance checks
11/15 - added code to allow actors to block shadows w/ CVar
11/15 - fixed FindLump/ReadLump loops to improve load times
v4.011b
11/11 - added sector quicksort by area to reduce hd_lightsource actors
11/12 - added support for transfer sky texture flags
11/12 - added gamma/saturation/bleeding shader
11/13 - added recursive sector bleeding functions
11/13 - added gldef colors as attached lights default
v4.01b
11/1 - fixed lightswitch code that expects 2 adjacent sectors
11/1 - added code to ignore voxels that can't be pitched
11/8 - added buggy support for 3d slopes (no 3d floors yet and wall shadows are not fixed for this)
11/8 - corrected jittery player shadows
11/9 - added polylabel support
11/10 - attached lights select floor/ceiling colors
11/11 - added player and monster shadows on other actors
You do not have the required permissions to view the files attached to this post.
Last edited by Hey Doomer_ on Tue Aug 22, 2023 2:43 pm, edited 47 times in total.
Edit - Performance has definitely been improved somehow, despite the newly added bells and whistles...phenomenal work! That said, I just came across an abort when attempting to load this up with this map: https://www.moddb.com/mods/honte-remastered (HontE). Thought I'd report it here for your records (attached in text file).
You do not have the required permissions to view the files attached to this post.
Last edited by BROS_ETT_311 on Mon Oct 31, 2022 5:13 pm, edited 1 time in total.
BROS_ETT_311 wrote: ↑Mon Oct 31, 2022 3:01 pm
It's here
Edit - Performance has definitely been improved somehow, despite the newly added bells and whistles...phenomenal work! That said, I just cam across an abort when attempting to load this up with this map: https://www.moddb.com/mods/honte-remastered (HontE). Thought I'd report it here for your records (attached in text file).
Thanks, I'll check that out!
Edit
OK I've figured this out; this is the lightswitch code that expects 3 sectors if this is a door. My guess is this is some special sector with a zero height. I'll have this fixed. In the meantime you can edit the file zscript\hd_actors.zs yourself. Add missing text below at line 36, which should fix it:
if (lin.Flags & Line.ML_TWOSIDED)
{
if (lin.BackSector != CurSector) sec.Push(lin.BackSector);
if (lin.FrontSector != CurSector) sec.Push(lin.FrontSector);
}
}
if (sec.Size() < 3)
{
Destroy();
return;
}
int light = -1;
int dark = 256;
int darkest = -1;
Last edited by Hey Doomer_ on Tue Nov 01, 2022 1:43 am, edited 3 times in total.
Does feel more dynamic vs the 3.x version, in particular with the players own shadow which is nice.
One thing I noticed was the shadows on v4 look a bit odd when used with voxels, as I had Voxel Doom v. 1.0 loaded. The shadow ends up overlapping on top/above.
Did this remove the map lighting stuff or just reduce it quite a bit? also the shadows dont seem to work with flashlight++ as far as i can tell. also the player shadow just randomly appears/disappears as it pleases.
using e1m1 on Doom1 to try it.
also, default settings gives armor bonuses and barrels this really bright white dynamic light.
--EDIT--
I figured out a few things.
the "Perceived Light" setting should be more like 100-130
the "*Min" slider being moved down to a 70-80 range
creates a nice moody lighting setup.
Last edited by Dan_The_Noob on Tue Nov 01, 2022 1:32 am, edited 1 time in total.
Anim8 wrote: ↑Mon Oct 31, 2022 9:12 pm
Does feel more dynamic vs the 3.x version, in particular with the players own shadow which is nice.
One thing I noticed was the shadows on v4 look a bit odd when used with voxels, as I had Voxel Doom v. 1.0 loaded. The shadow ends up overlapping on top/above.
Edit
I've checked this out with the voxel mod. Voxels are incompatible with FLATSPRITE, because they are not sprites - they replace sprite pointers. But I'm just guessing on this. Perhaps someone who knows the answer will chime in. I'll make allowances for voxels, but it means anything that's a voxel won't have a sprite shadow. I suspect there is not a workaround at this time; the voxel cvar is all or nothing.
Last edited by Hey Doomer_ on Tue Nov 01, 2022 2:48 am, edited 3 times in total.
Dan_The_Noob wrote: ↑Tue Nov 01, 2022 1:14 am
Did this remove the map lighting stuff or just reduce it quite a bit? also the shadows dont seem to work with flashlight++ as far as i can tell. also the player shadow just randomly appears/disappears as it pleases.
using e1m1 on Doom1 to try it.
also, default settings gives armor bonuses and barrels this really bright white dynamic light.
For now texture lights have all been removed for compatibility purposes.
It should work with the flashlight++ mod. Most likely there are other light sources, but I'll check that out. Thanks!
Object lights can be dialed down or turned off in Performance Settings.
For now texture lights have all been removed for compatibility purposes.
It should work with the flashlight++ mod. Most likely there are other light sources, but I'll check that out. Thanks!
Object lights can be dialed down or turned off in Performance Settings.
i fiddled with the cosmetic settings a little and got it somewhere closer to what i was after, im not so worried about the shadows part. I'm mostly looking for smoother light transitions and lighting based off of ceilings/floors. so does the job.
is it possible to have lighting adjust based on brightmaps in any way too?
currently my brightmaps are uncoloured, but i might update them if they affected lighting somehow.
--EDIT--
getting this error and sometimes an error about lightswitches.
For now texture lights have all been removed for compatibility purposes.
It should work with the flashlight++ mod. Most likely there are other light sources, but I'll check that out. Thanks!
Object lights can be dialed down or turned off in Performance Settings.
i fiddled with the cosmetic settings a little and got it somewhere closer to what i was after, im not so worried about the shadows part. I'm mostly looking for smoother light transitions and lighting based off of ceilings/floors. so does the job.
is it possible to have lighting adjust based on brightmaps in any way too?
currently my brightmaps are uncoloured, but i might update them if they affected lighting somehow.
--EDIT--
getting this error and sometimes an error about lightswitches.
IDDQD_1337 wrote: ↑Tue Nov 01, 2022 6:41 am
It's good that the mod is back in development and the author is alive, but what happened to you, did you disappear for a long time?
Considering the fact they're back on a new account, probably just lost the old one
mamaluigisbagel wrote: ↑Tue Nov 01, 2022 12:16 pm
I noticed as soon as I started Vanguard, the sky texture was missing, and turning off Relighting restored it.