Depth Resolve - NVSE
Acknowledgement
As usual, thank you to WallSoGB for all your support. Also shout out to Hit who indirectly motivated me to finally tackle this one.
Description
TLDR: Makes your game faster whenever DOF is active. Makes DOF more precise by using the actual depth buffer. Removes useless code from the rendering pipeline.
Depth Resolve - NVSE is a xNVSE plugin that serves one primary purpose - as the name suggests - resolving the depth buffer. What is a depth buffer? During rendering, the GPU is processing 3D objects and turning them into an 2D image you see on your screen. This is (usually) done by keeping two buffers, one which is basically a normal color texture, and a second, the depth buffer. Depth buffer holds depths, which represent a certain mapping of the distance of a particular pixel you see on the screen from the camera.
The main use of the depth buffer is basically to give the scene depth. This is accomplished by using what you might know as the depth test - the GPU basically checks that the pixel it's currently processing would not be rendered on top of another pixel which is closer to the camera.
It can also be used in many other ways however. Users of ReShade, NVR, or even ENB, probably use it indirectly through one of the many effects that these graphical extenders lets them use.
The primary (and only) use of the depth buffer in FNV (besides depth tests) is Depth of Field (DOF). The effect is not widely used in vanilla (just in dialogues to the best of my knowledge), however, there are certain mods that use it - such as Blurry Distance or Dynamic Depth-Of-Field. Nothing is fundamentally wrong with these mods, but there is a slight problem.
Vanilla FNV cannot use the depth buffer directly. This is because D3D9, the graphical API used, does not expose this capability. There are certain vendor (aka manufacturer) specific hacks around it, but they weren't used by Bethesda until the original Skyrim. What this means is that when the game wants to render DOF, it first has to render the scene again (slightly simplified). This time, instead of drawing the colors of each pixel into a texture, it draws the depth. This depth texture is then used for the DOF effect. As you might imagine, this is wildly inefficient. In exteriors, this can amount to hundreds (or even more) draw calls, purely to render the depths.
This brings us to Depth Resolve - NVSE. I have replaced this vanilla logic with an actual depth buffer resolve, that is, creating a texture out of the original depth buffer to use for whatever effects need it. As noted above, in vanilla this is only DOF. But I have plans to use this further in the future. Oh, and I also removed some useless draw calls that happened when DOF was active and you had a weapon out.
Technical Note
This should work on all modern GPUs. However, there is an important caveat with DXVK on Nvidia. Depth Resolve - NVSE does not support DXVK versions 2.6.2 to 2.7.0 for Nvidia users, because the authors decided to hide vendor hacks based on what the user's GPU is (i.e. pre 2.6.2, you could be using Nvidia, but get access to AMD vendor extensions for D3D9). 2.7.1 "solves" this by hiding Nvidia GPUs from DXVK. Not a fan.
Therefore, if you are a DXVK user, use either 2.6.1 or 2.7.1+. I highly recommend using 2.6.1 at most.
Requirements
- Shader Loader - NVSE
- LOD Flicker Fix - NVSE
- Depth of Field Fix - NVSE [optional - not technically required, but DOF without it renders on top of hands/drawn weapon]
Installation
Install as normal. Load order does not matter.
Source Code
Instructions
Install as normal.
Requirements
Optional Requirements
Depth Resolve - NVSE
Main file: Install as normal.