New Vegas Reloaded (NVR) Wiki

website·Indexed 31 days ago

https://dlpnd.github.io/nvr-wiki/

Documentation for New Vegas Reloaded (NVR), featuring installation guides, a FAQ for editing settings, and detailed references for shaders including PBR, Volumetric Fog, Depth of Field, and Tonemapping. Includes a technical tutorial for porting shaders to NVR using HLSL, Visual Studio, and ShaderManager.cpp.

Tokens
16.2K
Snippets
85
Records
141
Agent score
75%

What's inside New Vegas Reloaded

  1. Overview of New Vegas Reloaded (NVR) features

    New Vegas Reloaded is a highly configurable graphics extender for Fallout: New Vegas. It enables a wide range of advanced visual effects, including Ambient Occlusion, Bloom, Shadows, Depth of Field, Tonemapping, Volumetric Fog, God Rays, Coloring, Precipitation Effects (Rain/Snow Accumulation), and enhanced Water (Surface and Underwater) effects.
  2. Understand NVR shader file types

    New Vegas Reloaded (NVR) uses two types of shader files:

    • .fx.hlsl: Contains the source code. This is the file developers edit.
    • .fx: The compiled version of the shader. The NVR framework automatically compiles .fx.hlsl files into .fx files at runtime for rendering.
  3. Update shader constants in ShaderManager.cpp

    To pass values from the NVR configuration (.toml) to a shader, you must implement logic within ShaderManager::UpdateConstants().

    Key implementation details:

    • Placement: Place the logic outside of the if (TheSettingManager->SettingsChanged) block if the shader requires continuous updates for day/night or interior/exterior transitions.
    • Activation Check: Wrap the logic in a check to see if the effect is enabled (e.g., if (Effects.YourEffectName->Enabled)).
    • Reading Settings: Use TheSettingManager->GetSettingF(category, key) to retrieve floating-point values from the TOML file.
    • Handling Environment Transitions: Use the lerp() function to blend between 'Day' and 'Night' settings based on the isDayTime variable for exterior locations. Use a simple assignment for interior locations via the isExterior check.
    if (Effects.LiftGammaGain->Enabled)
    {
        if (isExterior) 
        {
            // Blend between Night and Day settings based on time of day
            ShaderConst.LiftGammaGain.LiftGamma.x = lerp(
                TheSettingManager->GetSettingF("Shaders.SweetFXLiftGammaGain.Night", "LiftRed"),
                TheSettingManager->GetSettingF("Shaders.SweetFXLiftGammaGain.Day", "LiftRed"),
                isDayTime
            );
            // ... repeat for other channels (y, z, w)
        }
        else
        {
            // Use static Interior settings
            ShaderConst.LiftGammaGain.LiftGamma.x = TheSettingManager->GetSettingF("Shaders.SweetFXLiftGammaGain.Interior", "LiftRed");
            // ... repeat for other channels
        }
    }
  4. Prerequisites for installing New Vegas Reloaded

    Before installing New Vegas Reloaded (NVR), ensure you have the following components installed. Note that only Steam, GOG, or Epic Games versions of Fallout New Vegas are supported by xNVSE.
  5. Install NVR presets

    Presets should be placed in the NewVegasReloaded\nvse\Plugins directory. For users of Mod Organizer 2 (MO2), it is recommended to create a new mod with the folder structure nvse/Plugins and place the preset inside that structure.
  6. Prepare a third-party HLSL shader for NVR porting

    When porting a shader (e.g., from SweetFX or ReShade), you must perform the following cleanup on the HLSL code before integrating it into NVR:

    1. Remove UI Metadata: Strip out framework-specific UI annotations (e.g., __UNIFORM_SLIDER_FLOAT3, ui_label, ui_tooltip).
    2. Rename Variables: All uniform variables must be renamed to include the TESR_ prefix to comply with NVR's naming convention.
    3. Update Logic: Update the effect code to reference the new TESR_ prefixed variable names.
  7. Install and configure ReShade with NVR and dxvk

    To use ReShade and dxvk together with NVR, follow this specific installation order:

    1. Install NVR.
    2. Install dxvk.
    3. Install the latest ReShade and select the Vulkan option during installation.
    4. Disable MSAA in both the game launcher and NVR (required for Depth Buffer effects).

    If the depth buffer is at the wrong resolution, calculate the ratio (Depth Buffer Height / Game Height) and add Reshade_Depth_input_y_scale to your ReShade global processor definition with that value.

  8. Define shader variable structures in ShaderManager.h

    To integrate shader variables into the C++ engine, you must modify ShaderManager.h in three steps:

    1. Create a struct: Define a new struct inside struct ShaderConstants to hold the variables. Use D3DXVECTOR4 for HLSL float4 types and float for HLSL float types.
    2. Declare the property: At the end of struct ShaderConstants, declare an instance of your new struct.
    3. Add to EffectsStruct: Add a pointer to the effect (alphabetically ordered) inside struct EffectsStruct using the EffectRecord* type.
    // 1. Inside struct ShaderConstants
    struct LiftGammaGainStruct {
        D3DXVECTOR4  LiftGamma;
        D3DXVECTOR4  GammaGain;
        float Gain;
    };
    
    // 2. At the end of struct ShaderConstants
    LiftGammaGainStruct  LiftGammaGain;
    
    // 3. Inside struct EffectsStruct
    EffectRecord*  LiftGammaGain;
  9. Set up the development environment for New Vegas Reloaded shader porting

    To port shaders to New Vegas Reloaded (NVR), you need the following tools installed:

    • Git: For downloading the source code.
    • Visual Studio Community 2019: For editing and compiling the C++ source.
    • HLSL Tools for Visual Studio: An extension to facilitate editing shader code.
    • Notepad++: Recommended for editing .toml settings files.

    To clone the source code, run the following command in Git Bash: git clone -b nightly https://github.com/mchaptel/TESReloaded10.git --recurse-submodules --remote-submodules

    git clone -b nightly https://github.com/mchaptel/TESReloaded10.git --recurse-submodules --remote-submodules
  10. Install New Vegas Reloaded

    New Vegas Reloaded is installed using a standard mod manager. Because the extender can be performance-intensive, it is highly recommended to implement performance optimizations (such as those found in WallSogB's Fallout New Vegas Performance Guide) before installation.
  11. Download the latest version of New Vegas Reloaded

    New Vegas Reloaded is officially distributed via Discord. It is highly recommended to use the latest nightly build from the TES Reloaded Discord. Avoid versions found on the Nexus or version 3.14, as they are outdated and unsupported by current maintainers.