FOSS screen space ray tracing with any game and GPU on Linux (Wine / Proton)

Freaking insane news for gamers!! :exploding_head:

FOSS screen-space software ray racing with better performance and visual quality will be out really soon!

Don’t be afraid that big detailed guide.
First contact requires some experience and tweaking for each game, but once you got it - it will be easy and it’s absolute VOODOO MAGIC beyond reality!!

Table of contents:

  1. RTX vs SSRTGI
  2. Why should Linux people care…?
  3. Demo
  4. ReShade
  5. Screen space ray tracing global illumination shader
  6. Installation
    6.1. Download
    6.2. Prepare
    6.3. Requirements
    6.4. Install
    6.5. Run
  7. Configuration
    7.1. Depth buffer
    7.2. SSRTGI (Screen space ray tracing global illumination)
    7.3. SSR       (Screen space [ray tracing] reflection)
  8. Problems
  9. Future of Ray Tracing

RTX vs SSRTGI

Why should Linux people care...?

  • It’s FOSS
  • It’s better quality
  • It’s way faster
  • It works with ANY game!!!
  • It works with ANY GPU!!!
  • You’re not limited to how game devs or corporation like Nvidia have implemented RT - it’s tweakable via ReShade’s config or even source of shader / ReShade injector!

Demo

GTA V


WATCH MORE - MODERN GAMES

Red dead redemption 2
https://youtu.be/5BY-TAYTZi8
https://youtu.be/9ruh0xXx_GY

GTA V
https://youtu.be/_laVAvma0zM
https://youtu.be/56hALGSgU9s

Witcher 3
https://youtu.be/Mjq-ZYK7oJ8

Far Cry 5
https://youtu.be/yztbcnE-0PA

Watch dogs
https://youtu.be/S27YOjpgaaE


Black Mesa



WATCH MORE - OLD GAMES

Deus Ex Human revolution
https://youtu.be/D6jVxjxot7w

Black Mesa
https://youtu.be/FYYngtN_n6o

Portal 2
https://youtu.be/zt654F9HgNY


ReShade

I’m sure many of you are aware of ReShade, which works in almost any game known to humanity and supports all of key 3D API:

OpenGL
Vulkan
DirectX 9 - 12
DirectX 6 - 8 through bridge: dgVoodoo2 / d3d8to9 / dxwrapper
DirectX 1 - 7 through bridge: dgVoodoo2
DirectDraw through bridge: dgVoodoo2
Glide through bridge: dgVoodoo2

Screen space ray tracing global illumination shader

So…Marty McFly (Pascal Gilcher) have created RTGI.
Currently in beta under donation wall 5$+, but final version will be FOSS as all shaders for ReShade!
Please donate if you want to support his amazing work!

And this is already free shader for SSR (Screen space reflections) part of his famous qUINT framework.

Both ray tracing shaders should work if you:

  • Can launch ReShade with given game
  • Can capture depth buffer (3D information about scene + Normal map)

List of compatibility will give you rough idea, although even if there is stated problem, most of times if you really try - you can get it to work!

If that is the case - please edit / add to this list, so others would know too! :space_invader:


Installation

In case you’re not aware - ReShade perfectly works on Wine / Proton, with or without dxvk too!

1. Download

Item Link Additional
ReShade download unzip "ReShade_Setup.exe" -d "./ReShade"
Shaders RTGI & qUINT Default (* recommended) / More shaders
d3dcompiler_47.dll x64 download winetricks / original Windows
d3dcompiler_47.dll x32 download winetricks / original Windows

2. Prepare

By using correct architecture:
  d3dcompiler_47.dll {32|64}

Reshade{32|64}.dll rename to the API you want to hook
d3d9.dll for DirectX 9
dxgi.dll for DirectX 10 - 12

Create similar structure, so it will be easy to install for any game in the future:

dx9_x32
├── d3d9.dll
└── d3dcompiler_47.dll

dx9_x64
├── d3d9.dll
└── d3dcompiler_47.dll

dxgi_x32
├── d3dcompiler_47.dll
└── dxgi.dll

dxgi_x64
├── d3dcompiler_47.dll
└── dxgi.dll

reshade-shaders
├── license agreement.txt
├── Shaders
│   ├── qUINT_common.fxh
│   ├── qUINT_rtgi.fx
│   └── RTGI
│       ├── Normal.fxh
│       ├── Projection.fxh
│       ├── RaySorting.fxh
│       └── RayTracing.fxh
└── Textures
    └── bluenoise.png

You really want to create ReShade.ini file in advance as well (to avoid redundant setup each time), here’s a good defaults example:

[GENERAL]
ClockFormat=0
CurrentPresetPath=.\DefaultPreset.ini
EffectSearchPaths=.\reshade-shaders\Shaders
FPSPosition=1
NewVariableUI=0
NoDebugInfo=0
NoFontScaling=1
NoReloadOnInit=0
PerformanceMode=0
PreprocessorDefinitions=RESHADE_DEPTH_INPUT_IS_REVERSED=0
PresetTransitionDelay=1000
SaveWindowState=0
ScreenshotFormat=1
ScreenshotIncludePreset=0
ScreenshotPath=.\
ScreenshotSaveBefore=0
ScreenshotSaveUI=0
ShowClock=0
ShowFPS=0
ShowFrameTime=0
ShowScreenshotMessage=1
TextureSearchPaths=.\reshade-shaders\Textures
TutorialProgress=4

[INPUT]
ForceShortcutModifiers=1
InputProcessing=2
KeyEffects=106,0,0,0
KeyMenu=36,0,0,0
KeyNextPreset=0,0,0,0
KeyPreviousPreset=0,0,0,0
KeyReload=0,0,0,0
KeyScreenshot=44,0,0,0

[OPENGL]
ForceMainDepthBuffer=0
UseAspectRatioHeuristics=1

[STYLE]
Alpha=1.000000
ChildRounding=0.000000
ColFPSText=1.000000,1.000000,0.784314,1.000000
EditorFont=
EditorFontSize=13
EditorStyleIndex=0
Font=
FontSize=13
FPSScale=1.000000
FrameRounding=0.000000
GrabRounding=0.000000
PopupRounding=0.000000
ScrollbarRounding=0.000000
StyleIndex=2
TabRounding=4.000000
WindowRounding=0.000000

Important parts for a smooth start are:

[GENERAL]
EffectSearchPaths=.\reshade-shaders\Shaders
PreprocessorDefinitions=RESHADE_DEPTH_INPUT_IS_REVERSED=0
TextureSearchPaths=.\reshade-shaders\Textures

3. Requirements

In order to use ReShade with ray tracing make sure you meet those conditions:

Wine / Proton 4.3+ minimum version which works with ReShade and/or dxvk :exclamation:
Define game arch - In 99% of cases, at least until now - it will be x32
- if in doubt run
file game.exe
x86-64 is x64
80386  is x32
Define game API - prefer higher when there is choice in game, example: DirectX 11 instead of DirectX 9, unless there are some known problems or your GPU doesn’t support it
- if in doubt - search PCgamingWiki on the bottom of a page there will be API
MSAA / SSAA off - depth buffer may not work with some AA modes, experiment yourself
- you can force AA with your video-driver (FXAA for example)
- you can enable different types of AA inside ReShade itself
Network To prevent cheating ReShade will disable the depth buffer in multiplayer games when there is network traffic to and from the game. This causes depth-related effects to either flicker or not work at all, and may even apply to single-player games modes with weird internal server setups.

REMOVE NETWORK RESTRICTIONS

You can build from source code and comment out the line which activates the network check to bypass it.

source/runtime.cpp, search for this lines:

// Detect high network traffic
static int cooldown = 0, traffic = 0;
if (cooldown-- > 0)
{
    traffic += g_network_traffic > 0;
}
else
{
    _has_high_network_activity = traffic > 10;
    traffic = 0;
    cooldown = 60;
}

4. Install

Let’s say you have x32 game with DirectX 10.

Copy prepared directories inside directory where game’s .executabe exist:

  1. Copy content of dxgi_x32 directory
  2. Copy reshade-shaders directory

So it will look like:

GameFolder
├── Game.exe
├── reshade-shaders
├── d3dcompiler_47.dll
├── dxgi.dll
└── ReShade.ini

5. Run

Now you can start your game!

  • If you see ReShade overlay on top of screen and there are no errors - it works! :partying_face:
  • In case you’ve decided not to follow advice (6.2. Prepare) of creating ReShade.ini in advance:
    • Press HOME to open ReShade’s settings
    • Settings tab - locate your shaders (Effect search path) and textures (Texture search path)
      It’s better to use relative path, so it will be game-independent and can be shared later :exclamation:
      .\reshade-shaders\Shaders
      .\reshade-shaders\Textures
    • Now go to Home tab and press Reload button located on bottom.
    • You’ll get list of your shaders!
  • ReShade.ini will be created in same dir - this is main config file.
    Holds pre-processor definitions, depth-buffer settings (unique to game :exclamation:), paths, key bindings.
  • DefaultPreset.ini will be created in same dir - this is preset file where specific effects settings got saved (you can have more than one preset and switch them on top of Home tab or even with key binding combination)
  • Later, when get good results - store both of your .ini files for yourself or to share with community!

Problems?

  • There are errors on ReShade’s load or when enabling shaders

    you have made en error by choosing wrong arch / API while 6.2. Prepare step, please try again :robot:

  • There is no ReShade overlay at all

    means it’s not loaded, most likely your game’s API is old (see 4. ReShade) and requires properly set bridge

  • Still no ReShade overlay?! :scream:

    try dll overrides in winecfg or Proton’s (enviroment variable WINEDLLOVERIDES)

    d3dcompiler_47.dll: native
    d3d9:               native, builtin
    

    or

    d3dcompiler_47.dll: native
    dxgi:               native, builtin
    

9 Likes

Configuration

Few basic things, before we start:

  • Enable shader with :ballot_box_with_check: checkbox near shader name
  • Change order by drag & drop
  • Active on top button (near presets switch, on top) is very handy! :wink:
  • To get out of bounds value of shader’s parameter CTRL + LMB and manually enter value!
  • Enable :ballot_box_with_check: Performance mode (on bottom of UI) when you done tweaking and happy with results, this will allow ReShade to start much faster, but won’t allow to tweak, so disable if you want further tweaking!

If you’re audio/visual kind of person watch this great quick video guide:

HOW TO INSTALL AND TWEAK RTGI

Please note that some parameters may have little different naming / values, as this is early version.

How to install and tweak RTGI

It covers in a nutshell:
7.1. Depth buffer
7.2. SSRTGI


Sources:
FAQ - Easy Troubleshooting © Duran.te, last edit - 11 Feb 2020 23:48

1. Depth buffer

First thing you want to do is find some nice spot in game:
:white_check_mark: Look somewhere with great perspective (which have close, middle, far objects simultaniously)
:heavy_multiplication_x: Do not stare at flat surface like wall, floor, sky etc

Now, search for “Depth” and enable DisplayDepth.fx (part of default ReShade shaders) - this is handy helper for finding depth buffer.

When values are set up correctly:

  • Normal map:   the surfaces look smooth and the background is colored
  • Depth map:     close objects are black, distant objects are white

:white_check_mark: Now you’re ready to continue!

If it doesn’t look like that and especially if Depth map looks like just white or black or Normal map looks like a solid color:

Open dx9 / dx11 tab:

  1. Try to enable one of buffers - first choose those which have your resolution and a lot of draw calls / vertices
  2. Try combination of multiple buffers at the same time
  3. Enable :ballot_box_with_check: Copy depth buffer before clear operations and do same as 1 & 2

If it still doesn’t look like on first picture:

READ MORE

ReShade have preprocessor definitions, to help extract depth buffer:

RESHADE_DEPTH_INPUT_IS_REVERSED=0
RESHADE_DEPTH_INPUT_IS_LOGARITHMIC=0
RESHADE_DEPTH_INPUT_IS_UPSIDE_DOWN=0
RESHADE_DEPTH_LINEARIZATION_FAR_PLANE=1000

First thing you need to try is change this definitions, until the output looks like in the first image:

RESHADE_DEPTH_INPUT_IS_REVERSED
RESHADE_DEPTH_INPUT_IS_LOGARITHMIC
WHAT YOU NEED TO AVOID

When incorrect RESHADE_DEPTH_INPUT_IS_REVERSED:

  • Normal map:   flipped (upwards pointing normals should be a greenish color), background is black
  • Depth map:     black

When incorrect RESHADE_DEPTH_INPUT_IS_LOGARITHMIC:

  • Normal map:   surface normals have stripes in them
  • Depth map:     looking correct

When incorrect RESHADE_DEPTH_INPUT_IS_UPSIDE_DOWN:

  • Depth map:     upside down


If you have found correct values

  1. Press Edit global preprocessor definitions in ReShade’s GUI and put the values in there
  2. Press Reload button
  3. Now inside DisplayDepth.fx shader enable :ballot_box_with_check: Use preprocessor definitions - this will show your global preprocessor value you’ve entered on step 1
  4. If it still looks good like on first picture you’re good to go, just disable DisplayDepth.fx shader and continue!

Sources:
• Experience & Testing
About the Changes in DisplayDepth.fx © Daodan, last edit - 23 Nov 2018 16:53

2. SSRTGI (Screen space ray tracing global illumination)

Please note that all parameters (except maybe Ray amount and Fade out) - are extremely variable from game to game, due to differences in engines, level and sometimes scenes, there can’t be “best looking” generalizations of values for all games.

You will have to find best ones manually, and do it in a way for whole game to look realistic and be playable, i would advice to look for those kind of test scenes:

  1. Outdoor with great perspective
  2. Indoor with good lighting
  3. High contrast scene, like looking on a sunny street outside of window from a dark room

Try to find best values for each scenario, and then find a good looking compromise between all 3!

Also remember, when you dramatically tweak one parameter - it will affect others as well.
So sometimes, if it doesn’t look right - you might want to tweak other ones too!

:exclamation: It is highly adviseable to turn in-game Ambient occlusion (SSAO, HBAO, GTAO etc…) OFF:

  • It saves performance a lot and boost quality of SSRTGI
  • In-game Ambient Occlusion is NOT ray traced, therefore SSRTGI will always produce better results
  • Sometimes you might want to experiment with AO enabled, in extremely rare cases it might look more deep, like SSRTGI enhance in-game AO…But it’s generally not recommended.

If you’re audio/visual kind of person watch this great quick video guide:

HOW TO TWEAK RTGI

Please note that some parameters may have little different naming / values, as this is early version.

How to tweak the RTGI shader v0.7 beta


ReShade_GI_Beta_0.11 - my current recommendation for best quality, for now later versions are focused mainly on performance improvements, but loose some quality in a way (especially while movement there is high jitter on most settings!).

Familiarize yourself very well with Enable Debug view - Lighting channel, it will help you understand what RTGI shader see & feel, switch frequently between normal and / ligting channel while tweaking to learn more about each parameter!

Parameters are listed in the order of importance to tweak top-down, for best results:

Parameter Values Description Recommendations
Ray length 0.5-20 Affects shadow / indirect lighting radius • Extremely important for overall look :exclamation:
• For realistic lighting 12-20 are best
• Smaller values = RT Ambient Occlusion (Less physically accurate, but way better than usual AO)
Ray amount 1-20 Number of rays • Technically, higher = better quality (less noise)
• Practically - great results even with 1
• Goal is to find highest value which still gives you good performance
1-4   = performance
4-8   = quality
8-20 = Jeez! Have a farm of Nvidia Quadro?!
Ray step amount 1-20 How far the rays are going • Basically definition of GI quality
18-20 = best quality for any scene
• Lower values rarely produce better results, but sometimes depending on other parameters - it might! Experiment to your likes!
20-120 = high values out of bounds might lead to some really beautiful and realistic results, but you’ll need some serious GPU to handle performance (decreasing Ray amount will help).
Ambient occlusion intensity 0-10 How dark :waxing_crescent_moon: darks of shading • Increase for more defined, darker shadows
• Careful to not overdo this, shadows typically would be realistic when they’re not extremely black, but more gradually fading shades
• Decrease for better blending with fog
Indirect lighting intensity 0-10 How bright :waxing_gibbous_moon: emitted light • Goal is to increase value until it gives more indirect light / bounced color information, but stop when scene is obviously too lid up and changes too much from original game (very dark place becomes bright like it’s Christmas on Sun :sunny:)
• Higher values can cause jitter / noise :exclamation:
Z Thickness 0-4.0 Removes halos around thin objects • Goal is to decrease in very subtle iterations until remove halos around hero / weapon (see problems section)
• Best viewed in Lighting channel
Fade out Start 0-1.0 Point of fade start from full RT to cut • Default 0 - is good
• Don’t go higher than Fade out End value
Fade out End 0-1.0 Point of how far from you RT completely cuts • Default 0.5 - is good
1 = Infinity, meaning you can look 100 miles away and any object in sight will be realistically shaded!
• There are games / levels which have a lot of fog / fixed fog - this is a problem and you might want to reduce this value (see 8. Problems section)
Render in half resolution Boolean • Dramatically increase performance
• Increases noise & jitter, but a lot of times with some settings it’s not really noticeable
Enable precise light spreading Boolean :robot: • Default true - is good
• Sometimes in rare cases there might be some excessive unrealistic shadow here and there, disabling this option will help (see problems section)

SSRTGI shader also have few preprocessor definitions to unlock some powerful options (enter value and hit ENTER to recompile shader):

Parameter Values Description Recommendations
INFINITE_BOUNCES 0,1 Moderate to high impact on perofrmance
Next bounce weight 0-5 Even more light bounces • Can add further more realism
• Mainly uses white light, without colorization
• Use gradually and moderate doses in relation to Indirect lighting intensity as it is easy to mess up and over-light scene
SKYCOLOR_MODE 0,1,2 Reshade can’t provide out of screen color / luminosity info, this value was added as a way to fake them. • 0 - usually still best option for most cases
• 1 - gives manual controls for RGB skybox color.
• 2 - Auto, in a lot of games does job pretty good, but beware it’s still in the works, and can lead to for example in extremely dark Batman Arkham city game, while flying over super-bright light projector to make whole game bleached-overexposed look and persist for a long time
Sky color ambient mix 0-2 How much of occluded Ambient color is considered sky color • Basically allows to control color & tone of shadows
• 0 - Ambient occlusion removes white color
• 1 - Ambient occlusion only removes skycolor
• Values near 0.5 can help blend shadows & AO better with fog and volumetric objects (see 8. Problems section)
Sky color intensity 0-10 • Tweak to your likes
Sky color RGB 0-255 • Keep in mind that it is hooked to Indirect Light Intensity, so it’s easy to mess things up!
• Lower / Darker Sky color values are recommended
https://i.imgur.com/CLwZloA.gif

Problems

Halos around objects

In post processing there’s not a way to calculate how thin or thick objects are.
You’ll have to use an approximate general value.

  • Move the slider Z Thickness to a point where you won’t see halos anymore.
  • In Third person game decrease to a point where there might be just some shadowing near legs

Too precise light spreading

If you see some excessive shadows here and there, like this (look on top between beam and ceiling):

Disable Precise light spreading checkbox


Ghosting (effect persist in motion)

It’s a side effect to deal with in generic post processing.
The author of shader is currently working to reduce this effect and make it less distracting.
Currently it is less noticeable with ReShade_GI_Beta_0.11 and / or when common performance solutions are applied!

Image shot during motion. Ghosting occurs on the left side of the weapon and the barrel

Sources:
• Experience & Testing
Guide to ray tracing with Reshade © Duran.te, last edit - 30 Oct 2019 22:53

3. SSR (Screen space [ray tracing] reflection)

Sources:
• Experience & Testing
ReShade: Using qUINT SSR © amoebae, last edit - 4 Oct 2018


Problems

Depth based shaders like SSRTGI / SSR passing through volumetric effects

Some games may have problems with water / fog / sunlight rays and other volumetric objects. It happens because this shaders build their visuals based only from Depth buffer / Normals and previously rendered frames, so it is currently impossible (maybe never will be) to know anything in particular about objects, especially volumetric ones, which leads to shader visually going “on top” of those effects visually, mostly it’s noticeable with shading darks / ambient occlusion.

Effects are little overblown for demo purpose:

WATER

Problem

Original game



FOG

Problem

Original game



SUN LIGHT


This is a common issue that affects all depth-based shader, included RT Global Illumination.
It’s due to the generic post-processing nature of Reshade, and unfortunately not much can be done about that.

There are several ways to make it less obvious is making the shader more subtle:

  • Reduce Ambient occlusion and Indirect light Intensity
  • Reduce the Z Thickness (values under 0.100 are not reccommended)
  • Apply a Color grading after RT Global Illumination. It can help to blend the shader with the game.

As well as more sophisticated techniques, like:

SKYCOLOR

Idea is to find values which blends darks of shading and ambient occlusion better with given scene skycolor.

  • This is not very universal on it’s own, as skycolor may vary thorughout game levels
  • You can try to use auto skycolor, and control just blend and brightness of darks, try not to get too bright or too dark!

Problem

Solution

Original game



FADE OUT

Simple solution, which just moves cut of effect closer to camera.

  • May be very effective with other methods (in this demo it’s used together with skycolor)
  • It won’t solve anything in case it’s too close (static fog near lamps, sunlights which hits up to camera / hero)
  • Whole scene Global illumination miles away is much more mind-blowing :slight_smile:

Problem

Solution

Original game



Future of Ray Tracing

Ray Tracing is a rendering technique known for years in Computer Graphics that aims to produce physically correct 3D scenes.

Theory

In real life any light source emits a tons of rays. These rays travel till they reach an object, where they’ll bounce from countless times to any other object in the ambient bringing with them informations like color or light, until they eventually reach our eyes.

Ray tracing works more or less in the opposite way: Rays are sent starting from the digital camera and, once they meet an intersection point, they send new rays to every light sources.

Path tracing work in a similar way, but, once rays reach an intersection point, they act more in a life-like way: They keep bouncing through objects getting more precise informations till they reach light sources.

Reality today

Technique Features Problems
Ray tracing For physically accurate scene, each of effects must run on independent pass:
Global illumination
Soft shadows
Reflection
Refraction
Dispersion
• Extreme performance penalty, even on dedicated hardware
• High level of noise & jitter (still not completely removed in current realtime implementations)
• Complex effects like Caustic, Motion blur, Ambient occlusion must be added and simulated independelty by traditional “fake” techniques, outside of Ray tracing, which is imposible to do 100% physically accurate
Path tracing Naturally simulates all of this effects in single pass:
Global illumination
Ambient occlusion
Soft shadows
Reflection
Light scattering
Caustic
Motion blur
• No dedicated hardware needed
• Performance are light-years ahead with brilliant math algorithm like Pascal “Marty McFly” Gilcher
• Can use much more sophisticated & heavy techniques of denoise, because there is huge additional headroom, compared to Ray tracing
• Much more accurate

What we are currently witnessing in Nvidia’s RTX hardware are first experiments of games featuring hybrid rendering: While games are still rendered with the conventional methods (rasterization), Ray Tracing is getting used just to calculate some graphics elements, like Shadows (Shadows of the Tomb Raider), Reflections (Battlefield V) or Global illumination (Metro Exodus) and finally some form of all 3 (CONTROL). All of them suffering of huge performance loss, noise, temporal jitter and locked for only Nvidia RTX.

So…If you have tried SSRTGI and SSR (it’s called Ray tracing for hype reasons, but actually technically it is Path tracing) - you’ll see a lot of reasons why i personally think that Path tracing - is the future to be, instead of Ray tracing.

What we actually seeing now - is evolution of denoise alghorithms! :sunglasses:

So…If you have tried SSRTGI and SSR (it’s called Ray tracing for hype reasons, but actually technically it is Path tracing) - you’ll see a lot of reasons why i personally think that Path tracing - is the future to be, instead of Ray tracing.

All the problems you can encounter in Screen space due to it’s nature (like reflections from any surface, not taking in account materials, going through fog etc)…

When / if similar to brilliant Pascal “Marty McFly” Gilcher’s algorithm will be implemented inside future game engines directly and take in account all of those factors like full scene, materials, as well as produce natural Caustic - it will be unbeatable and Ray tracing will lag behind for 20-30 years, if at all!

Future is here, NOW!


To overcome that kind of problems:

Where ray tracing SSR and SSGI can not render what is not in view since it’s screen space by nature - there is clever hackery which can give some very good results - force very high FOV in-game so ray tracing could grab all of that information and then correct fov back to desired lower value by reshade :slight_smile:!

2 Likes

GI is amazing. I used it years ago when playing with 3DS Max and RenderMan and the architectural renders with GI enabled looked amazing. Real-time GI is a massive step.

3 Likes

Yeah, Global illumination immediately adds to realism of any 3D scene it’s a huge deal!

And like you’ve said - GI itself in 3D world is one thing, it was introduced in 3D editors years ago and i believe “fake-realitime” first used by Crysis in games (it was very clever mix of something like AO + dynamic world shadows + pre-rendered lightmaps, which still looked great at the time, but lacked some quality and physical realism in dynamic nature of events).


Of course technically Nvidia RTX made some buzz in real-time physically accurate full-scene rendering (and this is clearly the future), but still:

  • Proprietary
  • Very raw even by this days, in terms of quality (sometimes gets too noisy)
  • Extremely demanding (almost in the territory of unplayable on any currently available GPU, well except maybe some light stuff like Minecraft RT mod :laughing:)

But completely other thing is SSRTGI!

I still sometimes can’t believe my eyes when i pop up some old game, like Half Life or Max Payne and see physically realistic shadows and colored ambient bounces on any surface, even from dynamic objects and light sources…And there were NONE of those things in the source :exploding_head: magic! :tophat: :rabbit:

And this includes even miles far away objects (if you want to)!

There are some small quirks here and there, which you still can overcome and shader is still in the works, but damn…

The whole idea is absolutely genius and simple at the same time - just project rays directly on scene available on screen and accurately calculate bounces from depth buffer information! :upside_down_face:

You still need some powerful GPU to get quality results, but not nearly as powerful and overpriced as RTX cards.

For the most part it’s enough to project just 1-3 rays in settings, to get extremely pleasing results and almost no FPS cost like 5 or something, also you can / 2 internal resolution for calculations and reconstruct it afterwards, which will add some noise but will be extremely fast, in a lot of games it’s non-issue almost :slight_smile:

3 Likes

Just about to try this out… :grin:

Is there a way of doing this for all games instead of doing it repeatedly?

Symlinks should work for keeping a single version of the file (and allowing easy updates/change) but a “global install” would likely be easier to maintain.

I’m wondering about dropping the files into SteamApps/common/Proton 5.0/dist/lib64/wine:thinking:

2 Likes

Ahhh…Symlinks i guess would do, although don’t forget few things to keep in mind:

  • There are separate files for x32 / x64
  • DirectX 9 / DirectX 10-11 must have different namings as stated above d3d9.dll / dxgi.dll
  • Also for each game you must use unique ReShade.ini, because in case game can’t find depth buffer automatically (very often), chosen buffer would stay in that file
  • As well as settings of shaders in WhateverPresetName.ini

I’d make something like four folders, say:
~/ReShade/dx9_x64
~/ReShade/dx9_x32

d3d9.dll
d3dcompiler_47.dll
reshade-shaders (dir)

~/ReShade/dxgi_x32
~/ReShade/dxgi_x64

dxgi.dll
d3dcompiler_47.dll
reshade-shaders (dir)

and then symlink them to game, while also dropping ReShade.ini and WhateverPresetName.ini (if you already have it) in game directly :slight_smile:

2 Likes

Dropping files into a Proton directory doesn’t seem to work, putting them directly into the game directory has them load (though I can’t load any effects “Syntax Error”… searching).

Edit, wait, something odd… it might need to be present in both Proton and game directories… ?

Edit 2: Might be affected by running via Steam using Proton…

Always drop / symlink them in game folder where .exe is

Which game you’re trying now?

Make sure that it’s exe is correct to corresponding arch and chosen DirectX, otherwise it may fail :slight_smile:

file your_program.exe and look at the output:
x86-64 is 64Bit
80386 is 32Bit

Dawn of War: Dark Crusade. Same engine as Dawn of War which is listed as “Perfect” on the compatiblity list. It’s definitely a 32-bit application (it’s pretty old… :sweat_smile:).

This is now my favorite thread :joy:

1 Like

Btw that list is little bit outdated turns out a lot of them which listed as bad, are actually working now :slight_smile:

Dawn of War: Dark Crusade

Haven’t tried that one, so if it’s x32 you need to use x32 for all dlls, and put ReShade.ini and reshade-shaders folder where exe is, otherwise it should work…

Make sure ReShade.ini links to right shaders folder though, here’s example:


[GENERAL]
ClockFormat=0
CurrentPresetPath=.\DefaultPreset.ini
EffectSearchPaths=.\reshade-shaders\Shaders
FPSPosition=1
NewVariableUI=0
NoDebugInfo=0
NoFontScaling=1
NoReloadOnInit=0
PerformanceMode=0
PreprocessorDefinitions=RESHADE_DEPTH_INPUT_IS_REVERSED=0
PresetTransitionDelay=1000
SaveWindowState=0
ScreenshotFormat=1
ScreenshotIncludePreset=0
ScreenshotPath=.\
ScreenshotSaveBefore=0
ScreenshotSaveUI=0
ShowClock=0
ShowFPS=0
ShowFrameTime=0
ShowScreenshotMessage=1
TextureSearchPaths=.\reshade-shaders\Textures
TutorialProgress=4

[INPUT]
ForceShortcutModifiers=1
InputProcessing=2
KeyEffects=106,0,0,0
KeyMenu=36,0,0,0
KeyNextPreset=0,0,0,0
KeyPreviousPreset=0,0,0,0
KeyReload=0,0,0,0
KeyScreenshot=44,0,0,0

[OPENGL]
ForceMainDepthBuffer=0
UseAspectRatioHeuristics=1

[STYLE]
Alpha=1.000000
ChildRounding=0.000000
ColFPSText=1.000000,1.000000,0.784314,1.000000
EditorFont=
EditorFontSize=13
EditorStyleIndex=0
Font=
FontSize=13
FPSScale=1.000000
FrameRounding=0.000000
GrabRounding=0.000000
PopupRounding=0.000000
ScrollbarRounding=0.000000
StyleIndex=2
TabRounding=4.000000
WindowRounding=0.000000

Oh, btw i can’t find it, but which API game actually use, dx9 i assume by the year it was released?
If not already, try with DXVK enabled, maybe it will help…

Also, maybe try this:

Set the dll overrides in winecfg:
d3dcompiler_47.dll: native
d3d9/dxgi: native, builtin

I haven’t seen need to do so with dx9-dx11 game before while my tests (about 12 games of different eras), but maybe it’s that game which needs it :slight_smile:

Only in game, always :slight_smile:
Don’t touch proton folder, it’s better to symlink from ~/something or whatever else :slight_smile:

1 Like

OK, closer. I removed the ReShade dlls from Proton 5.0 and put them only in the game directory. It didn’t load them with Proton 3.7 (default for the game), so I forced Proton 5.0 and enabled DXVK with PROTON_USE_D9VK=1 %command% . Now the ReShade hook is loading but effects are still failing.

(Although, putting the dlls in the Proton 5.0 directories does seem a route to enable this for all games running under Proton)

1 Like

Considered bad practice, due to nature of how hooks work, but who am i to stop you from experiments :slight_smile:

Ooops, someone needed to read OP closely

  • Wine 4.3+

:sweat_smile:

Damn…That’s really weird!
All of them? Brag initially that they can’t compile?

1 Like

Well, I mean… it took a little digging to discover which one was being used by default… :stuck_out_tongue_winking_eye:

Are you sure it’s correct arch?
I mean there were x64 games in 2004 too (very rare, like Far Cry), it’s not THAT old after all :slight_smile:

Yes, checked with file, but just to make certain I tried the 64-bit dlls and the hooks didn’t load. It’s definitely a 32-bit game.

This is the error:

...
14:00:56:604 [00388] | INFO  | Successfully loaded "Z:\home\jonathon\Steam\SteamApps\common\Dawn of War Dark Crusade\reshade-shaders\Shaders\SurfaceBlur.fx".
14:00:56:605 [00340] | INFO  | Successfully loaded "Z:\home\jonathon\Steam\SteamApps\common\Dawn of War Dark Crusade\reshade-shaders\Shaders\ASCII.fx".
14:00:58:870 [00188] | INFO  | Loading image files for textures ...
14:01:11:571 [00188] | ERROR | Failed initializing "Z:\home\jonathon\Steam\SteamApps\common\Dawn of War Dark Crusade\reshade-shaders\Shaders\PPFX_SSDO.fx":
:38:1: Error: syntax error

14:01:11:573 [00188] | INFO  | Loading image files for textures ...
...

Well…Maybe then try to load another game, to see if it’s Warhammer’s problem in particular with ReShade, then if it is so - i’d report it to ReShade over here (can do this for you, in case no time for reg)


Looking at those errors - it’s not all of them, just some - then you can ignore it, because technically you just need 2 of them for RTGI, try hit HOME and search for:
DisplayDepth then try enable it

Do you see it work with splitting screen?
If yes, try to go and find depth buffer in dx9 (last tab) as in OP video… here or text version of it here

And then when you find it, search for RTGI to try enable SSRTGI shader (if there are no errors with it specifically - then you’re good to go :slight_smile: )

Same thing on DoW: GoTY and Torchlight. Hooks load but it throws a “syntax error” when trying to initialise a shader.

image

Dammit. Not much ideas left here…

Nvidia GPU you have as well? I’ve tested only on them
I’ll PM you some files to try in ~20 minutes, maybe just in case…