diff --git a/README.md b/README.md index 8fab0da8..c9ecb805 100644 --- a/README.md +++ b/README.md @@ -4,7 +4,7 @@ RBDOOM-3-BFG Readme - https://github.com/RobertBeckebans/RBDOOM-3-BFG -## Table of Contents +# Table of Contents This file contains the following sections: @@ -27,7 +27,7 @@ This file contains the following sections: --- -## About the Port +# About the Port `RBDOOM-3-BFG is a modernization effort of DOOM-3-BFG.` @@ -35,14 +35,8 @@ RBDOOM-3-BFG is based on DOOM-3-BFG and the goal of this port is to bring DOOM-3 I started this project in 2012 and focused on making this code being future proof so other cool projects can build interesting things on top of it without the need to fix a lot of stuff first. Over 40 people all over the world contributed cool patches. Some results are: -* Flexible build system using CMake allowing to add optional features like FFmpeg for videos or OpenAL for sound -* Linux support (32 and 64 bit) with both GCC and Clang with a proper SDL 2 OS layer including gamepad support -* Win64 support and Visual Studio support up to VS 2019 -* OS X support -* OpenAL Soft sound backend primarily developed for Linux but works on Windows as well -* Bink video support through libbinkdec (thanks to Daniel Gibson) or FFmpeg (thanks to Carl Kenner) -* PNG image support -* Soft shadows using PCF hardware shadow mapping +## Gaming Related +* Soft shadows using PCF hardware shadow mapping. The implementation uses sampler2DArrayShadow and PCF which usually requires Direct3D 10.1 however it is in the OpenGL 3.2 core so it should be widely supported. @@ -58,13 +52,37 @@ I started this project in 2012 and focused on making this code being future proo * Filmic post process effects like Technicolor color grading and film grain * Additional ambient render pass to make the game less dark similar to the Quake 4 r_forceAmbient technique * Screen Space Ambient Occlusion http://graphics.cs.williams.edu/papers/SAOHPG12/ +* Fixed Bink video playback through libbinkdec (thanks to Daniel Gibson) or FFmpeg (thanks to Carl Kenner) +* Cinematic sequences can be skipped (thanks to Biel Bestué de Luna) * Netcode fixes to allow multiplayer sessions to friends with +connect (manual port forwarding required) -* Added back dmap and aas compilers (mapping tools) -* Cinematic sequences can be skipped + +## Programming and Code Quality +* Flexible build system using CMake allowing to add optional features like Vulkan rendering, FFmpeg for videos or OpenAL for sound +* Linux support for both GCC and Clang with a proper SDL 2 OS layer including gamepad support +* Win64 support and Visual Studio support up to VS 2019 +* MacOS X support (might be outdated due to Apple's latest API restrictions) +* OpenAL Soft sound backend primarily developed for Linux but works on Windows as well * Sourcecode cleanup using the Artistic Style C++ beautifier to ensure the Git diffs and logs are clean * Fixed tons of warnings using the Clang compiler * Fast compile times using precompiled header support -* RBDOOM-3-BFG allows mod editing and has many tiny fixes so custom content can be put into mod directories and the engine accepts it like vanilla Doom 3.DOOM 3 BFG wasn't designed for actual development or modding support. Many things like reading anything outside of the packed resource files was not supported. I also fixed many things in the renderer like r_showTris. + +## Modding Support +* RBDOOM-3-BFG allows mod editing and has many tiny fixes so custom content can be put into mod directories and the engine accepts it like vanilla Doom 3. DOOM 3 BFG wasn't designed for actual development or modding support. Many things like reading anything outside of the packed resource files was not supported. I also fixed many things in the renderer like r_showTris. +* PNG image support +* Collada .dae model support in addition to .ase and .lwo for static map models +* Added back dmap and aas compilers (mapping tools, thanks to Pat Raynor) +* Added in-engine Flash debugging tools and new console variables. + These tools help to analyse the id Tech view of Flash and what SWF tags are supported and how they are interpreted + by id Tech's own ActionScript 2 interpreter + - swf_exportAtlas + - swf_exportSWF + - swf_exportJSON + - swf_show : Draws the bounding box of instanced Flash sprites in red and their names + +* Added Steel Storm 2 Engine render demo fixes + +* Merged LordHavoc's image compression progress bar which shows up in the map loading screen + when loading and compressing new images from mods If you want to start mod from a directory, you should first specify your mod directory adding the following command to the launcher: @@ -72,46 +90,45 @@ If you want to start mod from a directory, you should first specify your mod dir so it would end up looking like: RBDoom3BFG +set fs_game modDirectoryName - IMPORTANT: RBDOOM-3-BFG does not support old Doom 3 modifications that include sourcecode modifications in binary form (.dll) You can fork RBDOOM-3-BFG and create a new renamed binary that includes all required C++ game code modifications. --- -## Renderer Features Explained +# Renderer Features Explained -### HDR +## HDR Left: Wrong original Blinn-Phong in sRGB gamma space. Right: Gamma correct HDR rendering in linear RBG + ACES Film Tonemapping Try it yourself, it is hard to see the effect in a single Screenshot. -### Extra Ambient Pass +## Extra Ambient Pass Left: No extra ambient pass. Ambient is pure black. Right: Extra ambient pass with r_forceAmbient 0.2 -### Screen Space Ambient Occlusion +## Screen Space Ambient Occlusion Left: No HDR and no SSAO. Right: r_useSSAO 1 darkens the corners of the scene and also removes too much ambient added by the extra ambient pass -### Filmic Post Processing +## Filmic Post Processing Left: No post processing except HDR tone mapping. Right: r_useFilmicPostProcessing 1 adds Technicolor color grading and film grain --- -## ".plan" +# ".plan" * ~~Fix GPU Skinning with Vulkan~~ * ~~Fix the lighting with stencil shadows with Vulkan~~ * Finish adapting the Vulkan renderer backend based on Dustin Land's vkDOOM3 * Port all the extras like HDR, Shadow Mapping and Post Processing to Vulkan -* Use ImGui to show renderer stats like com_showFPS 2 and more detailed renderer stats +* ~~Use ImGui to show renderer stats like com_showFPS 1 and more detailed renderer stats~~ * Get ImGui to run with Vulkan and show the Vulkan memory fragmentation with it live * Finish PBR texture support @@ -121,7 +138,7 @@ Left: No post processing except HDR tone mapping. Right: r_useFilmicPostProcessi * Evaluate Blender 2.8 as a complete replacement for D3Radiant and update the scripts for it --- -## May or may not ".plan" +# May or may not ".plan" * Add a DX12 Ultimate renderer backend * Add [Volumetric Lighting](http://www.alexandre-pestana.com/volumetric-lights/) * Give Mara's and McGuire's DeepGBuffer Screen Space Global Illumination a second try with Christoph Schieds' A-SVGF realtime denoising because A-SVGF works really well in Q2RTX @@ -130,12 +147,12 @@ Left: No post processing except HDR tone mapping. Right: r_useFilmicPostProcessi * Add texture compression based on [Basis Universal GPU Texture and Texture Video Compression Codec](https://github.com/binomialLLC/basis_universal) * Scrap complex and complicated multipass forward shading with a simpler forward+ solution * Rip & Tear renderer backend with modern approaches by [The-Forge](https://github.com/ConfettiFX/The-Forge) -* Imrpove SMAAA with Temporal Anti-Aliasing (SMAA T2x) +* Improve SMAA with Temporal Anti-Aliasing (SMAA T2x) * Replace collision detection and physics with PhysX 4.1 * Add glTF 2.0 support for static models and animations because it is the new JPG of 3D ;) --- -## General Notes +# General Notes A short summary of the file layout: @@ -158,15 +175,15 @@ Or the game can be purchased from Steam (with DRM): http://store.steampowered.com/app/208200/ -### Steam +## Steam The Doom 3 BFG Edition GPL Source Code release does not include functionality for integrating with Steam. This includes roaming profiles, achievements, leaderboards, matchmaking, the overlay, or any other Steam features. -### Bink Video playback +## Bink Video playback The RBDOOM-3-BFG Edition GPL Source Code release includes functionality for rendering Bink Videos through FFmpeg or libbinkdec. -### Back End Rendering of Stencil Shadows +## Back End Rendering of Stencil Shadows The RBOOM-3-BFG Edition GPL Source Code release includes functionality enabling rendering of stencil shadows via the "depth fail" method, a functionality commonly known as "Carmack's Reverse". @@ -174,7 +191,7 @@ This method was patented by Creative Labs and has finally expired on 2019-10-13. (see https://patents.google.com/patent/US6384822B1/en for expiration status) --- -## License +# License See docs/COPYING.txt for the GNU GENERAL PUBLIC LICENSE ADDITIONAL TERMS: The Doom 3 BFG Edition GPL Source Code is also subject to certain additional terms. You should have received a copy of these additional terms immediately following the terms and conditions of the GNU GPL which accompanied the Doom 3 BFG Edition GPL Source Code. If not, please request a copy in writing from id Software at id Software LLC, c/o ZeniMax Media Inc., Suite 120, Rockville, Maryland 20850 USA. @@ -182,7 +199,7 @@ ADDITIONAL TERMS: The Doom 3 BFG Edition GPL Source Code is also subject to cer See docs/CODE_LICENSE_EXCEPTIONS.md for all parts of the code The parts that are not covered by the GPL. --- -## Getting the Source Code +# Getting the Source Code This project's GitHub.net Git repository can be checked out through Git with the following instruction set: @@ -190,10 +207,16 @@ This project's GitHub.net Git repository can be checked out through Git with the The paramter --recursive is only required if you want to build RBDOOM-3-BFG with Vulkan support. +Existing repositories can be updated manually: + + > git submodule init + > git submodule update + + --- -## Compiling on Windows +# Compiling on Windows 1. Download and install the Visual Studio 2017 Community Edition. @@ -208,23 +231,21 @@ The paramter --recursive is only required if you want to build RBDOOM-3-BFG with RBDOOM-3-BFG/build/RBDoom3BFG.sln -### Optional if you want to use FFmpeg +## Optional if you want to use FFmpeg -6. Download ffmpeg-20151105-git-c878082-win32-shared.7z from ffmpeg.zeranoe.com/builds/win32/shared - or - ffmpeg-20151105-git-c878082-win64-shared.7z from ffmpeg.zeranoe.com/builds/win64/shared +6. Download ffmpeg-4.2.2-win64-shared.zip from ffmpeg.zeranoe.com/builds/win64/shared 7. Extract the FFmpeg DLLs to your current build directory under RBDOOM-3-BFG/build/ --- -## Compiling on Linux +# Compiling on Linux 1. You need the following dependencies in order to compile RBDoom3BFG with all features: On Debian or Ubuntu: - > apt-get install cmake libsdl2-dev libopenal-dev + > apt-get install cmake libsdl2-dev libopenal-dev libavcodec-dev libavformat-dev libavutil-dev libswscale-dev On Fedora @@ -232,11 +253,14 @@ The paramter --recursive is only required if you want to build RBDOOM-3-BFG with On ArchLinux - > sudo pacman -S sdl2 openal cmake + > sudo pacman -S sdl2 cmake openal ffmpeg On openSUSE > sudo zypper install cmake libSDL2-devel openal-soft-devel + You don't need FFmpeg to be installed. You can also turn it off by add -DFFMPEG=OFF to the CMake options. + It is enabled by default because the bundled libbinkdec is slow during development if compiled for Debug mode. + 2. Generate the Makefiles using CMake: > cd neo/ @@ -248,13 +272,13 @@ The paramter --recursive is only required if you want to build RBDOOM-3-BFG with > make --- -## Installation, Getting the Game Data, Running the Game +# Installation, Getting the Game Data, Running the Game If you use the prebuilt `Win32` or `Win64` binaries then simply extract them to your `C:\Program Files (x86)\Steam\SteamApps\common\Doom 3 BFG Edition\` directory and run RBDoom3BFG.exe. --- -The following instructions are primarily intented for `Linux` users and all hackers on other operating systems. +## The following instructions are primarily intented for `Linux` users and all hackers on other operating systems. To play the game, you need the game data from a legal copy of the game. @@ -316,14 +340,14 @@ Anyway: Your own Doom 3 BFG directory now should look like: /path/to/Doom3BFG/ -> RBDoom3BFG (or RBDoom3BFG.exe on Windows) - -> avcodec-55.dll - -> avdevice-55.dll - -> avfilter-4.dll - -> avformat-55.dll - -> avutil-52.dll - -> postproc-52.dll - -> swresample-0.dll - -> swscale-2.dll + -> avcodec-58.dll + -> avdevice-58.dll + -> avfilter-7.dll + -> avformat-58.dll + -> avutil-56.dll + -> postproc-55.dll + -> swresample-5.dll + -> swscale-5.dll -> base/ -> classicmusic/ -> _common.crc @@ -336,30 +360,46 @@ Anyway: 7. If you run into bugs, please report them, see [Bug Reports](#reports) --- -## New Console Variables +# New Console Variables and Commands -Directory | Description + +## Gaming Related +Name | Description :--------------------------------------| :------------------------------------------------ r_antiAliasing | Different Anti-Aliasing modes r_useShadowMapping [0 or 1] | Use soft shadow mapping instead of hard stencil shadows r_useHDR [0 or 1] | Use High Dynamic Range lighting -r_hdrAutoExposure [0 or 1] | Adaptive tonemapping with HDR. This allows to have very bright or very dark scenes but the camera will adopt to it so the scene won't loose details +r_hdrAutoExposure [0 or 1] | Adaptive tonemapping with HDR. This allows to have very bright or very dark scenes but the camera will adapt to it so the scene won't loose details r_exposure [0 .. 1] | Default 0.5, Controls brightness and affects HDR exposure key. This is what you change in the video brightness options r_useSSAO [0 .. 1] | Use Screen Space Ambient Occlusion to darken the corners in the scene r_useFilmicPostProcessEffects | Apply several post process effects to mimic a filmic look +## Modding Support +Name | Description +:--------------------------------------| :------------------------------------------------ +exportDeclsToJSON | Command: exports all entity and model defs to exported/entities.json for usage in Blender +postLoadExportModels | Export models after loading to OBJ model format +exportMapToOBJ | Convert .map file to .obj/.mtl +dmap | Command: Compiles a .map to its corresponding BSP .proc, Collision .cm files and Area Awareness System (AI navigation) .aas files. Just type dmap to list all options +dmap -glview | DMap option that exports the BSP areas and portals to .obj for debugging purposes +convertMapToJSON | Command: Convert .map file to new .json map format with polygons instead of brushes. This was easy because the original .map format is only an array of entities and each entity has a simple dictionary for its values. This JSON format contains all level data and can be imported and exported to Blender without loosing any data. The new DMap can also compile map files with the .json suffix like regular maps. + ____ -## Known Issues +# Known Issues ____ * HDR does not work with old-school stencil shadows * MSAA anti-aliasing modes don't work with HDR: Use SMAA * Some lights cause shadow acne with shadow mapping * Some shadows might almost disappear due to the shadow filtering +* [Vulkan] Video playback does not work +* [Vulkan] Shadow Mapping is not supported yet +* [Vulkan] HDR is not supported yet +* [Vulkan] Post processing and SMAA is not supported yet --- -## Bug Reports +# Bug Reports The best way for telling about a bug is by submitting a bug report at our GitHub bug tracker page: @@ -377,7 +417,7 @@ If you want to report an issue with the game, you should make sure that your rep You can find your qconsole.log on Windows in C:\Users\\Saved Games\id Software\RBDOOM 3 BFG\base\ --- -## FAQ +# FAQ **Q**: Why bother with DOOM-3-BFG in 2019 / 2020? **A**: It is fun, period. Doom 3 was an impressive milestone in total game development in 2004. In 2011 id Software added lot stuff from the development of Rage like its own Flash SWF and ActionScript 2 interpreter, proper support for gamepads and widescreens. It also combines the gamecode for D3 and its missionpacks and runs it in a seperate thread and it has many multithreaded rendering optimizations. DOOM-3-BFG is one of the most transparent games available where you can open all files and inspect how the game was built. diff --git a/RELEASE-NOTES.md b/RELEASE-NOTES.md index 9137b355..33db0cf2 100644 --- a/RELEASE-NOTES.md +++ b/RELEASE-NOTES.md @@ -33,8 +33,9 @@ _______________________________ - Turned off Half-Lambert lighting hack in favor of IBL -- Vulkan version builds on Linux. Big thanks to Eric Womer for helping out the SDL part. +- Vulkan version builds on Linux. Big thanks to Eric Womer for helping out with the SDL 2 part +- com_showFPS 1 uses ImGui to show more detailed renderer stats like the console prints with r_speeds diff --git a/neo/framework/Common_mapconvert.cpp b/neo/framework/Common_mapconvert.cpp index aa7fa84e..61fc68ac 100644 --- a/neo/framework/Common_mapconvert.cpp +++ b/neo/framework/Common_mapconvert.cpp @@ -584,7 +584,7 @@ CONSOLE_COMMAND( exportMapToOBJ, "Convert .map file to .obj/.mtl ", idCmdSystem: -CONSOLE_COMMAND( convertMap, "Convert .map file to new map format with polygons instead of brushes ", idCmdSystem::ArgCompletion_MapNameNoJson ) +CONSOLE_COMMAND( convertMap, "Convert .map file to new map format with polygons instead of brushes", idCmdSystem::ArgCompletion_MapNameNoJson ) { common->SetRefreshOnPrint( true ); @@ -627,7 +627,7 @@ CONSOLE_COMMAND( convertMap, "Convert .map file to new map format with polygons } -CONSOLE_COMMAND( convertMapToJSON, "Convert .map file to new map format with polygons instead of brushes ", idCmdSystem::ArgCompletion_MapNameNoJson ) +CONSOLE_COMMAND( convertMapToJSON, "Convert .map file to new .json map format with polygons instead of brushes", idCmdSystem::ArgCompletion_MapNameNoJson ) { common->SetRefreshOnPrint( true ); diff --git a/neo/imgui/BFGimguiImpl.cpp b/neo/imgui/BFGimguiImpl.cpp index ab2c7e69..ca3be9f0 100644 --- a/neo/imgui/BFGimguiImpl.cpp +++ b/neo/imgui/BFGimguiImpl.cpp @@ -424,7 +424,7 @@ void Render() ImGui::ShowDemoWindow(); } - ImGui::End(); + //ImGui::End(); ImGui::Render(); g_haveNewFrame = false; diff --git a/neo/renderer/RenderSystem_init.cpp b/neo/renderer/RenderSystem_init.cpp index 033eaf6d..da6df88c 100644 --- a/neo/renderer/RenderSystem_init.cpp +++ b/neo/renderer/RenderSystem_init.cpp @@ -744,7 +744,7 @@ void R_ReadTiledPixels( int width, int height, byte* buffer, renderView_t* ref = } // make sure the game / draw thread has completed - //commonLocal.WaitGameThread(); + commonLocal.WaitGameThread(); // discard anything currently on the list tr.SwapCommandBuffers( NULL, NULL, NULL, NULL, NULL, NULL );