Relighting adds dynamic sprite shadows, baked texture lighting, dynamic sector lighting, and more. Works with GZDoom. Any mod, any map, any game.

Relighting does a few things that are unique in universal GZDoom modding (it works with anything that runs on the GZDoom engine):

  • Light sources are placed in points of inaccessibility using a heavily modified algorithm used to label maps. This is an optimal placement in any sector shape.
  • Textures are lit or shaded according to how visible and bright light sources are. These are baked, that is done before play begins, so there is zero performance impact.
  • Sprite shadows are applied on floors, ceilings, and walls that dynamically respond to lights, including missiles and flashlights.

Relighting does these less unique (I'm guessing) but important things:

  • Dynamic lights and spotlights are added to enhance shadow maps / add color based on GLDEF lumps.
  • Sector lighting / color / reflections are added based on texture flats / sky textures using perceived brightness of the current palette.

Keep in mind that sprite shadows are sprites; sprites can't be bent or clipped. They are essentially cardboard cutouts. In the middle of a firefight it hardly matters, but it's worth noting. An engine Z-sorting bug puts floor shadows (FLATSPRITE actors) on top of a sprite.

While universal (the only hard-coded elements are a few lighting specials and flashlight mod class names) this doesn't work with voxels / models. Most but not all mod sprites will cast shadows depending on how they are coded. Directional lighting is impossible in the GZDoom engine at present. I've added workarounds for directional wall shadows and other effects within those limitations.

Many thanks for all the interest and support. I appreciate it!!

  • View media
  • View media
  • View media
  • View media
  • View media
  • View media
Post article RSS Articles

Blurry shadows

News

For v4.0165b I'm working on actual blurry shadows as described in more detail here.

The idea is to extract sprites, add a Gaussian filter, save the image, and fix the offset to create the blurred sprite assets. An example of this for POSS can be seen here.

(This also works with Voxel Doom.)

Add file RSS Files
relighting v4.0165b

relighting v4.0165b

Full Version 9 comments

Maintenance release with bug fixes. Also includes rlassets that can create blurred shadows to work with sprites and/or models, including Voxel Doom.

relighting v4.0164b

relighting v4.0164b

Full Version 10 comments

Adds "blurry" shadows projected on floors and ceilings similar to wall shadows, performance improvements linked to shadow lifespan, other small tweaks.

relighting v4.01631b

relighting v4.01631b

Full Version 3 comments

Smooth shadow hotfix that fixes stuttering shadow animation when light sources are moving e.g. missiles.

relighting v4.0163b

relighting v4.0163b

Full Version 12 comments

Better performance and adds submenu presets for default, performance, and custom options

relighting v4.0162b

relighting v4.0162b

Full Version 14 comments

Adds more compatibility for BD, adds pitched shadows for decorative and missile lights

relighting v4.0161b

relighting v4.0161b

Full Version 10 comments

Bug fixes and significant performance improvements.

Post comment Comments  (0 - 10 of 45)
Flamsey
Flamsey - - 4 comments

Love this mod, mostly because the flickering lights actually work unlike Doom RTX! Will the lighting from projectiles, objects, etc. from More Lights! V2.5 be added? The creator said its free to use. I tried to use them together but the flickering lights don't work.

Reply Good karma Bad karma+1 vote
Rivarez
Rivarez - - 314 comments

Good mod, but somewhere looks strange. Same texture on a wall looking normal on one polygon then came to absolute black on the adjacent polygon with other angle.
Postimg.cc
Postimg.cc

Reply Good karma Bad karma+1 vote
sumlur
sumlur - - 14 comments

Grass is reflective. this looks really gross. how do i fix

Reply Good karma Bad karma+1 vote
Hereticnic
Hereticnic - - 229 comments

Found the settings that looks better to my taste. For better results you can benchmark with Doom1 e1m1 and e1m3... Found a good compromise between areas of darkness without losing visibility.
I also use my own custom Torch head-lamp instead of Flashlight for better visibility in darker areas.
Footage:

Reply Good karma Bad karma+1 vote
Hereticnic
Hereticnic - - 229 comments

("bug" report) Hey, just confirming what someone said in other comment, latest version 4.0165b the shadows don't work with Voxel Doom models.

When playing with Voxel DoomII (tested on DOOM.WAD and DOOM2.WAD) the voxel models are not emitting any lights, not even the pickups. Reverting back to sprites for now to be able to enjoy the shadows which make a tremendous difference in atmosphere and overall enjoynment \o/

Reply Good karma Bad karma+1 vote
Hereticnic
Hereticnic - - 229 comments

I had to modify the mod in Slade to get readable fonts (smaller) on the Menu Descriptions text...
No matter what Scaling options I tried or resolution changes, the fonts would always too big for screen size...
This is what I did:

Screen.DrawText(ofont, Font.CR_WHITE, 11,
ofont.GetHeight() * CleanYfac_1 * (tips.Size() + 3), tip, DTA_ScaleX, 1.0, DTA_ScaleY, 1.0);

Reply Good karma Bad karma+1 vote
Hereticnic
Hereticnic - - 229 comments

oh man freak, I just did a quick test comparing E1M3 on older version 3.X versus newer version 4.X
I didn't expect such huge difference but I like how it looks on old version much more, looks more atmospheric and the light from that central poison pit BLEEDS into the openings in the wall...
I can't find settings in newer version to make it match the older version atmosphere... I'm gonna write here the changes I'm making to 4.X tuning as a log to not forget... (testing e1m1 and e1m3)
Disabling Shaders = no difference can be seen
Disabling color sectors = doesn't make much difference in the sector lighting
Disabled bleeding = I liked more how it looks (more colorful classic look) but no changes observed to sector light levels
Reduced Dim Sectors to 0.20 = the darker corners of the rooms are darker, this adds more atmosphere in general, very positive change (most drastic change so far)
Tried MoreLights and LessLights = no observable difference to E1M3 entrance area

will continue testing and logging here...
so far I'm trying to find settings on 4.X that replicates the Sector look of 3.X in e1m3

Reply Good karma Bad karma+1 vote
Hereticnic
Hereticnic - - 229 comments

(part 5)
Tried Range of Lights 0.2 and 3.0 (extreme opposites) = no visible difference?
Okay, I'm keeping Decorative Lights OFF, that seems to help a lot with atmosphere (again: without losing visibility or requiring flashlight)

(Turned Monster Lights and Other Lights back on, looks nice)

(Reduced the size and scale of Other Lights, barrels looks normal now, default values too big, too green)

(noticed a "bug"?) Turning OFF Sector Lights disables the Blue Key trap on e1m3, the room doesn't turn dark :sad_face:

(trying to re-enable Sector Lights back ON and even restarting Gzdoom does not fix the Blue Key trap on e1m3, not sure what is going on)

For now, Decorative Lights OFF was the setting that made most improvement, and rolling OtherLights sliders all the way to minimum values

Reply Good karma Bad karma+1 vote
Hereticnic
Hereticnic - - 229 comments

(part 4... comments are not kept in order here...)
(Sector Light)
Disabled "Sector Lights" and "Decorative Lights" = looks much more atmospheric (darker without losing visibility) Already makes E1M1 looks way better, but not much visible difference in e1m3 starting area (what is the setting that would make that central poison pit to glow Max Light? that's the setting I'm looking for) The older version 3.X had that feature where certain Ceiling Textures (lamps in this case) compounded to make the entire pit glow bright. Why is it different in 4.X?

(Spawn Lights)
Disabled "Other Lights" and "Monster Lights" = ok so now the Barrels in e1m3 are lot illuminated anymore, which makes the room look better. The problem is disabling the Barrel lights entirely would make them invisible in the dark at range (making them less useful for strategy play) I just want to SLIGHTLY REDUCE the size of lights emanating from Barrels (green light, so it does not obfuscate the natural sector lights) What would that setting be called in this new version?

Reply Good karma Bad karma+1 vote
Hereticnic
Hereticnic - - 229 comments

Oh ok, I enabled Dim Sectors back on and turned the bar all the way down to 0.20... Dark corners look better now (I had that opposite before)

Reply Good karma Bad karma+1 vote
Hereticnic
Hereticnic - - 229 comments

Question: how does Dim Sectors work? The bar says "how dim" but does higher values make sector darker? Or do I have to REDUCE the bar to low values in order to have DARKER sectors? (the contrast difference makes it look better when there's mix of Dark vs Light)

Reply Good karma Bad karma+1 vote
Hereticnic
Hereticnic - - 229 comments

(continues...)
Disabled Dim Sectors at all = I liked more how it looks now, keeping it...
How Light Interacts with Map = tried Performance with DimSectors off, MoreLights and LessLights, no observable difference... LessLights just made harder to see in dark corridors in a bad way (discard)
Tried Disabling Texture Lights (no idea what it does) = no visible difference can be seen, reducing or increasing no difference (discard)
Disabled Smart Lighting tweaks = no visible difference (discard)
Disabled SubtractiveLighting and DynamicSectors = no visible difference (does it require new game soft reset or requires full gzdoom reload?) (discard WTF)
(reloaded gzdoom just to make sure, no visible difference)
(continues...)

Reply Good karma Bad karma+1 vote
Post a comment

Your comment will be anonymous unless you join the community. Or sign in with your social account:

X