A native Tauri 2 + wgpu counterpart to Junkpile’s WebView shader playground workflow.
The application keeps the editable interface in HTML/CSS/JavaScript while WGSL compilation and rendering occur in Rust on a native GPU surface. The editor can open and save real .wgsl files, compile source without restarting, preserve the last successful pipeline after errors, control uniforms, pause shader time, and export high-resolution PNG stills.
Command/Ctrl + Enternpm install
npm run dev
Two windows open:
Command/Ctrl + Enter.Automatic compilation is enabled by default and runs after a short editing pause. Disable it for expensive shaders or large edits.
Playground shaders use these entry points and bindings:
@vertex
fn vs_main(@builtin(vertex_index) vertex_index: u32) -> VertexOut
@fragment
fn fs_main(input: VertexOut) -> @location(0) vec4<f32>
@group(0) @binding(0)
var<uniform> u: Uniforms;
The shared parameter vector is:
params.x // gain
params.y // zoom
params.z // spin speed in radians per second
params.w // complexity / workload
Spin is an angular velocity. A shader should derive rotation from time and spin:
let angle = u.timing.x * u.params.z;
At 0.0, rotation stops. Positive and negative values rotate in opposite directions.
render.json defines the preset catalog and startup preset.The active runtime asset directory is displayed in the footer and can be opened from the preset panel.
PNG export renders the current compiled pipeline into a separate offscreen texture at the selected dimensions. It does not resize the preview window.
Large exports require substantial GPU and CPU memory. An 8K RGBA image is approximately 126.6 MiB before PNG compression. The application validates the selected dimensions against the GPU’s maximum 2D texture size before export.
Use each preset’s peak profile to increase GPU workload. The raymarch, interference, and volumetric shaders are the most demanding starting points.
| Shortcut | Action |
|---|---|
Command/Ctrl + O |
Open WGSL file |
Command/Ctrl + S |
Save |
Command/Ctrl + Shift + S |
Save As |
Command/Ctrl + Enter |
Compile source |
Tab |
Insert two spaces in the editor |
Static package validation is documented in VALIDATION.md. The first Rust build and native runtime test must be completed on a machine with Rust, Tauri 2 prerequisites, and a compatible GPU.