Skip to content

Adding Debug Sliders

marat569 edited this page Dec 3, 2024 · 1 revision

Debug Sliders

When we need to test things in real time, sometimes its a PITA to add and remove sliders in addon.cpp.

RenoDX has a built in macro that makes adding debug sliders easy, and even better its super easy to remove them before shipping your mod.

debugsliders

Step one is to add the debug cbuffers to shared.h -- all the cbuffers must be named "debug[2 digits]" -- example debug01

These are the 3 cbuffers I added to my shared.h:

  float debug01;
  float debug02;
  float debug03;

Now we need to add the actual sliders to addon.cpp

For every debug cbuffer you made, add AddDebugSetting(shader_injection, [number]), in the renodx::utils::settings::Settings settings = { section (Where you normally add sliders like Peak Nits, Game Nits, etc)

For my 3 debug sliders, I add these lines towards the end:

    // Start debug sliders
    AddDebugSetting(shader_injection, 01), //debug01
    AddDebugSetting(shader_injection, 02), //debug02
    AddDebugSetting(shader_injection, 03), //debug03

That's it! You now have 3 debug sliders that look just like the ones above!

To get rid of them, just comment those 3 lines out! You can leave the cbuffers in shared.h!

Clone this wiki locally