2018-10-30 18:24:45 +00:00
|
|
|
|
|
|
|
# ZDRay baking utility for GZDoom
|
|
|
|
|
2021-11-11 04:51:00 +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 lights. Once ZDRay has processed the level WAD it is ready to be used by GZDoom.
|
2018-10-30 18:24:45 +00:00
|
|
|
|
2021-11-11 04:51:00 +00:00
|
|
|
ZDRay is based on zdbsp for the node generation and originally used dlight for the lightmap generation. Special thanks to Randi Heit,
|
|
|
|
Samuel Villarreal, Christoph Oelckers and anyone else involved in creating or maintaining those tools.
|
|
|
|
|
|
|
|
The ray tracing code has been completely rewritten since. It now supports bounces and can do the ray tracing on the GPU.
|
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)
|
2021-11-11 04:56:15 +00:00
|
|
|
-C, --cpu-raytrace Use the CPU for ray tracing
|
|
|
|
-D, --vkdebug Print messages from the vulkan validation layer
|
|
|
|
-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>
|
2021-11-11 04:51:00 +00:00
|
|
|
thing // ZDRayInfo (zdray properties for the map)
|
|
|
|
{
|
|
|
|
type = 9890;
|
|
|
|
suncolor = <int> (color)
|
|
|
|
sundirx = <float> (X direction for the sun)
|
|
|
|
sundiry = <float> (Y direction for the sun)
|
|
|
|
sundirz = <float> (Z direction for the sun)
|
|
|
|
sampledistance = <int> (default: 8, map units each lightmap texel covers, must be in powers of two)
|
|
|
|
bounces = <int> (default: 1, how many times light bounces off walls)
|
|
|
|
gridsize = <float> (default: 32, grid density for the automatic light probes)
|
|
|
|
}
|
|
|
|
|
2021-10-04 21:56:55 +00:00
|
|
|
thing // StaticLight (point or spot light to be baked into the lightmap)
|
2018-10-30 18:10:50 +00:00
|
|
|
{
|
2021-10-04 21:56:55 +00:00
|
|
|
lightcolor = <int> (color)
|
2018-10-30 18:24:45 +00:00
|
|
|
lightintensity = <float> (default: 1)
|
|
|
|
lightdistance = <float> (default: 0, no light)
|
2021-10-04 21:56:55 +00:00
|
|
|
lightinnerangle = <float> (default: 180)
|
|
|
|
lightouterangle = <float> (default: 180)
|
2018-10-30 18:10:50 +00:00
|
|
|
}
|
|
|
|
|
2021-10-04 21:56:55 +00:00
|
|
|
thing // LightProbe (light sampling point for actors)
|
2018-10-30 18:10:50 +00:00
|
|
|
{
|
2021-10-04 21:56:55 +00:00
|
|
|
type = 9875;
|
|
|
|
}
|
|
|
|
|
2021-11-11 04:51:00 +00:00
|
|
|
linedef // Line emissive surface
|
2021-10-04 21:56:55 +00:00
|
|
|
{
|
|
|
|
lightcolor = <int> (color, default: white)
|
2018-10-30 18:24:45 +00:00
|
|
|
lightintensity = <float> (default: 1)
|
|
|
|
lightdistance = <float> (default: 0, no light)
|
2018-10-30 18:10:50 +00:00
|
|
|
}
|
|
|
|
|
2021-11-11 04:51:00 +00:00
|
|
|
sector // Sector plane emissive surface
|
2018-10-30 18:10:50 +00:00
|
|
|
{
|
2018-10-30 18:24:45 +00:00
|
|
|
lightcolorfloor = <int> (color, default: white)
|
|
|
|
lightintensityfloor = <float> (default: 1)
|
|
|
|
lightdistancefloor = <float> (default: 0, no light)
|
2018-10-30 18:10:50 +00:00
|
|
|
|
2018-10-30 18:24:45 +00:00
|
|
|
lightcolorceiling = <int> (color, default: white)
|
|
|
|
lightintensityceiling = <float> (default: 1)
|
|
|
|
lightdistanceceiling = <float> (default: 0, no light)
|
2018-10-30 18:10:50 +00:00
|
|
|
}
|
2018-10-30 18:17:03 +00:00
|
|
|
</pre>
|