mausimus / ShaderGlass

Overlay for running GPU shaders on top of Windows desktop
GNU General Public License v3.0
1.08k stars 38 forks source link
crt crt-monitor directx libretro overlay retro retroarch retrogaming shader shaders slang windows

License GitHub Stars Downloads Latest Release

ShaderGlass

Overlay for running GPU shaders on top of Windows desktop.

Features


Download

Latest release (v0.9, 10 Aug 2023):

https://github.com/mausimus/ShaderGlass/releases/download/v0.9/ShaderGlass-0.9-win-x64.zip


Follow ShaderGlass on itch.io for latest updates.


Requirements

If the app reports missing libraries please install Visual C++ Redistributable 2019


Screenshots

ShaderGlass running over multiple applications on Windows 11 desktop.

screenshot

Demonstration video (YouTube)

Desktop Glass mode

In this mode a transparent floating window will apply a shader to anything behind it. Requires Windows 10 2004 - on 1903/1909 you will see only a black window if you switch to this mode.

Wikipedia in Chrome processed by crt-geom shader which applies scanlines and CRT curvature.

screenshot

Window Clone mode

When capture is fixed to a specific window it's easier to tune scaling to match the input and image can also be recaptured (screenshot/OBS etc.)

FS-UAE

Amiga version of The Secret of Monkey Island (1990) running in FS-UAE with crt-interlaced-halation shader applied.

screenshot

Altirra

Ninja (1986) for the Atari XL running in Altirra with a TV-OUT simulation shader.

screenshot

Adventure Game Studio

The Crimson Diamond (2020), a modern AGS game softened using crt-fast-bilateral-super-xbr shader.

screenshot

DOSBox

Police Quest (1987) with its massive half-EGA pixels, aspect-ratio corrected and post-processed using newpixie-crt shader.

screenshot

Rick Dangerous (1989) with C64 monitor shader applied.

screenshot


Options

Currently supported options are:

You can save and load profile files which will store all the options. It's also possible to pass profile file path on the command line and ShaderGlass will load it on startup.


Command Line

ShaderGlass.exe [-p|--paused] [-f|--fullscreen] [profile.sgp]

You can pass profile filename as a command-line parameter to ShaderGlass.exe and it will be auto-loaded.

In addition -p will launch in paused mode, and -f will launch in fullscreen mode.


Tuning

In order to achieve the best effect it's necessary to tune parameters to match your input:

Always check that input is crisply pixelated using the "none" shader as there is often implicit scaling happening (for example even when Chrome displays an image at 100%, Windows DPI scaling is still applied). The none shader should display a pixelated image with no smoothing whatsoever, try to match Input Pixel Size setting with your input's size to achieve that.

Parameters

All shaders start using default Parameters as defined by their authors, but you can also tweak them using Shader -> Parameters menu option.

params

Emulators

Most emulators (DOSBox, FS-UAE, Altirra etc.) will capture mouse by default so you can use them in Window Clone mode. ShaderGlass window will remain topmost so just position it over the game window and Alt-Tab to the game to have mouse and focus captured.

ScummVM

ScummVM doesn't capture mouse cursor by default so for best results follow below steps: 1) Use Window Clone mode, set Input/Output/Shader options to your liking 2) Switch Output Window to Click-through 3) Click or Alt-Tab to ScummVM game window so that it has focus 4) Press Ctrl-M which will force ScummVM to capture mouse

This way you should have the mouse captured by ScummVM so that it remains within the game window until you press Ctrl-M again. You can apply output scaling and/or aspect ratio correction in ShaderGlass and enjoy the game.


Frequently Asked Questions

See FAQ here.


Code

Built using Visual Studio 2022 using ISO C++ 20, Windows SDK 10.0.22000, Windows Capture API and DirectX 11.

ShaderGlass includes a limited implementation of RetroArch shader back-end. ShaderGen is a command-line tool for converting Slang shaders into .h files which can be merged into ShaderGlass. The conversion process requires:

  1. glslang for converting Slang/GLSL shaders to SPIR-V
  2. SPIR-V cross-compiler for converting those to HLSL (DX11 format)
  3. Direct3D Shader Compiler (fxc.exe) for pre-compiling into bytecode


Notices