Convert Figma logo to code with AI

crosire logoreshade

A generic post-processing injector for games and video software.

4,049
542
4,049
5

Top Related Projects

2,081

A collection of custom post processing effects for Unity

Quick Overview

ReShade is an advanced post-processing injector for games and video software. It allows users to apply a wide range of visual effects to games in real-time, enhancing graphics and customizing the visual experience. ReShade is highly customizable and supports a vast array of shaders and effects.

Pros

  • Highly customizable with a wide range of visual effects and shaders
  • Compatible with a large number of games and graphics APIs
  • Active community creating and sharing custom shaders
  • Minimal performance impact when configured properly

Cons

  • Can be complex to set up and configure for beginners
  • Some online games may consider it a cheat tool and ban its usage
  • Potential compatibility issues with certain games or graphics drivers
  • May cause performance drops in resource-intensive games when using multiple effects

Code Examples

ReShade is not primarily a code library, but rather a tool for injecting shaders into games. However, it does provide an API for developers to create custom shaders. Here are a few examples of ReShade shader code:

Basic color adjustment shader:

#include "ReShade.fxh"

uniform float Saturation < 
    ui_type = "slider";
    ui_min = 0.0; ui_max = 2.0;
> = 1.0;

float3 SaturationPass(float4 position : SV_Position, float2 texcoord : TexCoord) : SV_Target
{
    float3 color = tex2D(ReShade::BackBuffer, texcoord).rgb;
    float luma = dot(color, float3(0.2126, 0.7152, 0.0722));
    return lerp(luma, color, Saturation);
}

technique Saturation
{
    pass
    {
        VertexShader = PostProcessVS;
        PixelShader = SaturationPass;
    }
}

Simple vignette effect:

#include "ReShade.fxh"

uniform float VignetteStrength <
    ui_type = "slider";
    ui_min = 0.0; ui_max = 1.0;
> = 0.5;

float4 VignettePass(float4 position : SV_Position, float2 texcoord : TexCoord) : SV_Target
{
    float4 color = tex2D(ReShade::BackBuffer, texcoord);
    float2 center = float2(0.5, 0.5);
    float dist = distance(texcoord, center);
    color.rgb *= 1.0 - (dist * VignetteStrength);
    return color;
}

technique Vignette
{
    pass
    {
        VertexShader = PostProcessVS;
        PixelShader = VignettePass;
    }
}

Getting Started

To use ReShade:

  1. Download the latest version from the official website.
  2. Run the installer and select the game executable you want to enhance.
  3. Choose the appropriate rendering API for your game.
  4. Select the effects you want to use from the provided list.
  5. Launch the game and press the "Home" key to access the ReShade overlay.
  6. Customize and toggle effects as desired using the overlay menu.

For shader developers, refer to the ReShade documentation for API details and shader development guidelines.

Competitor Comparisons

2,081

A collection of custom post processing effects for Unity

Pros of Kino

  • Designed specifically for Unity, offering seamless integration with the game engine
  • Provides a collection of custom post-processing effects tailored for Unity projects
  • Lightweight and easy to use within Unity's post-processing stack

Cons of Kino

  • Limited to Unity projects, not usable with other game engines or applications
  • Smaller community and fewer available effects compared to ReShade
  • May require more manual setup and configuration within Unity

Code Comparison

Kino (Unity C#):

[CreateAssetMenu(menuName = "Kino/Image Effects/Glitch")]
public class Glitch : VolumeComponent
{
    public ClampedFloatParameter intensity = new ClampedFloatParameter(0f, 0f, 1f);
}

ReShade (HLSL):

uniform float Intensity <
    ui_type = "slider";
    ui_min = 0.0; ui_max = 1.0;
    ui_label = "Glitch Intensity";
> = 0.5;

Both examples show how to define a configurable intensity parameter for a glitch effect, but Kino uses Unity's Volume system while ReShade uses its own uniform variable system.

Convert Figma logo designs to code with AI

Visual Copilot

Introducing Visual Copilot: A new AI model to turn Figma designs to high quality code using your components.

Try Visual Copilot

README

ReShade

This is a generic post-processing injector for games and video software. It exposes an automated way to access both frame color and depth information and a custom shader language called ReShade FX to write effects like ambient occlusion, depth of field, color correction and more which work everywhere.

ReShade can optionally load add-ons, DLLs that make use of the ReShade API to extend functionality of both ReShade and/or the application ReShade is being applied to. To get started on how to write your own add-on, check out the API reference.

The ReShade FX shader compiler contained in this repository is standalone, so can be integrated into other projects as well. Simply add all source/effect_*.* files to your project and use it similar to the fxc example.

Building

You'll need Visual Studio 2017 or higher to build ReShade and Python for the gl3w dependency.

  1. Clone this repository including all Git submodules
    git clone --recurse-submodules https://github.com/crosire/reshade
  2. Open the Visual Studio solution
  3. Select either the 32-bit or 64-bit target platform and build the solution.
    This will build ReShade and all dependencies. To build the setup tool, first build the Release configuration for both 32-bit and 64-bit targets and only afterwards build the Release Setup configuration (does not matter which target is selected then).

A quick overview of what some of the source code files contain:

FileDescription
dll_log.cppSimple file logger implementation
dll_main.cppMain entry point (and optional test application)
dll_resources.cppAccess to DLL resource data (e.g. built-in shaders)
effect_lexer.cppLexical analyzer for C-like languages
effect_parser_stmt.cppParser for the ReShade FX shader language
effect_preprocessor.cppC-like preprocessor implementation
hook.cppWrapper around MinHook which tracks associated function pointers
hook_manager.cppAutomatic hook installation based on DLL exports
input.cppKeyboard and mouse input management and window message queue hooks
runtime.cppCore ReShade runtime including effect and preset management
runtime_gui.cppOverlay rendering and everything user interface related

Contributing

Any contributions to the project are welcomed, it's recommended to use GitHub pull requests.

Feedback and Support

See the ReShade Forum and Discord server for feedback and support.

License

ReShade is licensed under the terms of the BSD 3-clause license.
Some source code files are dual-licensed and are also available under the terms of the MIT license, when stated as such at the top of those files.