Skip to content
VancetePublic

About

A lightweight upscaler designed for handhelds and low-end PCs, offering better results than FSR 3.1 at higher presets, with superior performance. Also for VR!

Resources

Stars

80 stars

Watchers

7 watching

Forks

Repository files navigation

DittoSR

Buy Me a Coffee

DittoSR

DittoSR is a temporal upscaler for PC games. It started from Qualcomm's Snapdragon Game Super Resolution 2 (GSR 2), a light upscaler made for phones, and was reworked heavily to hold up in demanding PC games (dense foliage, fast camera turns, high ratios) while staying lighter than the usual alternatives. Thought for handheld PCs while also working pretty great on high-end PCs!

It ships as a drop-in FidelityFX API provider for DirectX 12 and Vulkan: a game that offers FSR 3.1 upscales through DittoSR instead, with no change to the game. For games whose FSR it can't reach, it can also take XeSS's place on DirectX 12. Through OptiScaler it also runs natively on DirectX 11, as an NGX (DLSS) runtime.

You can expect a perceived quality between FSR 3.1 and FSR 4.1 while being lighter than both. A small dittosr.ini next to the DLL sets the sharpness and the frame blending, reloaded live with F9.

FSR and DittoSR comparison

Install

With the loader (recommended)

Extract DittoSR.zip and run DittoSRLoader.exe:

  1. Pick the game in the Steam game list, or Browse... to its folder (the install folder is enough: the loader looks below it).
  2. Under Replace, choose FSR (the default) or XeSS.
  3. The DLLs to replace are found and checked for you. Install DittoSR, then choose FSR (3.1 or later) or XeSS in the game's settings.

Restore game's files puts the originals back, Settings sets the sharpness and frame weight, and Log opens dittosr.log. The game's DLLs are checked for AMD's or Intel's signature and backed up to dittosr-backup\ before anything is replaced.

With OptiScaler

OptiScaler v10 (recent nightly builds) loads custom FidelityFX providers. The loader finds it (and its version) when scanning the game: an OptiScaler button appears before FSR and XeSS, and installs DittoSR as its custom provider (DirectX 12 and Vulkan) without touching the game's files. By hand, copy build\amd_fidelityfx_dx12.dll and build\amd_fidelityfx_vk.dll from the zip into OptiScaler's own folder (the OptiScaler folder next to the game's executable, if there is one) as:

custom\DittoSR\ffx\amd_fidelityfx_dx12.dll
custom\DittoSR\ffx_vk\amd_fidelityfx_vk.dll

The first serves DirectX 12 games, the second Vulkan ones (Enshrouded, No Man's Sky): OptiScaler looks for each in its own folder.

DirectX 11, natively (an OptiScaler build whose custom DLSS runs on DX11 itself, not only through DX12): DittoSR also speaks NGX, the API DLSS is driven through, on D3D11. Copy build\nvngx.dll (the same DLL) as:

custom\DittoSR\dlss\nvngx.dll

OptiScaler hands it the game's DLSS inputs and DittoSR upscales on the game's own D3D11 device, with no DX12 copy in between. On DX11 the upscaler is the same as on DX12 (the FP32 shaders); Ditto Relight is DX12 and Vulkan only, and the F7 menu is the window one Vulkan uses.

DittoSR then shows up in OptiScaler's upscaler list. A dittosr.ini in the same folder is optional (the defaults apply without it). OptiScaler's settings drive it:

  • Sharpness (with Override on): DittoSR's sharpness, the same scale as the ini's (0.6 as reconstructed). 0 means "no sharpening" to OptiScaler, so DittoSR then keeps the ini's value: use 0.01 for the softest.
  • The FSR 3 presets set the frame weight: Stability 1, Default the ini's (2), Motion 3. By hand, the Velocity Factor below 1 is steadier (weight 2 x it), and at 1 the Reactive Scale below 1 more responsive (up to 4).
  • A DittoSR tab in OptiScaler's menu (OptiScaler builds with the plugin API) holds the rest: the frame weight (shown as the presets set it; at Default, or with Override ticked, the slider's), the anti-shimmer, the sharpening filter, the debug views and the indicator. They are kept in OptiScaler.ini's [Plugin.DittoSR] section, under the ini's key names (frame_weight, anti_shimmer, sharpen_mode, debug_view, indicator; plus frame_weight_override, the tab's and the F7 menu's), and win over dittosr.ini's. Save in the tab (or OptiScaler's Save INI) writes them, and so does the F7 menu's Save for the ones the tab holds; Defaults removes them.

With the scripts

scripts\install.ps1 -Dir "<folder>" and scripts\uninstall.ps1 -Dir "<folder>" do the same as the loader on FSR. On SteamOS and Linux (Proton), bash scripts/install.sh <app id or folder> and scripts/uninstall.sh (not yet tested; leave PROTON_FSR4_UPGRADE off).

Notes

  • XeSS mode: some games, such as Cyberpunk 2077, build their FSR into the executable, so DittoSR never gets an upscale to do. If the game offers XeSS on DirectX 12, install on XeSS: DittoSR's libxess.dll runs the upscale and forwards everything else to the game's own XeSS (kept as libxess_orig.dll).
  • AMD's DLL, kept as .orig.dll, keeps frame generation working, and with [debug] enabled=1, F10 switches between DittoSR and AMD's FSR live.
  • Online games: don't. Replacing a game's DLLs can trigger anti-cheat systems.

What it does

Each frame, four compute passes run on the game's command list:

Pass Size What it does
convert.hlsl render GSR 2's convert pass: the motion of the nearest of the 3x3, the depth for the disocclusion test, and how much of the image changed (scene cuts settle at once)
motion.hlsl render the motion checks (an object's motion against its neighbours', disocclusion) and a reactive mask when the game gives none
upscale.hlsl output the jittered samples through an edge-directed Gaussian, blended with the history moved along the motion vectors and clipped against the samples
sharpen.hlsl output a light contrast-adaptive sharpen

What changed from GSR 2's upscale, in short:

  • A per-pixel stability level: a pixel stable for a few frames takes less of each new frame and stops shimmering; one whose history was just cut converges as fast as before.
  • The new frame's share follows how close its jittered samples landed, and drops where the difference from the history keeps flipping sign (aliasing rather than change).
  • Disocclusion from the previous frame's depth instead of GSR 2's depth clip, which cut the history at every depth edge and made foliage noisy.
  • The history is clipped by its low frequencies only, so the detail it has accumulated survives the current frame's aliasing.
  • The history's resampling blur is made up in motion: moved by a fraction of a pixel each frame, its detail would otherwise soften frame after frame.
  • An HDR encoding (Reinhard, then a square root) so blends behave in a perceptual domain.

On integrated GPUs the history is stored as RGB10A2 (history_10bit, on by default) and, up to 2.5x, the sharpening runs inside the upscale instead of a pass of its own (fused_sharpen). Half precision (fp16) is off by default: on the ROG Ally it was slower than full precision. The Vulkan path runs the same passes from the same HLSL, with only Vulkan 1.1 core (no extension, no optional feature) and the same results as DirectX 12, auto exposure, anti-shimmer, 10-bit history and fused sharpening included; its shaders are FP32.

Results

Cyberpunk 2077 (in game)

RTX 5070 Ti, 3840x2160 output, render 1670x939 (2.3x), the same view: DittoSR 174 fps, FSR 146–148 fps.

Offline harness

A synthetic HDR scene upscaled to 1440x810 through the FidelityFX API, so DittoSR and AMD's FSR 3.1.5 take exactly the same inputs (test/harness.cpp). PSNR is against a 4x4-supersampled reference; shimmer is the mean difference between consecutive frames once the pan is undone (lower is steadier). 64 frames; DittoSR 0.7.0's defaults.

Scene DittoSR AMD FSR 3.1.5
Dense grass, still, 2x 34.8 dB, shimmer 1.27 32.5 dB, shimmer 0.75
Dense grass, pan 3 px/frame, 2.3x 32.8 dB, shimmer 2.62 31.9 dB, shimmer 3.66
Dense grass, uneven pan 12 ± 3 px/frame, 2x 33.3 dB, shimmer 2.83 31.1 dB, shimmer 6.81
Moving object over a detailed background, 2x 31.7 dB 28.9 dB

In short: sharper than FSR 3.1.5 in every scene and steadier on foliage in motion; FSR is steadier on still foliage.

GPU time

The upscale's GPU time (scripts\bench.ps1, the median of 400), RTX 5070 Ti:

Output FSR Quality (1.5x) FSR Performance (2x)
1920x1080 0.23 ms 0.18 ms
2560x1440 0.40 ms 0.33 ms
3840x2160 0.92 ms 0.77 ms

In-game menu

F7 opens a side panel on the left of the game: DittoSR's GPU time and the frame time as a graph, the upscaler (DittoSR or the game's own, and the side-by-side comparison), the sharpening filter (CAS or RCAS), sharpness, frame weight, anti-shimmer, the debug views and the indicator, and under EXPERIMENTAL Ditto Relight (DirectX 12 and Vulkan: ambient occlusion and light bounced off nearby surfaces, see relight below). While FSR's settings set the frame weight (OptiScaler's presets, see below), its slider shows theirs; moving it overrides them, Enter gives them back. Changes apply at once; Save writes them to dittosr.ini (only what differs from the defaults, besides sharpness and frame weight), Defaults restores the defaults, Revert reads the file again.

Arrows select and adjust, Enter resets a slider to its default or switches an option, Backspace or F7 closes it. While it is open the arrows and Enter don't reach the game; where the game shows a mouse cursor, the panel takes clicks and drags too. menu_key changes the key (0: no menu).

On DirectX 12 the panel is drawn into the game's frame. On Vulkan it is a window of its own over the game's, shown while the game is in front: a game in exclusive fullscreen may hide it - borderless or windowed shows it.

Settings (dittosr.ini)

F9 reads the file again while playing.

Section Key Meaning
[dittosr] version the DittoSR version the file was written for: the loader and the install scripts update older settings by it
[dittosr] enabled 1 DittoSR; 0 AMD's FSR instead (needs AMD's DLL alongside as .orig.dll)
[dittosr] sharpness 0 soft, 0.6 (default) as reconstructed - with CAS no sharpening then, as sharpen_mode=2, its cost saved -, 1 sharpened
[dittosr] frame_weight each new frame's weight, 0.25 to 4 (default 2): lower is steadier and smoother, higher is crisper in motion with more shimmer. Below 1.5x DittoSR uses less of it, half at 1x (native AA), where every pixel gets a new sample each frame; the menu and the ini keep the value as set
[debug] enabled 1: F10 switches DittoSR ↔ AMD's FSR live, and the log describes the first upscales in full
[debug] indicator 1: a small pink DittoSR face in the top-left corner while DittoSR upscales

dittosr.log, next to the DLL, records the context's creation and DittoSR ran (frame 1).

Advanced keys, not in the shipped file but read from [dittosr] when added (src/dittosr.h describes each with its default):

  • ratio_quality, ratio_balanced, ratio_performance, ratio_ultra_performance: the ratio each quality mode gets (1 to 4), e.g. ratio_ultra_performance=2.5. FidelityFX API only.
  • compare=1, the menu, or a key of its own (compare_key, none by default): DittoSR on the left half, the game's own upscaler on the right (needs the game's DLL alongside).
  • menu_key (0x76, F7; 0 off): the in-game menu's key.
  • anti_shimmer (0.6 up to 2x, 0.45 at 3x; 0 off), auto_reactive (0.5; 0 off), stab_step: steadiness against responsiveness.
  • Glints (always): where one of a pixel's 4 nearest samples is bright, the new frame's estimate averages them in linear light - sparks smaller than a pixel keep their light.
  • The blend domain: linear_blend (4 by default; 0: encoded, as before) (1: the new frame's estimate from its samples and the blend with the history in linear light, the box and the clip still encoded - a highlight smaller than a pixel keeps its light; 2: the same in Reinhard's domain, the encoding's power alone undone - no flashes, cheaper; 3: 2 for the blend alone, the cheapest; 4: 1 for the blend alone - the dark outlines against a bright HDR sky gone at 3x as with 1, most of them at 1x).
  • up_thin_lock (1): lines one sample thin locked at rest - a wider clip box, less of each new frame (FSR's locks).
  • Particles (always): where a texture is swapped under a still pixel - a flipbook fire or smoke animating at its own rate - the history's clip box narrowed so the old texture is clipped, not blended in.
  • temporal_clip_box (1): at rest, the history's clip box from the luma's mean and spread over the frames, not the jittered 3x3 alone.
  • frame_weight_override (0; 1: frame_weight wins over the weight FSR's settings set - OptiScaler's presets, or the game's; the F7 menu sets it when its slider is moved).
  • history_sharpen (1; 0 off): how far the history's resampling blur is made up in motion (fine moving detail).
  • alpha_rest (0.1) and share_far (0.2, down to half of it by 3x): each new frame's share where nothing moves, and x that where none of its samples landed near the pixel; gamma_rest (3): how far from the new frame's samples the accumulated image may stay there. What moves with no motion vectors of its own (grass swaying in its vertex shader) is found by its luma leaving the range each pixel has kept over the last frames, and follows the new frame there: env_gain (40; 0 off), env_tol (0.03), env_rel, env_decay, env_cap (0.5), env_rest. In slow motion the share is alpha_slow (0.15) from ramp_lo to ramp_hi pixels a frame (0.25 to 1).
  • sharpen_mode (0 CAS, default; 1 RCAS, FSR 1's robust CAS: one strength for the 3 channels, less on noise - its own pass at every ratio, no fused sharpening; 2 off: no sharpening and no sharpening pass, the upscale writes the image as reconstructed - sharpness 0.6's look at rest, unsharpened in motion; less GPU time): the sharpening filter, also in the menu.
  • relight (0; also the F7 menu's EXPERIMENTAL Ditto Relight; DirectX 12 and Vulkan - DirectX 12 alone: the checkerboard, the blue noise, the interleaved GI, the FP16 main pass): ambient occlusion and a one-bounce global illumination in screen space after CORTAO's circular occluders (MIT, licenses/LICENSE-cortao.txt), applied to the game's colour before the upscale - its rays its reach ao_radius (0 view units: no limit in the world) and ao_screen (at most 0.5 of the screen's height), and ao_contact (2, 0 - 4: the nearest occluders darker); ao_strength (0.75; also the menu's Ambient occlusion under Relight), gi_strength (2, 0 - 4; also the menu's Global illumination), gi_dark (1, 0 - 4: the bounce light x this where the pixel is dark), gi_ceiling (2, 0 - 4; 0 none: the bounce light added at most this x the pixel's own colour, saturating smoothly - dark materials not veiled by a bright surface's bounce); its noise evened out after FastGI's filters: a spatial one (ao_spatial_radius, 1, 1 - 2: its 5 taps x then y, weighted by depth and normal, that many x 2 pixels apart) and a temporal one (ao_temporal, 1: the history's share by its length - the AO's up to 15 frames, the GI's up to 31 -, less in motion - reprojected by the game's motion vectors, rejected by depth and clamped to the current neighbourhood); after CORTAO's (always): its sparse filter (one pass, each tap's depth against the centre's plane, pairs symmetric), the occlusion as pow(occlusion, ao_strength), its occluder lookup table (built on the GPU for DittoSR's rays, 32 rays a pixel), the main pass in 16 x 16 groups, colour mips (the GI's far occluders' colour their area's mean, packed with the depth mips); depth mips (ao_mips, 1: the far samples from sub-sampled depth mips), ao_backface_boost (1); ao_samples (16, 4 - 32: the main pass' samples a pixel; also the menu's Samples), ao_half (1: FastGI's half resolution - the main pass on a fixed half-size grid, the filter, the temporal smoothing and the blur at half size too, the result brought back to render size in the composition by depth and normal - the GI also by the colour, its edges along the colour's; 0: all at render size; with it ao_resolution_mode - DirectX 12, also the menu's Resolution: 0 half, 2 checkerboard - every other pixel, alternating, at half ao_samples, spread to render size and filtered and smoothed there: every pixel computed within 2 frames), ao_checker_gi_half (0: the GI on half its pixels, the others from the history), ao_checker_fused_fill (1: the checkerboard's fill done by the sparse filter, no pass of its own), ao_full_size_two_pass (1; with Checkerboard and the unified filter: its 2 passes at 2 and 6 pixels, not 3 at 2, 4 and 8), ao_cacao (1: FidelityFX CACAO's edge-sensitive blur (MIT) after the temporal smoothing, on the accumulated AO and GI, ao_cacao_passes of it - 2), ao_unified_filter (1: the a-trous filter on the AO and the GI together after the temporal smoothing - 3 passes at 1, 2 and 4 pixels, by depth and normal, the GI also by its luma - in place of the GI's a-trous filter and CACAO's blur, which apply with it off); on by default (1; also the menu's toggles under Relight): ao_emitter_cosine (each occluder's light x (1 + how squarely it faces the pixel) / 2: one seen edge-on lights it less, by half at most), ao_better_normals (the prepass' normals by Turanszki's 2-pixel extrapolation); the GI steadier (1 by default, also the menu's toggles under Relight): ao_gi_wide (the spatial filter's GI also from 3 pairs 10 pixels out, 60 degrees apart - the AO's kept); ao_gi_falloff (1; FastGI's: each occluder's light x (1 - (d / reach)^2)), GI tests (DirectX 12): ao_blue_noise (1; the main pass' noise from a 64 x 64 blue noise mask - void-and-cluster, scripts/gen_bluenoise.py - stepped by the golden ratio a frame); GI features (1 by default; ao_gi_interleave DirectX 12 only; tried and removed: the better albedo, ReSTIR GI, stochastic reflections, guided samples, screen probes, multi-bounce, sky light, a source clamp, the mips in groupshared memory): ao_edge_fill (1; the GI made up for the samples off the screen, up to x 2), ao_gi_atrous (1: an a-trous filter on the GI with luma edge-stopping), ao_gi_interleave (1; the GI on half the pixels a frame, the others the last result's), ao_far_cheap (1; half the samples past twice the AO's fade distance); fx_local_exposure (0 - 1, 0.5; 0 off: each area's luma brought toward a mid grey - the shade lifted, the glare tamed, the contrast within each area kept; the area's luma from a small pass at 1 / 8 of the size, read bilinearly by depth); ao_fade_distance (100 metres, 0 none: the AO faded out from there to twice that; the camera's metres a unit from FSR 3.1's dispatch, 1 where it gives none); curve (0,0 0.1195,0.08962 0.2516,0.261 0.4858,0.522 1,1: a darker low end, the mids slightly lifted - 0,0 1,1 none; the menu's curves editor hidden for now): up to 8 points x,y x,y ... in [0, 1], each channel of the image through their natural cubic spline in a perceptual [0, 1] (linear HDR: ^ 1 / 2.2); DirectX 12 and Vulkan, the camera from FSR 3.1's dispatch (XeSS gives none: 60 degrees assumed).
  • history_10bit, fp16 (DirectX 12), fused_sharpen (1; 0: the separate sharpening pass): performance (see above).
  • game_sharpness: the sharpness sent with the upscale call in place of the ini's: -1 (default) only from OptiScaler's custom folder, 1 always, 0 never.
  • toggle_key, reload_key, debug_view, log_dispatches, log_passes (1: each pass's GPU time in the log, the mean of every 256 frames; DirectX 12): diagnosis.
  • The reconstruction's knobs: width, conf, share_far, share_near, alpha_rest, gamma_rest, motion_gamma, motion_share, motion_minmax, motion_near, split_clip, react, change_scale, exposure_scale, encode_power, reactive_scale, jitter_sign_x, jitter_sign_y, mv_sign.

Build

Needs Visual Studio 2022 (C++ tools), the Windows SDK's dxc, and a dxc with SPIR-V for the Vulkan shaders: extract the DirectXShaderCompiler release into tools\dxc\, or install the Vulkan SDK. Then:

build.bat

build\ gets the DLL under the names games load (amd_fidelityfx_dx12.dll, amd_fidelityfx_loader_dx12.dll, amd_fidelityfx_vk.dll), libxess.dll, harness.exe and DittoSRLoader.exe. scripts\package.ps1 packs them into build\DittoSR.zip.

python test/bench.py [--fsr <folder>] [--set key=value ...] [--base run.json] [--save run.json] runs the harness over a matrix of scenes (tiles, grass and wires moving and at rest, glints) at 1x and 3x and prints PSNR, shimmer, flicker, ghosting and sparkle - with --fsr (a folder with AMD's amd_fidelityfx_loader_dx12.dll as amd_fidelityfx_loader_dx12.orig.dll and its amd_fidelityfx_upscaler_dx12.dll) AMD's FSR on the same inputs beside DittoSR, with --base a saved run's numbers and the change.

build\harness.exe <folder> <png prefix> [key=value ...] runs the offline test against the DLL in <folder>, on DirectX 12 or on Vulkan (api=vk); its options (scenes, ratio, speed, the GPU) are listed at the top of test/harness.cpp.

License

DittoSR is MIT-licensed (LICENSE). It derives from Snapdragon GSR 2 (BSD 3-Clause). See THIRD-PARTY-NOTICES.md and licenses/.

About

A lightweight upscaler designed for handhelds and low-end PCs, offering better results than FSR 3.1 at higher presets, with superior performance. Also for VR!

Resources

Stars

80 stars

Watchers

7 watching

Forks

Releases

Contributors

Languages