ShadowDusk.ShaderToy
0.26.0
dotnet add package ShadowDusk.ShaderToy --version 0.26.0
NuGet\Install-Package ShadowDusk.ShaderToy -Version 0.26.0
<PackageReference Include="ShadowDusk.ShaderToy" Version="0.26.0" />
<PackageVersion Include="ShadowDusk.ShaderToy" Version="0.26.0" />
<PackageReference Include="ShadowDusk.ShaderToy" />
paket add ShadowDusk.ShaderToy --version 0.26.0
#r "nuget: ShadowDusk.ShaderToy, 0.26.0"
#:package ShadowDusk.ShaderToy@0.26.0
#addin nuget:?package=ShadowDusk.ShaderToy&version=0.26.0
#tool nuget:?package=ShadowDusk.ShaderToy&version=0.26.0
ShadowDusk.ShaderToy
A pure-managed, zero-native converter that turns a ShaderToy (or plain-GLSL) fragment shader into a self-contained HLSL .fx source you can compile for MonoGame, KNI, or FNA.
It accepts both entry conventions and auto-detects them (no flag): a ShaderToy void mainImage(out vec4 fragColor, in vec2 fragCoord) shader, and a plain-GLSL void main() fragment shader that writes gl_FragColor / a user-declared out vec4 and reads gl_FragCoord. Unsupported constructs fail loudly with a located diagnostic (line/column) rather than producing a silently-wrong .fx.
This package is standalone and optional — it is not part of ShadowDusk's faithful mgfxc-replacement pipeline, and ShadowDusk.Compiler does not depend on it. Its only dependency is ShadowDusk.Core (pure managed). When it is installed beside ShadowDusk.Compiler, ShaderConverter.Compile / CompileAsync read ShaderToy / GLSL with no setup: the package registers ShaderToyFrontend with ShaderFrontends (a trimmed application calls ShaderToyFrontend.Register() itself). Install it when you want to convert ShaderToy/GLSL shaders in-process (e.g. a web shader fiddle or an in-app importer). To then compile the resulting .fx, use ShadowDusk.Compiler (in-process library) or ShadowDusk.Cli (the ShadowDuskCLI tool, which also accepts .glsl input directly).
Usage
using ShadowDusk.ShaderToy;
ConvertResult result = ShaderToyConverter.Convert(glslSource);
if (result.Success)
{
string fx = result.Fx!; // self-contained HLSL .fx source
// result.UsedUniforms lists the ShaderToy built-ins (iTime, iChannel0, …)
// plus any custom uniforms the shader drives each frame.
}
else
{
foreach (ConvertDiagnostic d in result.Diagnostics)
Console.Error.WriteLine($"{d.Severity} ({d.Line},{d.Column}): {d.Message}");
}
A batch multipass entry point (MultipassConverter.Convert) converts a ShaderToy multi-tab export (Buffer A-D + Image) into one .fx per pass plus a machine-readable wiring manifest; you drive the render graph yourself with MonoGame render targets (the converter accepts the syntax, it is not a ShaderToy runtime).
- Documentation: https://kaltinril.github.io/ShadowDusk/
- Source / issues: https://github.com/kaltinril/ShadowDusk
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net8.0 is compatible. net8.0-android was computed. net8.0-browser was computed. net8.0-ios was computed. net8.0-maccatalyst was computed. net8.0-macos was computed. net8.0-tvos was computed. net8.0-windows was computed. net9.0 was computed. net9.0-android was computed. net9.0-browser was computed. net9.0-ios was computed. net9.0-maccatalyst was computed. net9.0-macos was computed. net9.0-tvos was computed. net9.0-windows was computed. net10.0 is compatible. net10.0-android was computed. net10.0-browser was computed. net10.0-ios was computed. net10.0-maccatalyst was computed. net10.0-macos was computed. net10.0-tvos was computed. net10.0-windows was computed. |
-
net10.0
- ShadowDusk.Core (>= 0.26.0)
-
net8.0
- ShadowDusk.Core (>= 0.26.0)
NuGet packages (1)
Showing the top 1 NuGet packages that depend on ShadowDusk.ShaderToy:
| Package | Downloads |
|---|---|
|
ShadowDusk.SkSL
ShadowDusk SkSL front-end: a pure-managed, zero-native converter that translates a Skia SkSL runtime-effect shader (half4 main(float2 coord)) into a self-contained HLSL .fx source (SkSLToFxConverter.Convert). With ShadowDusk.Compiler installed, ShaderConverter.Compile reads a .sksl shader directly. Standalone and optional, not part of the faithful mgfxc-replacement pipeline. |
GitHub repositories
This package is not used by any popular GitHub repositories.
| Version | Downloads | Last Updated |
|---|---|---|
| 0.26.0 | 417 | 11/15/2026 |
| 0.25.1 | 175 | 11/9/2026 |
| 0.25.0 | 108 | 11/5/2026 |
| 0.24.0 | 116 | 11/1/2026 |
| 0.23.0 | 128 | 10/30/2026 |
| 0.22.1 | 119 | 10/29/2026 |
| 0.22.0 | 126 | 10/28/2026 |
| 0.21.0 | 156 | 10/6/2026 |
| 0.20.0 | 517 | 9/10/2026 |
| 0.19.0 | 160 | 9/10/2026 |
| 0.18.0 | 178 | 8/3/2026 |
| 0.17.0 | 184 | 8/1/2026 |
| 0.16.0 | 170 | 7/31/2026 |
| 0.15.1 | 142 | 7/28/2026 |
| 0.15.0 | 148 | 7/28/2026 |
| 0.14.2 | 128 | 7/25/2026 |
| 0.14.1 | 146 | 7/25/2026 |
| 0.14.0 | 137 | 7/24/2026 |
| 0.13.0 | 136 | 7/23/2026 |
| 0.12.1 | 131 | 7/22/2026 |