*WIP* RenoDX Modding Guide - clshortfuse/renodx GitHub Wiki
Introduction
So you've decided to make your first RenoDX mod. First of all, welcome! We've got a great community of modders in the RenoDX discord. Don't hesitate to ask questions, as this guide is going to be extremely generalized, and games will often throw you curveballs. We're all happy to help! It's easy to feel overwhelmed while learning the ropes, just know that we all felt some amount of this, and it will all start to make sense if you keep pushing on.
In this guide, we will point you towards resources for getting your codebase started, as well as cover some basic workflow suggestions. To follow, we'll walk through a simple Unity game mod utilizing what Unity calls an Uber shader. At the end of this guide, if the stars align, you will have created your first HDR mod for a Unity game. Note that this is just one way to achieve this goal, but it is the most straight forward and beginner friendly.
Prerequisites
It is important that these steps are followed precisely.
- Install Git
- Setup your RenoDX codebase
Setting Up Your Game
- Open up VS Code and open the folder containing the RenoDX repository
- Install the suggested extensions that VS Code pops up into the bottom right corner
- Go to the CMAKE tab. Under Configure, select Clang x64. Under Build, select Clang x64 Release, and switch All to Generic. Click Build at the bottom left once it finishes configuring.
- Now switch from Generic to Devkit. Click Build.
At this point, you'll have created the generic addon file and the devkit, which will get you started with developing your mod.
- Head to your renodx folder and enter \build\Release\
- From here, I'd encourage setting up symlinks to your game folder for the renodx-generic.addon64 and renodx-devkit.addon64 files. This will make it so that new builds of your mod automatically apply to your game folder. If you don't want to do that, copy paste for now.
- Install ReShade with Addon Support to the game, and download Lilium's HDR shaders. The HDR Analysis tool included is an extremely important part of the process.
Your game is now setup for development.
Using the Devkit
Locating the Tonemapper/Clipping Point
This is where the magic happens. We need to figure out when the game takes it's internal HDR information and transforms it into an SDR image. If you're lucky, this is the only thing you'll need to figure out to make your first HDR mod. Let's go over some methods. Once you think you've found your tonemapper, continue on to the next section.
Check the reflections in the devkit
A "reflection" is basically a note in the shader to help identify its purpose. When these are available, they are an invaluable tool. Luckily, they usually are available in Unity games.
With Unity engine, the shader you'll be looking for typically has Uber in the name. This shader is where all the post processing is gathered and combined, with a final step for tonemapping. This tonemapping step is applied via a LUT (look up table), which is basically a small texture that contains the end result of the tonemapper's color changes across the whole range of colors.
Find where it goes from an HDR resource type to an SDR resource type
This is fairly self explanatory. Most games will run the tonemapper in the resource type that contains a 10+ bit SRV and an 8 bit RTV. The reason for this is that an 8 bit resource is all that's needed to hold the SDR image.
Toggle draw on shaders and see what happens
This is a bit of a last resort. What you'll want to do here is identify which shaders exist right before the UI. From here, it's either going to be the last shader, or it'll be a shader that, most likely, freezes the whole image when you toggle draw on it. You won't know for sure until you dump the shader and look at the code, as games can and often do have shaders that follow tonemapping.