Real-time path tracing support for the PrBoom sourceport.
-
Build RTGL1 library
-
Clone this repository
git clone https://github.com/sultim-t/prboom-plus-rt.git
-
Add an environment variable
RTGL1_SDK_PATH
, it must point to the RTGL1 root folder -
Make sure the external development libraries required by PrBoom are available. For PrBoom-RT, SDL2/Ogg/Vorbis/VorbisFile are a requirement.
-
Windows:
- extract
prboom-rt-windows-dependencies.zip
(can be found here) to theprboom2
folder - it's a subset of all PrBoom dependencies
- extract
-
Linux: install using a package manager
-
-
Configure and build
mkdir build cd build cmake .. cmake --build .
-
Copy
ovrd
folder to the compiledprboom-plus
executable- it's better to create a hard link to
ovrd
to have it shared between different configs (e.g. Debug/Release/etc)
- it's better to create a hard link to
-
Run
prboom-plus
ovrd/mat
folder contains new textures to use with the new lighting system.
Each texture is compressed and wrapped into .ktx2
format.
Assume that CRATELIT
texture needs to be modified.
-
Setup environment:
- Install CompressonatorCLI
- and append a path to its executable to
$PATH
environment variable (socompressonatorcli.exe
can be called from anywhere)
- and append a path to its executable to
- Install Python3
- Download
CreateKTX2.py
script (can be found here) and place toovrd
folder- this tool is a part of RTGL1
- Install CompressonatorCLI
-
Create files (each of them is ):
ovrd/mat_raw/gfx/CRATELIT.png
-- albedo map- alpha channel (transparency) is used, if Doom uses transparency for that texture
ovrd/mat_raw/gfx/CRATELIT_rme.png
:- roughness in
R
channel - metallicity in
G
channel - emission in
B
channel, color is controlled by albedo map at the same pixel
- roughness in
ovrd/mat_raw/gfx/CRATELIT_n.png
-- normal map,G
channel is ignored (it's assumed to be always 255)
-
Run
CreateKTX2.py
script with Python3- it will pack textures from
ovrd/mat_raw
toovrd/mat
- it will pack textures from
-
Changes should be visible, when the game reloads textures (usually, on game re-enter)
Note: flats are placed to ovrd/mat/flat
, everything else is in ovrd/mat/gfx
ovrd/textures_metainfo.txt
contains configuration for textures. Each section has its own set of parameters, the first parameter is always a texture name:
-
@WATER
- if it's a water / mirror texture
-
@RASTERIZED_WITH_LIGHT
- draw without ray tracing (no shadows/reflections/etc), but add a light source to it
- format:
<texture name> <HEX RGB color> <light range multiplier, default=1.0>
-
@VERTICAL_CONELIGHT
- if a light source that points up should be added
- format:
<texture name> <HEX RGB color> <intensity>
-
@EMISSIVE
- make texture emissive (e.g. lava)
- format:
<texture name> <emission intensity>
-
@EMISSIVE_WITHOUT_INDIRECT_ILLUMINATION
-- same as@EMISSIVE
-
@MONOCHROME_FOR_COLORMAPS
-- make a texture grayscale
- Pass
-rtdevmode
argument toprboom-plus
- Pass
-iwadrt <file>
to use a custom mapmetainfo file- the file contains light sources data for each episode-map pair
- each WAD must correspond to its own mapmetainfo (as episode-map indices might not be unique in different WADs)
- default value:
ovrd/map_metainfo_doom1.txt
- Use
Numpad +
/Numpad -
keys (or[
/]
keys) to increase/decrease intensity of a light source at the center of a map sector. - Use
I
O
P
/K
L
;
keys to increase/decrease RGB values of a light source- (!) by default, both RGB and intensity values of a sector are 0; so when a sector is touched for the first time, increase both its values
- To save light data to the mapmetainfo file, use
Numpad *
- players can use your mapmetainfo file by passing the
-iwadrt
argument
- players can use your mapmetainfo file by passing the