Git Product home page Git Product logo

reshader's Introduction

ReShader

crate-badge docs-badge

Notice

As I am extremely busy at this time (16/01/2024) and have been for almost a year now, I currently do not have the time to actively develop this tool and probably won't have for another year due to my job and other projects. As such, this project is currently on hiatus.


A tool and library for installing ReShade on Linux!

This tool is still work in progress, so expect bugs!

Installation

cargo install --locked reshader

Usage

You can use ReShader in 2 ways:

  1. Using the TUI (terminal user interface):

    reshader
  2. Using the CLI (command-line interface):

    reshader --help

Both are completely viable options and should have similar features.

Due to how the CLI is built, you can specify the path to the presets and shaders zip file as opposed to having to put it in the data folder with a specific name. Maybe the TUI will reflect that change in the future, but for now the TUI will have this requirement.

You can provide your own path to an existing ReShade installer by passing --use-installer <path> to ReShader:

reshader --use-installer /home/user/ReShader-Installer.exe

which will skip the download of the EXE and just extract this EXE.

Usage as library

Since ReShader is a hybrid crate, you can also write your own installer using the same functions to download and install ReShade. This saves some time as you don't have to implement your own downloading and copying mechanisms and you can instead focus on your user interface.

Just import reshaderlib into your project and use the provided functions!

reshader's People

Contributors

cozygalvinism avatar zi-sh avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

Forkers

zi-sh

reshader's Issues

Implementation of shader merge / my documentation of it had issues

(This is mainly copied from what I posted as a review on the original merge to handle issue #2, the analysis at the end has been expanded a bit)

builder.overwrite(true).run()?;

We run into an ordering issue here between crosire/reshade-shaders and CeeJayDK/SweetFX, where if one repo had overlapping files that were not exactly the same then the order in which we add them matters. It stands to reason that it's likely for crosire/reshade-shaders to be the base directory over which things get overwritten, if needed. Currently I believe the ordering of repos in SHADER_REPOSITORIES makes it so SweetFX would get overwritten.

And indeed, if you run the following (assuming all pulled repositories are in the CWD at start)....

$ cd SweetFX
$ shasum Shaders/* > ../SweetFX-Shaders-SHAsums.txt
$ cd ../reshade-shaders
$ shasum -qc ../SweetFX-Shaders-SHAsums.txt --ignore-missing
Shaders/FXAA.fx: FAILED
Shaders/Nostalgia.fx: FAILED
Shaders/SMAA.fx: FAILED
shasum: WARNING: 3 computed checksums did NOT match

So at time of writing three files in SweetFX that are also in crosire/reshade-shaders on the master branch do not match.

I checked the SHAs versus a copy of reshade-shaders from a fresh install on Windows that a friend provided me and SweetFX shaders match perfectly, whereas crosire/reshade-shaders did not match for 6 files (the 3 noted above that conflict between SweetFX and itself, as well as 3 additional files that are newer in the fresh install than what appears to be currently on master in crosire/reshade-shaders. These files appear to be from the slim branch.).

For what it's worth, there is no overlap currently between SweetFX and the slim branch, and it seems none of the files on master that are not in slim are in the fresh install. So I think this may be a case of the infrastructure having changed since the time of the shell script my original suggestion was based off of. Indeed that script actually didn't even make the subdirectories currently seen, it just shoved everything into one flat Shaders directory, though it did not overwrite anything.

Tl;dr it seems we need to use the slim branch to conform most closely to what a pristine installation does, and regardless we want crosire/reshade-shaders to go first / get overwritten when a conflict emerges. If we did want to ship the extra shaders master has over slim it would require some finangling since slim is definitely newer than master is currently.

Also having said all that... it seems this file is our canonical information sheet on what to install and how: https://github.com/crosire/reshade-shaders/blob/list/EffectPackages.ini

From the list branch of crosire/reshade-shaders.

So... that's an oops on my part sorry. Parsing that file and just following it is likely to be the best path forward. This also explains why I had heard things like "installing all shaders is a bad idea because conflicts with these presets". Turns out there are more options the installer lists. Choosing to install any or all of them probably should be emulated directly with a select dialogue the user goes through (or specifies at the CLI, though that gets increasingly cumbersome). The default install appears to be solely crosire/reshade-shaders (slim branch) and SweetFX (as marked by the "Enabled" flag).

linux support

not everyone uses bloatware as their operating system

Additional Maintainer

I've noticed the project has gone on hiatus due to lack of free time. I was wondering if you would be willing to add me as a maintainer so I can help keep the project running and up-to-date.

I have already read through the code base and have contributed code for a gshade shader path fix in the past. I am also quite familiar with Rust.

Shader download is broken

When selecting "Install/Update ReShade shaders" I get the following error message:

> Select an option Install/Update ReShade shaders

Cloning shader repositories...

Error: Custom(Git(Error { code: -3, klass: 4, message: "reference 'refs/remotes/origin/master' not found" }))

I get the same result with reshader install-reshade-shaders.

Great work, small issues to track or ignore

Hey,

Great work on this and thanks for making it. Though I have not myself used it as I swapped over manually unzipping the exe and what not few days back, I did read through the code and liked it + I always appreciate people willing to make helper tools for Linux / share their knowledge.

With that in mind, wanted to bring up some small suggestions for the todo list, though I'm ignoring more code cleanup style things I'm sure you're already handling (like the repeated error handling logic areas that could probably be refactored etc.). Obviously feel free to ignore any or all of them, I've ordered them roughly from smallest to largest changes.

  • You probably don't want to assume xdg-open exists / fail if it doesn't exist outright in the presets install section. Perhaps print the url out to stdout if xdg-open fails and then continue rather than aborting. Ref:
    let mut cmd = std::process::Command::new("xdg-open");
  • Since the presets are being symlink'd, perhaps also symlink dxgi.dll and d3dcompiler_47.dll after storing them in the data folder. Saves on re-downloading them all across multiple installs, not to mention deduplication between multiple installs. By the way, thank you for respecting the XDG directory specification / using libraries that respect it.
  • It would also be nice to be able to process an already provided ReShade installer / alternative resource acquisition paths.
  • More advanced though similarly helpful version of the previous suggestion would be proper command line arguments to be able to process in one go instead of relying on multiple input sections.
  • Input sections using readline could be cool too, or similar modern equivalents if Rust has any, not too familiar with readline-type stuff for Rust.

That's more or less all that comes to mind at the moment, thanks for reading.

Add option to install ReShade shaders

Hey again, just wanted to let you know that it seems like at least some preset/shader authors in the community (and probably all of them as time goes forward) are gearing their new releases around the assumption that the user just straight installed ReShade 5.6 while checking all the "install shaders" options. I.e. there's an assumption that reshade-shaders has everything in it that a normal ReShade 5.6 install would have (and only those to an extent).

As I've found, however, what GShade had is not necessarily the same as the above and so you may run into weird and exciting breakages from those differences.

So with that in mind, future-proofing wise it may be desirable to be able to only install the base reshade-shaders as done by the ReShade installation process. From here: https://github.com/kevinlekiller/reshade-steam-proton/blob/main/reshade-linux.sh#L305
It seems like a full installation wherein you checked all the optional shaders has the following repos merged into one reshade-shaders/{Shaders,Textures}, with some of the optional extras as sub-folders for the Shaders/ case.

https://github.com/CeeJayDK/SweetFX
https://github.com/martymcmodding/qUINT
https://github.com/BlueSkyDefender/AstrayFX
https://github.com/prod80/prod80-ReShade-Repository
https://github.com/crosire/reshade-shaders

I got a friend on Windows to do a fresh install to confirm the directory structure and at least by default it seems that reshade-shaders/Shaders does the following:

  • All files under Shaders in their respective git repos are copied directly to reshade-shaders/Shaders for the following:
    • SweetFX
    • reshade-shaders
  • All files under Shaders in their respective git repos are copied into a subdirectory within reshade-shaders/Shaders for the following:
    • qUINT - Subdirectory: reshade-shaders/Shaders/qUINT/
    • AstrayFX - Subdirectory: reshade-shaders/Shaders/AstrayFX (including another subdirect OneShot as in the repo)
    • prod80-ReShade-Repository - Subdirectory: reshade-shaders/Shaders/PD80/

The Textures directory remains flat, just a direct copy of all Textures/ folders from the above five repos.

If you wanted to be really fancy, as they're all git repositories, you could optionally depend upon git and git clone <url> all five of those repos (perhaps as shallow copies on first install), symlink them into the merged structure (as the kevinlekiller script does), and then use that structure accordingly. That way update operations can be as simple as git pull on all of them (or be even more fancy and setup the download area as a git repo that those 5 are subrepos of and then use a submodule recursive update to do all of them, that seems like overkill though).

Alternatively just straight zip download as per usual of course.

As a plus to all this, all involved repositories don't have asinine unenforceable provisions against downloading them, and some of them are even open source, so this can be automated.

Oh also as an additional bonus, here's the full text of the default ReShade.ini configuration file created for this type of installation (the subdirectories in reshade-shaders/Shaders are included explicitly rather than by using a wildcard catch all)

[APP]
ForceDefaultRefreshRate=0
ForceFullscreen=0
ForceVsync=0
ForceWindowed=0

[GENERAL]
EffectSearchPaths=.\reshade-shaders\Shaders,.\reshade-shaders\Shaders\qUINT,.\reshade-shaders\Shaders\PD80,.\reshade-shaders\Shaders\AstrayFX
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
TextureSearchPaths=.\reshade-shaders\Textures

[INPUT]
GamepadNavigation=1
KeyOverlay=36,0,0,0

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.