NVIDIAGameWorks / bridge-remix

This is the NVIDIA RTX Remix Runtime Bridge repository
MIT License
157 stars 24 forks source link
nvidia pathtracing raytracing remix rtx rtxremix

NVIDIA RTX Remix Bridge

Build Status

The NVIDIA RTX Remix project allows bringing high quality pathtraced rendering, lighting, shadows etc. into classic games. This repo contains the NVIDIA RTX Remix Bridge client and server components required for enabling a 32-bit game to interact with the 64-bit Remix Runtime dll.

NOTE: To experience the full feature set of NVIDIA RTX Remix, binaries compiled from this repo need to be combined with the binaries from the dxvk-remix repo on GitHub. For additional details and explanation see below!

Prerequisites

  1. Microsoft Windows 10 or 11
  2. Microsoft Visual Studio
    • Visual Studio 2019 is tested.
    • Visual Studio 2022 should also work with MSVC v142 build tools installed.
    • The free Commmunity Edition of Visual Studio will work fine.

      NOTE: Make sure to install the MSVC v142 - VS 2019 C++ x64/x86 build tools from the Individual Components list in the Visual Studio Installer interface. NVIDIA RTX Remix has only been tested with the Visual Studio 2019 build tools, and newer compiler versions may or may not work and/or lead to unexpected results/issues.

  3. Meson - v0.61.4 has been tested, latest version should also work fine.
    • Follow instructions on how to install and reboot the PC before moving on (Meson will indicate as much)
  4. Python - version 3.9 or newer

How to build

To generate the initial Visual Studio solutions and build, run build_bridge_all.bat, which will generate build directories for the debug/release configurations for both 32 and 64 bit platform.

You can also open and rebuild the projects/solutions individually for different configurations from project files generated under the _vs subdirectory which will be added under the root directory.

NOTE: To get a full Remix Bridge build you will need to open and compile both the x86 as well as the x64 solution, because the bridge client component is built by the x86 solution, and the bridge server component is built by the x64 solution.

The build output from the x86 solution goes into a folder called _output which is located (and will be created if it doesn't exist) in the repo root.

The build output from the x64 solution goes into a folder called .trex which is located inside the _output directory in the repo root.

NOTE: Technically the Remix Bridge can be used on a game by itself without the Remix Runtime components from the dxvk-remix repo, but when used that way it will fall back onto the x64 system DirectX9 runtime that is installed in Windows and not be capable of performing any raytracing or asset replacements.

NOTE: Prior to building bridge it is recommended to delete any build directory that was previosly created with prefix _comp.. and _vs directory under root directory especially if this is your first time building bridge with ninja backend build system.

How to run

Drop and go

All you need to do to run Remix Bridge is copy the build output into a game directory so that the Remix Bridge d3d9.dll gets picked up on game launch, which will then load all other components.

NOTE: Depending on the game the correct location for the Remix Runtime files may vary, it could be in the game's root directory or a subfolder called bin or something like that. It may take some trial and error to figure out the correct location for a specific game!

Using the Remix Bridge Launcher

An alternative approach to loading the Remix Bridge d3d9.dll into a game would be to use an executable called NvRemixLauncher32.exe, which is generated by the Visual Studio x86 solution. Some games will not pick up the Remix Bridge d3d9.dll and require injection at runtime instead. The launcher executable needs to be located next to the other Remix Bridge files and can then be used from the command line like this:

> NvRemixLauncher32.exe <game executable> <other launch parameters>

Run the launcher without any parameters to see the list of available options that can be used.

Deploy built binaries to a game

  1. First time only: copy gametargets.example.conf to gametargets.conf in the project root

  2. Update paths in the gametargets.conf for your game. Follow example in the gametargets.example.conf. Make sure to remove "#" from the start of all three lines. Configurations for multiple games can be added at once.

  3. Open and re-save top-level meson.build file (i.e. via notepad) to update its time stamp, and rerun the build. This will trigger a full meson script run which will generate a project within the Visual Studio solution file and deploy built binaries into the games directories specified in gametargets.conf

Visual Studio debugging

The intended way to use these components is to use the 32-bit d3d9.dll output compiled by the client d3d9 project from the x86 solution and the 64-bit server dll compiled by the server NvRemixBridge project in the x64 solution. If the file exists inside the .trex directory, the server bridge component will load the 64-bit Remix Runtime (dxvk-remix) d3d9.dll to pass the rendering commands and results to the Vulkan pathtracing renderer and back, but by default it loads the regular system DirectX9 dll that is installed in the default Windows system directory.

NOTE: The x86 solutions contain both the client and server projects, but not the copy job for the server project, because the server output comes from the x64 solution, which only contains the server project and copy job for it. The server project was left in the x86 solution only to make cross-process debugging easier so that Visual Studio picks up the source files correctly when doing child process debugging.

If you enter the game executable in the Command field and the game path as the Working Directory property in the d3d9 project settings on the Debugging property page, then it makes it easier to launch the game and debug Remix Bridge directly from Visual Studio.

NOTE: It is recommended to download the VS extension to help debugging/attaching to child processes (such as the server NvRemixBridge component)

For Visual Studio 2015, 2017, 2019: https://marketplace.visualstudio.com/items?itemName=vsdbgplat.MicrosoftChildProcessDebuggingPowerTool

For Visual Studio 2022: https://marketplace.visualstudio.com/items?itemName=vsdbgplat.MicrosoftChildProcessDebuggingPowerTool2022

Using RTX Remix Bridge with Retail Games

Remix Bridge should work out of the box with many retail games as well, but depending on the game extra configuration steps may be required to make sure the game runs with the correct DirectX settings. For example Portal requires being launched with -dxlevel 70 to work properly.

Also, as mentioned above if you want to take advantage of the pathtracing capabilities of RTX Remix then you need to combine the Remix Bridge binaries with the Remix Runtime dll from the dxvk-remix repo on GitHub.

The easiest way to get a complete binary package is by downloading one of the releases from the RTX Remix repo on GitHub.

Remix Bridge Architecture & Implementation Details