[Experimental] GZDoom-ZDRay - Compiled works and more

Game Engines go in this forum
Forum rules
The Projects forums are ONLY for YOUR 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 are perfectly acceptable here too.

Please read the full rules for more details.

[Experimental] GZDoom-ZDRay - Compiled works and more

Postby Redneckerz » Thu Jan 16, 2020 4:19 am

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.

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




In the Downloads directory, you will find multiple files:

gzdoom-zdray.7z:
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.
Contents:
  • 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
zdray.7z:
This is the latest version of ZDRay as a standalone executable only.
Contents:
  • zdray.exe
  • map01unlit.wad: An unlit version of Nash's WAD fully baked in the gzdoom-zdray package for testing purposes.
  • zdrayparameters.PNG: A screenshot of ZDRay's options prompt.
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:



Downloads:
GZDoom-ZDRay
ZDRay
Readme

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"
    or
  • 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:

Code: Select allExpand view
linedef
{
   lightcolor = <int> (color, default: white)
   lightintensity = <float> (default: 1)
   lightdistance = <float> (default: 0, no light)
}

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

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

Credits:
  • 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
Links:
  • Github (Latest source-only): ZDRay
Last edited by Redneckerz on Thu Jan 16, 2020 10:43 am, edited 1 time in total.
User avatar
Redneckerz
A Doomer in H.A/R.M's way
 
Joined: 25 Nov 2019
Discord: Redneckerz#8399
Operating System: Windows Vista/7 64-bit
Graphics Processor: nVidia (Legacy GZDoom)

Re: [Experimental] GZDoom-ZDRay - Compiled works and more

Postby olzhas1one » Thu Jan 16, 2020 6:21 am

What's next? Cubemaps? HDR? Realistic Physics? Ragdoll support?

In all seriousness this is a cool feature, I'd definately want to see it become an actual part of GZDoom. Imagine what kind of stuff mappers could do with this.
User avatar
olzhas1one
 
Joined: 26 Feb 2017
Discord: olzhas1one #1997

Re: [Experimental] GZDoom-ZDRay - Compiled works and more

Postby Graf Zahl » Thu Jan 16, 2020 6:54 am

It is a cool feature, too bad that dpJudas wasn't satisfied with it to bring it to completion. I haven't found any time yet to fix the problems it still has but it is something I really would like to see in the engine.
User avatar
Graf Zahl
Lead GZDoom Developer
Lead GZDoom Developer
 
Joined: 19 Jul 2003
Location: Germany

Re: [Experimental] GZDoom-ZDRay - Compiled works and more

Postby Redneckerz » Fri Jan 17, 2020 5:21 am

olzhas1one wrote:What's next? Cubemaps? HDR? Realistic Physics? Ragdoll support?

In all seriousness this is a cool feature, I'd definately want to see it become an actual part of GZDoom. Imagine what kind of stuff mappers could do with this.

You could get some proper baked lights going on along with shadows that significantly change the look a Doom level.

That's basically modern game making honestly. Games still do look better due to introducing a PBR pipeline to their games, but you would be amazed how important just having better lighting works for assets. That's what the next-gen is going to be: Refined lighting. Hell, RTX and Quake 2 RTX are already making strides for that (as does Reshade's Raytrace injector).

In the here and now though, This compiled stuff is basically the best one can get to have baked lights and shadows in GZDoom and its honestly more a legacy build if anything else. This solely exists for people to toy with.

But who knows. I can imagine one developer looks at this code and uses it for his project. Previously he had to compile that stuff himself (and he will have to if he wants to fork it and add changes to it) but he can atleast test/play with this with these builds now, lowering the barrier.

The visual difference is surely worth looking into, either way.

Graf Zahl wrote:It is a cool feature, too bad that dpJudas wasn't satisfied with it to bring it to completion. I haven't found any time yet to fix the problems it still has but it is something I really would like to see in the engine.

Thanks for your comment Graf :)

Indeed, there are a host of limitations surrounding this - But that aside, what's there is already quite useful. Enough to have a compiled build for it. Its basically a time capsule of a feature that sadly is not quite there for GZDoom and it has outgrown its QZDoom usefulness.

With that said, now that this is out there in a playable release, ill do some work on the Wiki to describe this.
User avatar
Redneckerz
A Doomer in H.A/R.M's way
 
Joined: 25 Nov 2019
Discord: Redneckerz#8399
Operating System: Windows Vista/7 64-bit
Graphics Processor: nVidia (Legacy GZDoom)

Re: [Experimental] GZDoom-ZDRay - Compiled works and more

Postby Darkcrafter » Sun Feb 02, 2020 1:04 pm

This is freaking awesome to have such a tool now. A got a few questions, let it not sound like requirements though :roll:

- I don't know what I'm doing wrong but seems like dyn lights don't work for me, just sky works like it would have sun.
- will it make to the official GZDoom;
- is it possible to get away from zdbsp nodebuilder as GZDoom built-in is way superior than that in terms of handling super large maps (zbsp and other don't even start with a map like this);

Doom Builder view: https://imgur.com/OuShYNz
In game view (large 7mb jpg): https://imgur.com/ZE8Yu63

- will it support gpu rendering via open cl or cuda;
- will it take 3d models into account and shade them and map geometry too;
- this question doesn't tocuh ZDRay and team but no existing doom builder version (even ultimate doom builder) opens a resulting wad and it has to be opened with slade with lightmap lump removal in order to do this.

There was a bit of slowdown if compared to the lighting without lightmaps but anyway it's exciting to see Doom is slowly getting into this territory and doesn't slow down a much because of that (hello vavoom :mrgreen: )
User avatar
Darkcrafter
 
Joined: 23 Sep 2017
Location: South Russia
Operating System: Windows 10/8.1/8 64-bit
OS Test Version: No (Using Stable Public Version)
Graphics Processor: nVidia with Vulkan support

Re: [Experimental] GZDoom-ZDRay - Compiled works and more

Postby Redneckerz » Sun Feb 02, 2020 1:57 pm

Darkcrafter wrote:This is freaking awesome to have such a tool now. A got a few questions, let it not sound like requirements though :roll:

- I don't know what I'm doing wrong but seems like dyn lights don't work for me, just sky works like it would have sun.
- will it make to the official GZDoom;
- is it possible to get away from zdbsp nodebuilder as GZDoom built-in is way superior than that in terms of handling super large maps (zbsp and other don't even start with a map like this);

  • You need to have a txt file ready, as mentioned in the thread.
  • Read the thread ><. Its literally in the top part, and bolded.
  • No. It is made with ZDBSP in mind. You could (i assume) have it work with the built-in nodesbuilder, but i have not read anyone trying this yet.
Darkcrafter wrote:- will it support gpu rendering via open cl or cuda;
- will it take 3d models into account and shade them and map geometry too;
- this question doesn't tocuh ZDRay and team but no existing doom builder version (even ultimate doom builder) opens a resulting wad and it has to be opened with slade with lightmap lump removal in order to do this.

  • No. Its an abandoned branch as is stated, and it works on CPU baking only.
  • As far as i can tell, no. I assume with map geometry you mean if it takes into account all slopes, by which case it does not.
  • The resultant WAD is supposed to run with the GZDoom build provided. To open the WAD you must not open it with the lights already baked.
Please re-read the thread because your questions have been answered already and i very much can tell that not everything was read.
User avatar
Redneckerz
A Doomer in H.A/R.M's way
 
Joined: 25 Nov 2019
Discord: Redneckerz#8399
Operating System: Windows Vista/7 64-bit
Graphics Processor: nVidia (Legacy GZDoom)


Return to Game Engines

Who is online

Users browsing this forum: No registered users and 0 guests