Jump to content
Search In
  • More options...
Find results that contain...
Find results in...
Hey Doomer

ReLite

Recommended Posts

relite_logo_zdoom.png.71a7cd03c7b82139d1803af04b0abc02.png

 

ReLite is a bare-bones, no-limits fork of Relighting. It has the following:

 

  • Baked texture lights
  • Bias sector lighting
  • Colored sector lighting based on flat and sky textures
  • Dynamic colored lights attached to textures (must load with texture brightmaps mod)
  • Directional light and shadow
  • Regex engine parses text lumps
  • Reads and analyzes PNG brightmaps
  • Dynamic sprite shadows (optional blurry shadows / shadows for Voxel Doom must be created using included Python script)
  • Quake-style camera panning and stats at the end of each level

The mechanics of shadow generation are similar to Relighting with the exception that light sources are also attached to textures with dynamic lights.

 

Blurry sprite shadows (these work with Voxel Doom and many model assets) are created using a Python script that does all the work and adds them to this mod. (Really, it's easy and takes a few seconds.)

 

Requires GZDoom 4.10+

 

Previous Release:

relite_0.6.6a.zip

 

New Release:

relite_0.6.7a.zip

Edited by Hey Doomer

Share this post


Link to post

Posted ReLite 0.5.2a

 

Quote

 

0.5.2
9/26 - omitted wallpatches ZScript for function to read TEXTURE & PNAMES
9/27 - added mapped ceiling lights
9/30 - move player to just beyond hd_map_grid limit in endcam
10/1 - added shading to palette & dynamic lighting


 

 

In addition numerous bug fixes and code consolidation.

Share this post


Link to post

Changelog:

 

0.6.0
10/2 - exclude small shadow generators
10/3 - fixed shadow alignment
10/5 - fixed light smoothing
10/6 - optimized add light functions
10/6 - added bias to dark sector lighting

 

The "bias lighting" levels out stark contrast in sector lighting intended originally to simulate shadows. That made sense before dynamic light shadow mapping. Note these examples in which dynamic lighting augments sector lighting for a more natural look (the lighter sectors are still visible with a bias toward darker adjoining sectors - at this time not exposed as a CVar to adjust):

 

 

e1m6_bias.png

map01_bias.png

Share this post


Link to post

Posted ReLite 0.6.1a

 

Changelog:

0.6.1
10/09 - fixed DIV/0 in shadow code
10/09 - added check for sector lines < 3
10/10 - fixed shadow alignment / flipping
10/11 - exclude NOBLOCKMAP, NOCLIP, INVISIBLE, THRUACTORS shadow generators
10/12 - added HSV criteria / colorization to texture light and baked light routines

 

Obvious but I've added hue and saturation (value isn't useful and I use perceived brightness of color from another calculation) to the lighting routines. Overall dynamic lighting size is 50% reduced so performance is improved. Many bug fixes and limits removed. Let me know what you think!

 

Share this post


Link to post

WIWO 0.6.2a


 

Quote

 

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

 

 

Sprites, also stored in Doom patch format, can easily be analyzed for color. Rather than parse GLDEFS (ugh without regex!) I added a small function to read decorative sprites and apply the new texture lighting with coloring logic. Here are examples:

e2m5
e3m2
e3m5
e3m5

This adds another dynamic light to the object which adds more light, something I'll have to test. I will make allowances for that if it hurts performance.

Decorative lights are based on GLDEFS - no brightmaps needed - and currently only Doom patch lump formats work. As far as original games this only leaves out Strife.

 

I'll be working on a PNG color reading routine for the next release - not sure how long that will take but it seems straightforward - and change CVars from color values to a list of additional textures for light attachment. This will help make the mod more universal.

Share this post


Link to post

Progress 0.6.2a

 

Quote

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

 

I am making good progress in decompressing PNG zipped data as part of a general image routine. This is described for Python in some detail here. It's pretty straightforward if one understands Python moderately well. I should be done with this conversion and testing in a few days.

This routine is needed because a PNG file, which consists of "chunks," zips image pixel data (usually RGB triplets for textures with alpha added for sprites) in IDAT chunks using fixed or dynamic trees. These days everything involving zips is done with libraries - including in Python - but fortunately there isn't a lot of code involved with it. It's well documented if complex.

What this lets ReLite do is use most images as light sources. In other words, it won't matter if an image is a PNG or LMP inside or outside a WAD format. (I don't know if other image formats are used.) An image can be analyzed for color, etc. Bitmaps stored as a PNG can also be read to determine how "bright" they are and thus excluded as a true light source. This routine removes limitations around images and image formats.

Release "soon."

Share this post


Link to post

Hi! I'm testing it in Heretic. Looking for some options to disable shadows for example, but i'm confused. Where i need look for that?
looks really cool!

Edited by WARDUST

Share this post


Link to post
6 hours ago, WARDUST said:

Hi! I'm testing it in Heretic. Looking for some options to disable shadows for example, but i'm confused. Where i need look for that?
looks really cool!

 

Thanks! No options in this version to disable. You'll have to edit hd_relite_Events.zs and comment out the last 2 lines:

//		e.thing.bCastSpriteShadow = false;
//		e.thing.A_GiveInventory("hd_shade", 1);
 		

 

Share this post


Link to post

Progress 0.6.2a

 

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

 

0.6.1a places texture lights according to brightmaps and adds exclusions based on geometry and brightness of the color. This causes a lot of areas, such as the secret room to the right at the start of E1M2, to look bizarrely bright. Because this included all colors I also added an exclusion for texture colorization.

0.6.2a adds reading a brightmap before accepting flat or texture as a light source. I've added criteria based on percentage brightened and/or how bright. I've removed all exclusions for placement and added bottom side tier placement. I've removed all colorization exclusions. So far this has improved visuals and significantly improved performance. Since this lowers the number of light sources, it makes those remaining cast greater shadows in some cases. Here are screenshots:

 

e1m7
e1m7
e2m5
e3m5

 

Still testing.

 

Share this post


Link to post

Progress 0.6.2a
 

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. 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.

 

Share this post


Link to post

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!

 

Share this post


Link to post

WIWO 0.6.3a

 

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.

 

brightmap texture blodgr1  { map "brightmaps/textures/doom/blodrip1.png" iwad }

But here's Brutal Doom, for example:

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.

 

Share this post


Link to post

Released 0.6.3a

 

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 && size based on brightmaps

11/02 - fixed End Cam bug where only 1 camera crashed mod

11/03 - added colorization to light smoothing

 

This includes critical bug fixes that have caused crashes with mod randomizers and mods with custom sprites. Generally more limits have been removed, and there are now more dynamic lights and better performance. This is because light sizes have been reduced and are based on percentage of lights emitted by the brightmaps. Light placement is generally accurate although it does not account for two-sided unpegged textures (next version). Colorization is now applied to all tiers, eliminating color striping in some levels, and it has been added to the light smoothing algorithm.

Many thanks!

Share this post


Link to post

Progress 0.6.4a

 

0.6.4

11/05 - added blend function to texture colorization

11/05 - added mString class to mixins, includes minify functions

11/06 - changed hd_regex.match to return array of matches

11/09 - added hd_brightmaps with regex searching, file checking, bug fixes

11/09 - added pixel reconstruction for scanline filter type > 0 (https://pyokagan.name/blog/2019-10-14-png/)

 

Regex searching works with bmplus_textures and SBrightmaps. ReLite's regex engine returns a list of matches using basic pattern matching. After minifying and tokenizing brightmap definitions, for example, this does the heavy lifting:

 

foreach (def: defs) re.match("@@ [ A-Z0-9\"./_]+", def, matches);

 

I've added file checks and checks for brightmaps in the auto folder. Many lights are now missing using bmplus because some definitions are commented out. The minify code removes comments.

I've added code to reconstruct PNG pixel data. While unzipped pixel data is always arranged in horizontal scanlines, depending on the encoder scanlines are filtered using simple algorithms to improve compression ratios; this process must be reversed to get original data. (Most - not all - bmplus scanlines are unfiltered.) Now both mods return the same data from different PNG types (SBrightmap scanlines are all filtered).

 

This is now much closer to a universal solution.

 

Release "soon."

 

Share this post


Link to post

Released 0.6.4a

 

This now works with bmplus_textures or SBrightmaps. The latter is in Brutal Doom already and so doesn't need to be added. Since the regex engine is written in ZScript and not C it's a bit slower and load times will be a few seconds. However, this also adds file checks that were not in 0.6.3a and should be more compatible with more mods.

 

Share this post


Link to post

Another example, this time in MAP01. Note the walls to left and right where the upper console texture seems to cast a shadow.

 

 

map01_fuzzy_flat.png

Share this post


Link to post

Progress 0.6.5a

 

0.6.5

11/11 - added check in minify() for no terminal block comment marker

11/13 - added fuzzy shadow maps for flats and textures

11/15 - added fuzzy dispersion patterns

 

I've finally decided against the "fuzzy" menu option and looked at varying dispersion patterns based on textures, flats, and if a texture is in a window. Previously all light dispersion patterns were 360 degrees because everything was a point light. However, for flattened spotlights that is no longer true. I have made adjustments and placed the light and type of light depending on the sector. This leads to interesting effects such as this:

 

e2m2 - "fuzzy"


This rather astonishing effect is caused by a flattened spotlight on the floor of the texture with a -90 pitch, because the floor difference is greater than the ceiling difference. Still testing.

 

Share this post


Link to post

This looks really awesome. I'm gonna take a look this evening in-game.

 

Can it do it's magic on custom texture sets? Assuming I use the proper directory structure, and brightmaps?

Share this post


Link to post
4 hours ago, kdoom said:

This looks really awesome. I'm gonna take a look this evening in-game.

 

Can it do it's magic on custom texture sets? Assuming I use the proper directory structure, and brightmaps?

 

Thanks!

 

I haven't added reading custom textures yet but, yes, the framework exists to read custom textures. So far I've only looked at brightmap PNG files. I will expand this but haven't had a chance just yet.

 

 

 

Share this post


Link to post

Released 0.6.5a

 

This version includes "fuzzy" directional lighting for lightboxes ("windows" with texture lighting) and minor bug fixes. The modified lighting should not affect performance.

 

0.6.5
11/11 - added check in minify() for no terminal block comment marker
11/13 - added fuzzy shadow maps for flats and textures
11/15 - added fuzzy dispersion patterns with directional (flattened spotlight) lighting

 

Share this post


Link to post
1 hour ago, Magnus doomsday said:

Where could I find previous versions of the mod? Preferably the last one that worked with gzdoom 3.8.2 legacy

(My computer is a piece of crap)

 

All require 4.10+

Share this post


Link to post

WIWO 0.6.6a

A rather obvious addition to directional lighting is attaching these to moving platforms such as doors. Here is a proof of concept:

e1m1

This looks astonishing depending on the difference in light levels. So I'm working on that for 0.6.6.

 

Share this post


Link to post

Progress 0.6.6a

 

0.6.6
11/18 - added check for null Owner in hd_shade
11/19 - added moving platform directional lights
11/19 - added correction for colorize smoothing

 

Platform lights are coded for doors and lifts. The size of the light is based on the difference in lighting between sectors and how bright the brightest sector is. There are likely anomalies here and there depending on geometry and light levels. This can't be helped. While the platform light isn't a point light and has direction (up or down in this case), it does disperse light in 360 degrees. Still when it works it looks cool  8-)

 

e1m2

 

This only adds a few lights and light actors and should not impact performance.

 

Release "soon."

Share this post


Link to post

ReLite 0.6.6a Released

0.6.6
11/18 - added check for null Owner in hd_shade
11/19 - added moving platform directional lights
11/19 - added correction for colorize smoothing
11/20 - added non-lightbox window directional lights
11/20 - added outside light adjustment

In addition to minor bug fixes, this version includes directional lighting for moving platforms (doors and lifts) and non-lightbox windows. The latter is very noticeable in MAP14.

Share this post


Link to post

0.6.7
11/23 - general code cleanup, minor bug fixes
11/25 - all tiers have same light level
11/26 - added fuzzy outdoor eave lighting

 

Example of fuzzy shadows in 0.6.7a

 

e1m3_fuzzy.png

Share this post


Link to post

0.6.7
11/23 - general code cleanup, minor bug fixes
11/25 - all tiers have same light level
11/26 - added eave directional lighting
11/29 - added xskew to seekwalls() to correct for tall/narrow or short/wide textures
12/1 - corrected decorative light dispersement

The eave directional lighting is indoor and outdoor. Example:

e1m1

This is baked, although I suppose it could be dynamic. I've also corrected numerous bugs that affect lighting and corrected directional lights. Indeed all non-fluid lighting this mod uses is now "directional" i.e. flattened spotlights. You can see this in lightbox images on opposite walls, directional eave shadows, and lighting that hits a ceiling or floor but not both. These are generally applied in sectors with brightmapped textures, although outside sectors are the exception.

I've also added a slight tweak to baked texture lighting to allow for texture line defs that are much wider than tall and vice versa, since this is all-or nothing.

Many thanks for the continued interest. Let me know what you think!

Share this post


Link to post

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×