npm install -g shadertoy2webgl
# or
npx shadertoy2webgl <response.json>- Open a shader on shadertoy.com. DevTools (F12) → Network, reload.
- In the list: shadertoy
https://www.shadertoy.com/shadertoy(POST) Copy its Response (JSON), save asshader.json. - Run:
shadertoy2webgl shader.json
shadertoy2webgl a.json b.json
shadertoy2webgl --force shader.json # overwriteOptions: --force, --debug, --help, --version. Output: one directory per shader (id as name) with index.html, shader.js, shader.json.
import { shadertoy2webgl } from 'shadertoy2webgl';
const results = await shadertoy2webgl('shader.json', { force: true });
// results = [{ shaderId, html, js }, ...]- Converts ShaderToy shaders to WebGL2
- Handles ShaderToy uniforms (iResolution, iTime, iFrame, iMouse)
- Zero dependencies, Node.js >= 18, ESM
![]() |
st2webgl response.json (after saving that shader’s API response)demo/wdyczG/index.html shadertoy.com/view/wdyczG |
![]() |
demo/DdcfzH/index.html shadertoy.com/view/DdcfzH |
npm test
