A focused foundation for running a GLSL ES 1.00 shader through raw WebGL inside one Tauri v1 WebView.
This folder intentionally retains its original repository name:
webgl-tauri-v1-single-template
The visible example number is 02 so it aligns with the complete Junkpile Tauri v1 Essentials sequence.
requestAnimationFrame()HTML range / checkbox
↓
params{}
↓
requestAnimationFrame()
↓
gl.uniform*()
↓
gl.drawArrays()
↓
GLSL fragment shader
↓
WebGL canvas in the same WebView
There is no WebSocket, inter-window relay, p5.js renderer, or native GPU surface.
npm install
npm run dev
npm run build
On macOS, generated bundles are placed under:
src-tauri/target/release/bundle/
Unsigned builds may trigger Gatekeeper on another Mac. Public distribution generally requires Apple signing and notarization.
| Section | Parameter | Purpose |
|---|---|---|
| Color | Hue shift | Rotates the shader palette |
| Color | Saturation | Moves from monochrome to vivid color |
| Color | Brightness | Multiplies final output brightness |
| Motion | Zoom | Scales shader coordinates |
| Motion | Speed | Advances the accumulated animation clock |
| Motion | Distortion | Strengthens domain warping |
| Pattern | Complexity | Changes the fBm octave count |
| Pattern | Symmetry | Changes rotational folding |
| Pattern | Glow | Brightens the center of the field |
| Switches | Invert | Inverts the final color |
| Switches | Pulse | Enables rhythmic brightness modulation |
| Switches | Rotate | Rotates the complete coordinate field |
Keyboard shortcuts:
| Key | Action |
|---|---|
| Space | Pause or resume animation |
| R | Restore defaults and reset time |
| C | Recompile the shader program |
| F | Toggle native-window fullscreen |
webgl-tauri-v1-single-template/
├── README.md
├── MODERNIZATION-NOTES.md
├── package.json
├── src/
│ ├── index.html
│ ├── sketch.js
│ └── styles.css
└── src-tauri/
├── Cargo.toml
├── tauri.conf.json
└── src/main.rs
The complete setup is visible in src/sketch.js:
canvas.getContext('webgl')gl.createShader() and gl.compileShader()gl.createProgram() and gl.linkProgram()gl.createBuffer() for a four-vertex full-screen quadgl.getAttribLocation() and gl.vertexAttribPointer()gl.getUniformLocation() and gl.uniform*() every framegl.drawArrays(gl.TRIANGLE_STRIP, 0, 4)The small diagnostics panel reports shader compilation and link status. The dedicated shader-playground examples later provide source editing and richer error parsing.
<output> in src/index.html.DEFAULT_PARAMS in src/sketch.js.SLIDER_IDS.FRAG_SHADER.render() with uniform1f() or uniform2f().WebGL 1 requires fixed compile-time loop bounds. The fbm() function loops to a fixed maximum of eight iterations and exits early using the float u_complexity uniform.