2018-10-30 18:24:45 +00:00
# ZDRay baking utility for GZDoom
2023-09-24 12:02:29 +00:00
ZDRay is a node and lightmap generator for GZDoom. ZDRay is intended as a drop-in replacement for zdbsp, with the additional feature that it can also bake lightmap lights. Once ZDRay has processed the level WAD it is ready to be used by GZDoom.
2018-10-30 18:24:45 +00:00
2023-09-24 12:02:29 +00:00
ZDRay is based on zdbsp for the node generation and originally used dlight for the lightmap generation. Special thanks to Marisa Heit, Samuel Villarreal, Christoph Oelckers and anyone else involved in creating or maintaining those tools.
2021-11-11 04:51:00 +00:00
2023-09-24 12:02:29 +00:00
The ray tracing code has been completely rewritten since. ZDRay has two paths for lightmap baking - either the Vulkan ray query API path for raytracing-enabled cards, or a shader-based path utilizing storage buffers for non-RT cards. It defaults to the ray query path but will automatically fall back to the shader path if no RT card is found on the system.
2018-10-30 18:24:45 +00:00
2021-11-11 04:56:15 +00:00
## ZDRay Usage
< pre >
Usage: zdray [options] sourcefile.wad
-m, --map=MAP Only affect the specified map
-o, --output=FILE Write output to FILE instead of tmp.wad
-c, --comments Write UDMF index comments
-q, --no-prune Keep unused sidedefs and sectors
-N, --no-nodes Do not rebuild nodes
-g, --gl Build GL-friendly nodes
-G, --gl-matching Build GL-friendly nodes that match normal nodes
-x, --gl-only Only build GL-friendly nodes
-5, --gl-v5 Create v5 GL-friendly nodes (overriden by -z and -X)
-X, --extended Create extended nodes (including GL nodes, if built)
-z, --compress Compress the nodes (including GL nodes, if built)
-Z, --compress-normal Compress normal nodes but not GL nodes
-b, --empty-blockmap Create an empty blockmap
-r, --empty-reject Create an empty reject table
-R, --zero-reject Create a reject table of all zeroes
-E, --no-reject Leave reject table untouched
-p, --partition=NNN Maximum segs to consider at each node (default 64)
-s, --split-cost=NNN Cost for splitting segs (default 8)
-d, --diagonal-cost=NNN Cost for avoiding diagonal splitters (default 16)
-P, --no-polyobjs Do not check for polyobject subsector splits
-j, --threads=NNN Number of threads used for raytracing (default 64)
2021-11-11 04:58:48 +00:00
-S, --size=NNN lightmap texture dimensions for width and height must
be in powers of two (1, 2, 4, 8, 16, etc)
2022-06-29 06:56:19 +00:00
-D, --vkdebug Print messages from the Vulkan validation layer
--dump-mesh Export level mesh and lightmaps for debugging
2021-11-11 04:56:15 +00:00
-w, --warn Show warning messages
-t, --no-timing Suppress timing information
-V, --version Display version information
--help Display this usage information
< / pre >
2018-10-30 18:24:45 +00:00
## ZDRay UDMF properties
2018-10-30 18:10:50 +00:00
2018-10-30 18:17:03 +00:00
< pre >
2022-02-15 16:30:37 +00:00
thing // ZDRayInfo (ZDRay properties for the map)
2021-11-11 04:51:00 +00:00
{
type = 9890;
2023-10-03 10:36:50 +00:00
lm_suncolor = < int> (default: 16777215, color value of the sun)
lm_sampledist = < int> (default: 16, map units each lightmap texel covers, must be in powers of two)
2021-11-11 04:51:00 +00:00
}
2023-09-24 11:51:02 +00:00
thing // Lightmap point light (Light color and distance properties use the same args as dynamic lights)
2018-10-30 18:10:50 +00:00
{
2022-02-15 16:30:37 +00:00
type = 9876;
}
2023-09-24 11:51:02 +00:00
thing // Lightmap spotlight (Light color, distance and angle properties use the same args as dynamic lights)
2022-02-15 16:30:37 +00:00
{
type = 9881;
2018-10-30 18:10:50 +00:00
}
2022-06-29 06:56:19 +00:00
linedef
{
// Customizable sampling distance per line surface. Will use the value from the ZDRayInfo actor by default.
2023-10-03 10:36:50 +00:00
lm_sampledist = < int> (default: 0)
2022-06-29 06:56:19 +00:00
lm_sampledist_top = < int> (default: 0)
lm_sampledist_mid = < int> (default: 0)
lm_sampledist_bot = < int> (default: 0)
}
2023-09-11 00:36:17 +00:00
sidedef
{
// Customizable sampling distance per sidedef. Will use the value from the ZDRayInfo actor by default.
2023-10-03 10:36:50 +00:00
lm_sampledist = < int> (default: 0)
2023-09-11 00:36:17 +00:00
lm_sampledist_top = < int> (default: 0)
lm_sampledist_mid = < int> (default: 0)
lm_sampledist_bot = < int> (default: 0)
}
2022-06-29 06:56:19 +00:00
sector
{
// Customizable sampling distance for floors and ceilings.
lm_sampledist_floor = < int> (default: 0)
lm_sampledist_ceiling = < int> (default: 0)
2023-10-17 17:52:42 +00:00
2024-02-10 01:49:12 +00:00
// Update the lightmap for the sector every frame when visible in the game.
// All sides belonging to the sector will also be affected.
// Note that this is computationally expensive, but it allows animated and moving lights.
2023-10-17 17:52:42 +00:00
lm_dynamic = < bool> (default: false)
2022-06-29 06:56:19 +00:00
}
2018-10-30 18:17:03 +00:00
< / pre >