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

[Experimental] GZDoom-ZDRay - Baked lights in your Doom

Recommended Posts

Disclaimer: Read the credits.

This is going to be a lengthy and thorough thread. In the middle of this i have added a line for those who just want a less detailed explanation. For those who want more, well there is more.


Looking for ZDRay only? Look here.


I am making this thread because the contents of this originally resided at Discord. I felt it made sense to have it archived here for historic purposes, similar to the ZDuke port, and to provide a complete package for users to toy with. A lot of info was harvested from picking apart the ZDoom Discord and compiling it together for this thread.


This is provided as-is. It represents a compiled snapshot of experimental work that has since become abandoned by its creator (dpJudas). I am an archivist/editor, not a developer. It may or may not work on your system.


A special thanks to Rachael for generously hosting this and Nash for the majority grunt of getting this together and providing the latest working build.


I have named this compilation GZDoom-ZDRay, because well, that's basically what it is. I strongly suggest only using the provided custom GZDoom build in the package to toy around with this.


Do not pester Judas, Rachael, Graf or Nash with feature requests or requesting it to be ported over to the latest GZDoom.


What this is:
It is a node generator and light baking utility for ZDoom. In the words of dpJudas: ''ZDRay is a node and lightmap generator. It is based on zdbsp for the node generation and dlight for the lightmap generation. Special thanks to Randi Heit, Samuel Villarreal, Christoph Oelckers and anyone else involved in creating or maintaining those tools.''


Basically, with this you are able to get Quake-style/Unreal style lightmaps in your Doom. It supports surface-based area lights (linedef or sector) and it has extended baking features like light bouncing, 3d floors, and so forth. The results can be quite incredible, thanks to Nash:


See this post here for more.






The contents are as follows:


An all-in-one package. This includes a custom GZDoom build with ZDRay support, the latest version of ZDRay as executable and the latest lightmaps test WAD with pre-built lights. Huge thanks to Nash for providing this build.

  • fm_banks (directory)
  • soundfonts (directory)
  • brightmaps.pk3
  • gzdoom.exe: GZDoom g3.8pre-49-gd95967f2c, compiled 2018-10-30 in the console. It is a devbuild towards version 3.8.0 and should be compatible with version 3.7.0, whose thread can be found here.
  • gzdoom.pk3
  • lightmaptest_latest.pk3: Includes lit test WAD by Nash
  • lights.pk3
  • zd_extra.pk3
  • zdray.exe: ZDRay as a standalone.exe.
  • zdrayparameters.PNG: A screenshot of ZDRay's options prompt.
  • Various dll's

What this isn't:

  • Something which will be in the latest GZDoom. Unless a variety of variables are met, this code as-is will never be in GZ.

To use ZDRay, the following parameters are available:






Stuff you may encounter:

  • It *may* crash. It is experimental, after all!
  • Won't work on all ZDoom slopes
  • Sprites may not get correctly lit
  • Setting up lights needs to be done manually in-editor
  • You need to manually key in unsupported args into the things on the map
  • You must create a lightconfig.txt file, it can be empty but you must at least insert 1 line
  • ZDRay ideally works in tandem with a level editor. At the time, GZDoomBuilder-BugFix was the preferred solution, but you are better off using Ultimate Doom Builder
  • And various other wonky stuff that may occur. This is experimental quality, so expect experimental fuckery along the way. See also the ''So how does this work, anyway?'' section for a more detailed usage on how to set this up

A more detailed background will now follow. Those who just want to download ''the goods''can exit this thread. For those who want to read further, stick by!


So how does this work, anyway?

I let Nash fill you in on this. What follows is a compiled explanation of his Discord commentary from 2019 and 2018. Be advised that Nash refers to GZDoomBuilder-Bugfix, so usage in Ultimate Doom Builder might be different, and things may contradict.

''You make your map in GZDB, then run your map through zdray.exe. The custom build of gzdoom would then be able to read that compiled data to draw complex shadows. So, basically the same workflow as building quake and unreal maps. In order to get baked lights, you have to specifically place them in the map, then run zdray on your wad. 2 ways:


  • either set your lights to "static"
  • tag surfaces (sectors or lines; udmf only) to be light emitters. zdray will take care of the rest.

Currently (and understandably, as everything is so early in production) i use dynamic lights first for the blocking phase (because GZDB doesn't show static lighting) then when i'm finally satisfied, i convert all the dynamic lights to the UDMF static lights, by hand. then run zdray.''


dpJudas has a nice but sparse summary of the tool: ''You run a tool called zdray, like you run zdbsp today. It picks up certain UDMF properties from the map itself and sunlight properties from MAPINFO, then it bakes the lightmaps and generates the BSP nodes.''


UDMF Properties of ZDRay:

    lightcolor = <int> (color, default: white)
    lightintensity = <float> (default: 1)
    lightdistance = <float> (default: 0, no light)

    lightcolor = <int> (color)
    lightintensity = <float> (default: 1)
    lightdistance = <float> (default: 0, no light)
    lightinnerangle = <float> (default: 180)
    lightouterangle = <float> (default: 180)

    lightcolorfloor = <int> (color, default: white)
    lightintensityfloor = <float> (default: 1)
    lightdistancefloor = <float> (default: 0, no light)

    lightcolorceiling = <int> (color, default: white)
    lightintensityceiling = <float> (default: 1)
    lightdistanceceiling = <float> (default: 0, no light)

Package details:
Originally i planned on using the package provided by a user called Kizoky on Discord, but as it turns out through some more digging, as Kizoky's compile had some issues since a user back then couldn't get things to work. dpJudas provided a proper gzdoom.exe and the overall package then seemed to work, along with test maps. Nash then was kindly enough to compile a proper build of the latest state of the lightmaps branch compiled before dpJudas abandoned it, paired with the latest version of ZDRay, with the latest lightmaptest iteration with lights pre-built.


All ive done is some clean up, making a seperate standalone archive for ZDRay and including the unlit WAD.



  • The Strife VE team for their lightmapper, of which ZDRay is derived of
  • Nash Muhandes for providing the latest compiled build of the ZDRay code, lit and unlit versions of his test map, derived fancy screenshots and ZDRay descriptions
  • Rachael for hosting on the ZDoom servers so that it has a permanent home
  • Magnus Norddahl (dpJudas) for the code work and test maps aswell as prior test builds
  • Graf Zahl for the pull requests on the Github branch
  • Kizoky for compiling zdray.zip, initial build package and initial uploading over at Discord


Edited by Redneckerz : Different title that suits the content better.

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