Shadersave

A screensaver for Windows that can run Shadertoy shaders locally with little to no modification.

AGPL-3.0 License

Stars
8

🌈 Shadersave

Shadersave is a Windows screensaver that can run Shadertoy shaders locally under OpenGL 4.3 core, without using web technologies.

This is done by replicating the uniforms shadertoy provides to shaders, and wrapping each shader in a valid GLSL shader. You can find more information by reading the source code at Shader.cpp.

⚠️ Limitations

  • Audio and VR shaders will not be supported.
  • Mouse and/or keyboard input wont be supported for obvious reasons.
  • Non-image and non-buffer channel inputs won't be supported.
  • Cubemap shaders will not be supported.

📦 Installing

Due to a Windows design flaw, you must place screensavers in C:\Windows\System32 for them to be recognized by the control panel applet.

If you don't trust this project to be safe to place in system32, you can read through the code and build it yourself. The program won't even have permissions to modify files in system32 unless it runs as admin.

[!WARNING] Some shaders make heavy use of your system's GPU and thus can increase power usage significantly. Please take your power bill into consideration.

🛠️ Building

To build this, you will need the following:

  • Visual Studio 2022.
  • The Desktop development with C++ workload.
  • The Windows SDK.

You must also place GLEW and stb_image under the "libs" folder.

🪲 Debugging

Debugging screensavers is kind of a hassle, but it can be done.

  1. Open a Win32 window, for example Control Panel.
  2. Grab its window handle with Spy++ or some other software.
  3. Convert the handle from hexadecimal to decimal.
  4. Go into Shadersave -> Properties -> Debugging.
  5. On Command Arguments, write /p (window handle) and hit Apply.
  6. You can now debug the screensaver as long as you don't close the window you opened.

[!TIP] Renderdoc can be used this way as well, if you want to debug the graphics side.

To debug the configuration dialog, do the following:

  1. Do steps 1 to 4 from above.
  2. On Command Arguments, write /c:(window handle) and hit Apply.
  3. You can now debug the config dialog.

📷 Screenshots

pow(The Shining, 2.0) by dean_the_coder shining

isovalues 3 by FabriceNeyret2 isovalues

Cook-Torrance by xbe torrance

Splitting DNA by BigWIngs dna