Closed Arcitec closed 2 years ago
My step by step above is from memory. I might have enabled the shader while ReShade itself was disabled in SteamTinkerLaunch's per-game settings.
I have a theory... it could be related to this bug #382.
Perhaps if ReShade is improperly/half-disabled, and you run the game so that a default ReShade.ini is created, perhaps this then confuses SteamTinkerLaunch to think that there is no proper shader directory. I dunno... If you're reading the ReShade.ini to determine where to put shaders, then this is the likely culprit.
Oh and this bug also causes a total loss of shader paths. Shaders are supposed to be installed in project paths, such as:
cobrafx/Shaders/Cobra_Mask.fx
If the paths (visible in SteamTinkerLaunch's "Game Shaders" GUI) aren't preserved, then the shaders may not be able to find their own related files, or different shader sets with identical filenames may clobber each other's files, and shader presets (ReShade ini files) from the internet (i.e. NexusMods) may not find the presets.
I have 5 concerns/bugs with the "Game Shaders" GUI in SteamTinkerLaunch:
.fx
shader file). Here's an example of how many textures some shaders require: https://github.com/Mortalitas/GShade/releases~/.config/steamtinkerlaunch/downloads/shaders
.I could be wrong about a lot of these concerns, by the way! :)
Thanks for the huge bug report.
In fact, I already wanted to refactor some ReShade
code parts before, but I do not have very much time for steamtinkerlaunch
anymore. I'll take your issue as an opportunity to set it as an official future goal :)
Every helping hand is welcome, of course!
Looks like you know pretty much about the ReShade
structure (personally I like it, but barely use it, which probably explains why I did not even recognize those issues).
1) Would be nice if you could paste a "perfect" mockup directory structure of a game directory with >2 shaders installed. (see below)
2) digging through every fx
automatically and searching for includes and textures is not too much fun, that's why I simply copied all textures found in the source directories. I hope this can be automated with 1) without too much effort
3) I guess this would be auto-fixed when all ReShade
stuff would be in its own subdirectory (1)
4) IIRC this either was suggested before or I considered it once. I can't remember why I decided otherwise, so it makes sense to change that with the ReShade
overhaul. Possible negative side effects would be
yad
feature, and it looks like it doesn't exist - at least I haven't found anythingIf I didn't misunderstand anything, 1-3 are programmatically more or less one point, 4 is clear and 5 needs to be implemented in yad
.
PS: Looks like it didn't read the reddit comment completely btw: The game directory is not always the absolute path to the game exe directory, so shaders dropped directly into the game directory sometimes were misplaced. That's what I meant with what I fixed. A bug report would have clarified this (as it did now :))
PPS: I'll rename this issue to show that this is a generic ReShade
overhaul issue. Maybe more help/ideas are contributed
6) Rewrite the En/Disable
ReShade option (see #382)
@frostworx Hey, thanks a lot for the detailed answer. :)
Regarding the ultimate ReShade structure, it would be optimal to use the structure that ReShade uses by default on Windows. When a Windows users tells ReShade to install itself into a game folder, it creates this structure:
d3d9.dll (for dx9)
dxgi.dll (for dx10 and higher)
ReShade.ini (the core configuration for the runtime; this isn't a preset, it's the global config)
reshade-shaders (directory)
Shaders (directory)
(1 subfolder per shader collection here, with their .fx files, and each shader collection also has its related .fxh files (headers/shared code) in these folders)
Textures (directory)
(every texture file dumped into the same folder here, no subfolders, and ReShade doesn't support distinguishing between clashing texture filenames anyway so let things overwrite each other if clashing)
The ReShade.ini that's placed in the game folder needs to contain the default Windows reshade installer contents for it to work. But the most critical lines are the following:
[GENERAL]
EffectSearchPaths=.\reshade-shaders\Shaders
TextureSearchPaths=.\reshade-shaders\Textures
All other configs/lines will auto-create themselves. The core requirement is these two, which are required for ReShade to detect shaders/textures in its own default paths. Although I haven't tested if ReShade is smart enough to try these paths by default if no path is provided. Maybe. But probably not. We probably need a small template .ini file to install into the game folders, with these lines.
Regarding symlinks:
./reshade-shaders/Shaders/martymcfly ---> ~/.config/steamtinkerlaunch/downloads/shaders/martymcfly/Shaders
or similar.Enabling/disabling entire collections kinda makes sense, because it's not unusual for shaders within a collection to require each other or belong together. It also helps with the user interface experience of quickly and easily enabling shaders in SteamTinkerLaunch.
ReShade users are used to having hundreds of shaders installed and only using like 4-12 of them, so that shouldn't be a design concern. A typical Windows user will install shader packs (even things like GShade) and end up with shader folder sizes such as this one: https://github.com/Mortalitas/GShade/tree/master/Shaders
To sum up the proposed ideas:
~/.config/steamtinkerlaunch/downloads/textures
where you've merged all texture files from all installed shader packs (and overwritten clashes). You don't need to worry about which shader packs the user has enabled. The textures folder can and should simply be the combination of all textures of all globally downloaded packs.I'm unfortunately unable to help with the actual code, I don't know anything about the codebase and am dealing with a huge backlog of things to do already. All I can do is help with the analysis of the problems. :/
Hey @Bananaman
Thanks for the comprehensive answers ;)
Looks like my current implementation is already pretty much complete and the only thing missing is indeed the migration of the shaders into a reshade-shaders
subdirectory, with each shader into its own subdirectory.
Hmm, simply enabling whole shader repositories indeed is an interesting idea. It is both easier to maintain and to use. And shaders which are supposed to be running need to be activated from ReShade anyway.
Having an idea is one thing, finding the time and motivation to (re-)implement it is another. Unlikely this will happen any time soon. I'll leave this open for a while, so people have the option to discuss what is better.
hm, doesn't look like creating an individual shader subdirectory per shader is default, so I guess I'll go this road instead:
# tree gamedir/
gamedir/
├── ReShade.ini
├── ReShadePreset.ini
├── d3dcompiler_47.dll
├── game.exe
└── reshade-shaders
├── Shaders
│ ├── HexLensFlare.fx
│ ├── KeyCodes.fxh
│ ├── LiquidLens.fx
│ ├── Overwatch.fxh
│ ├── SuperDepth3D.fx
│ └── SuperDepth3D_VR+.fx
└── Textures
├── DigitMap.png
├── Overlay.png
└── Pong.png
nice, subdirectories in EffectSearchPaths
are entirely ignored, so creating symlinks of the whole reponame/Shaders
dir into reshade-shaders/Shaders/reponame
does not even work.
so back to above plan a with symlinking every single shader file...
edit: not too busy because of RL, but proceeding quite nicely. Commit might make it into 2021 :)
This giant commit should cover pretty much everything discussed (and more) :)
Should be more or less functional with above commit. Possible that not all functions do work 100% correctly yet, but I assume this state will make it more or less into next and foreseeable last release.
@Bananaman 👍
When nobody is willing to give any feedback on the rewrite, I silently assume it is either fully functional or nobody uses it at all. Either way I'm going to make a new release soon.
The DLLs are installed with d3d9.dll_off
d3dcompiler_47.dll_off
dxgi.dll_off
ReShade.txt_off
.
ReShade.txt_off contains:
d3d9.dll
d3dcompiler_47.dll
dxgi.dll
There is no reshade.ini and no shader folder.
So it properly installed itself in a disabled state.
_off
.ReShade.ini
is created with this content:[GENERAL]
EffectSearchPaths=.\reshade-shaders\Shaders
TextureSearchPaths=.\reshade-shaders\Textures
reshade-shaders/enabled
which contains files that tell you which shader collections are enabled._off
, d3d9.dll_off
d3dcompiler_47.dll_off
dxgi.dll_off
ReShade.ini_off
ReShade.txt_off
ReShade.txt_off
contains:d3d9.dll
d3dcompiler_47.dll
dxgi.dll
d3d9.dll_off
d3dcompiler_47.dll_off
dxgi.dll_off
ReShade.ini_off
ReShade.txt_off
reshade-shaders (directory)
[GENERAL]
EffectSearchPaths=.\reshade-shaders\Shaders
TextureSearchPaths=.\reshade-shaders\Textures
PreprocessorDefinitions=RESHADE_DEPTH_LINEARIZATION_FAR_PLANE=1000.0,RESHADE_DEPTH_INPUT_IS_UPSIDE_DOWN=0,RESHADE_DEPTH_INPUT_IS_REVERSED=1,RESHADE_DEPTH_INPUT_IS_LOGARITHMIC=0
The preprocessor definitions is necessary and is included in the official reshade installer. It fills out the game menu with configurable preprocessor variables which must be tweaked in most gamest (usually the "reversed" value is wrong, sometimes it's upside down, etc).
If this line isn't included, then the game's "Edit Preprocessor Definitions" button brings up an empty menu.
You can see that the values I picked above are ReShade's defaults:
Just add that to the reshade.ini that STL generates and things will be perfect :)
Wait, I found a bug.
If you disable shaders, ReShade.ini -> ReShade.ini_off
.
If you enable shader, a new ReShade.ini
is created, the _off
variant is not restored. Both files exist simultaneously, but the user gets blank new config.
By the way, the most "essential" shader collections are:
reshade-shaders
: This is the core set of utility-shaders, mainly used to get the core "ReShade.fxh" library and the "DisplayDepth" debugging effect which helps you ensure that depth buffer is read correctly. Lots of effects use the depth buffer, and most effects and third-party repos require "ReShade.fxh" and the other utility-headers from this repo. This is a must-have. https://github.com/crosire/reshade-shaders/tree/slim/Shadersquint
: This is the best shader collection of them all. The man is a genius and created highly optimized must-have shaders such as Lightroom. He was hired by NVIDIA to create their Ansel shaders. Everyone uses these. https://github.com/martymcmodding/qUINT/prod80 reshade repository
: Another genius, this guy has a ton of high quality effects for various special effects, color grading, etc.shaders (brussell1)
: Mainly used for his "EyeAdaptation" shader which is able to brighten or darken a scene based on how light it is. Very useful when creating shaders that end up darkening some areas too much, then you can simply brighten just the dark rooms with this shader.astrayfx
: These are pretty good, especially his "RadiantGI" which is basically a freeware version of the same techniques used in the popular Patreon "raytracing" shader. It's not the exact same result, but it's good. It's the same guy that made the depth3d filters, and I've talked to him a few times on his discord. He's a nice guy.Maybe some of this info belongs in wiki to guide the newbies, I dunno.
Wow, thanks again for another awesome test! Will start RL work soon, and will read it carefully over the weekend. Would you mind me adding parts of your tests to the corresponding wikis? Might help people to understand what the functions do :) And do you think it makes sense to add your Smashface-Shaders to the repocustomlist.txt?
yeah, fixing bugs during lunch break ftw :) Both missing PreprocessorDefinitions and ReShade.ini restoration hould be fixed with https://github.com/frostworx/steamtinkerlaunch/commit/feda4a40f915a1d1c89daff1223f5f0f3213986e
@frostworx Heyyyy! :)
I've tested the latest updates.
ReShade.ini_old -> ReShade.ini
now works. I tried enabling/disabling many times, and it always worked.Perfect. STL now has excellent support for ReShade! Thank you very much! :D
Would you mind me adding parts of your tests to the corresponding wikis?
You've welcome to add/edit anything I've written if you want to add something to the wiki! :)
And do you think it makes sense to add your Smashface-Shaders to the repocustomlist.txt?
That would have been an honor, but it's not appropriate because they're made for GShade which is like ReShade but pre-bundled with tons of effects, and modified versions of other effects. So the presets aren't compatible with regular ReShade.
For 99% of games, ReShade is good enough. GShade is just used for some fans of about a dozen different online games, since regular ReShade disables itself whenever a game uses any network traffic. Don't worry about it. If someone wants GShade, there are ways to install it manually into games on Linux with their Linux installer script, and since it only matters for a few games, there's zero reason to bring GShade into STL. Besides, GShade isn't perfect, it's bloated and has a bunch of old, semi-broken shaders, so most people would prefer pure ReShade instead. :)
Here's the full list of "main games" that people use GShade for:
Here are the full games supported (it uses a whitelist to only unlock online reshade features in certain games):
https://gposers.com/gshade/gshade-faq/#1563200583477-ab0ffc4e-3d4f
https://gposers.com/gshade/gshade-faq/#1566559486490-57a55be5-e2a6
I just figured I'd describe it so that you don't have to wonder what GShade is... :P
Hey @Bananaman Thanks for the finishing test, for your ok for the wiki and the comprehensive GShade description :) Didn't know it is not 100% to ReShade, so this indeed doesn't make much sense. Indeed I heard of GShade already before (and also its Linux installer script - iirc I even had a short discussion with the dev once on reddit :)))
Ahh, yeah. Pascal "Marty McFly" Gilcher, the creator of the famous raytracing shader, is no fan of GShade since they have so much outdated garbage in the effect list:
https://github.com/martymcmodding/qUINT/issues/28#issuecomment-1000360008
But for online games it's the best choice.
Anyway congrats on great new updates for STL! :) Thanks for everything.
Thanks again for your excellent testing! I just updated wikis for
And already bumped the Changelog, because the new version will (likely) be ready this weekend
Closing here :) Have fun!
Hehe nice I just read through the wikis. Congrats on the new version. The project is in a great state now and you can take a long and well-deserved break! :) Take care!
While reading the wiki, I realized something. reshade-shaders
contains the header files that are used by most other shaders. I've updated the note regarding that one here (so it needs a wiki update too): https://github.com/frostworx/steamtinkerlaunch/issues/383#issuecomment-1012466312
Basically, that repo is required by most other shader repos. ^^
I was reading the Reddit discussion and saw someone mentioning that SteamTinkerLaunch installs shaders directly into the game folder:
https://www.reddit.com/r/linux_gaming/comments/qyiuhv/reshadelinux_easy_setup_updating_of_reshade_on/hlhlp8l/?utm_source=reddit&utm_medium=web2x&context=3
I've now seen that issue for myself.
Here's what I did:
This is what's in my game folder (I have deleted a bunch of filenames from this list just to illustrate the point):