{"id":26739380,"url":"https://github.com/metaory/shadertoy2webgl","last_synced_at":"2025-05-14T15:21:00.533Z","repository":{"id":284181596,"uuid":"954035789","full_name":"metaory/shadertoy2webgl","owner":"metaory","description":"Convert ShaderToy shaders to WebGL2 - CLI and library","archived":false,"fork":false,"pushed_at":"2025-03-26T07:51:16.000Z","size":12182,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-04-25T11:26:54.820Z","etag":null,"topics":["shadertoy","webgl"],"latest_commit_sha":null,"homepage":"https://npmjs.com/package/shadertoy2webgl","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/metaory.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2025-03-24T13:17:59.000Z","updated_at":"2025-03-26T07:51:20.000Z","dependencies_parsed_at":"2025-03-24T16:01:34.745Z","dependency_job_id":"c55be498-4a04-41f4-80e9-15aa5ac98937","html_url":"https://github.com/metaory/shadertoy2webgl","commit_stats":null,"previous_names":["metaory/shadertoy2webgl"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/metaory%2Fshadertoy2webgl","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/metaory%2Fshadertoy2webgl/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/metaory%2Fshadertoy2webgl/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/metaory%2Fshadertoy2webgl/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/metaory","download_url":"https://codeload.github.com/metaory/shadertoy2webgl/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254170117,"owners_count":22026223,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["shadertoy","webgl"],"created_at":"2025-03-28T04:01:29.440Z","updated_at":"2025-05-14T15:21:00.483Z","avatar_url":"https://github.com/metaory.png","language":"JavaScript","funding_links":[],"categories":["JavaScript"],"sub_categories":[],"readme":"\u003cdiv align=\"center\"\u003e\n    \u003cimg src=\".github/assets/logo.svg\" alt=\"demo\" height=\"60\" /\u003e\n    \u003ch3\u003e\u003ckbd\u003eShaderToy\u003c/kbd\u003e ❯❯ \u003ckbd\u003eWebGL2\u003c/kbd\u003e\u003c/h3\u003e\n    \u003cimg src=\"demo/DdcfzH.png\" alt=\"demo\" height=\"200\" /\u003e\n\u003c/div\u003e\n\n## Installation\n\n```bash\n# Install globally\nnpm install -g shadertoy2webgl\n\n# Or use npx (no installation needed)\nnpx shadertoy2webgl \u003cshader-id\u003e [\u003cshader-id\u003e...]\n\n# Or install as a project dependency\nnpm install shadertoy2webgl\n```\n\n## CLI Usage\n\n```bash\n# Using global installation\nshadertoy2webgl \u003cshader-id\u003e [\u003cshader-id\u003e...]\n# or\nst2webgl \u003cshader-id\u003e [\u003cshader-id\u003e...]\n\n# Using npx (no installation needed)\nnpx shadertoy2webgl \u003cshader-id\u003e [\u003cshader-id\u003e...]\n\n# Example with multiple shaders\nshadertoy2webgl MdX3Rr wdyczG DdcfzH\n\n# Force overwrite existing directories\nshadertoy2webgl --force \u003cshader-id\u003e [\u003cshader-id\u003e...]\n```\n\n## Library Usage\n\n```javascript\nimport { shadertoy2webgl } from 'shadertoy2webgl';\n\n// Convert a shader and get paths to generated files\nconst { html, js } = await shadertoy2webgl('shader-id');\nconsole.log(html, js);\n\n// Example with error handling\ntry {\n    const { html, js } = await shadertoy2webgl('MdX3Rr');\n    console.log('Generated files:', { html, js });\n} catch (error) {\n    console.error('Failed to process shader:', error.message);\n}\n```\n\n## Features\n\n- Converts ShaderToy shaders to WebGL2\n- Handles ShaderToy-specific uniforms (iResolution, iTime, iFrame, iMouse)\n- Generates web-compatible HTML and JavaScript\n- Zero dependencies\n- Modern WebGL2 support\n- ESM module support\n- Works with Node.js \u003e= 18\n\n## Demos\n\nWe provide two sample demos showcasing different shader effects:\n\n\u003ctable\u003e\u003ctr\u003e\n\u003ctd\u003e\u003cimg src=\"demo/wdyczG.png\" alt=\"Plasma Effect\" height=\"90\" /\u003e\u003c/td\u003e\n\u003ctd\u003e\n\u003ccode\u003est2webgl wdyczG\u003c/code\u003e\u003cbr/\u003e\n\u003ca href=\"demo/wdyczG/index.html\"\u003edemo/wdyczG/index.html\u003c/a\u003e\u003cbr/\u003e\n\u003ci\u003e\u003ca href=\"https://www.shadertoy.com/view/wdyczG\"\u003eshadertoy.com/view/wdyczG\u003c/a\u003e\u003c/i\u003e\u003cbr/\u003e\n\u003c/td\u003e\n\u003c/tr\u003e\u003c/table\u003e\n\n\u003ctable\u003e\u003ctr\u003e\n\u003ctd\u003e\u003cimg src=\"demo/DdcfzH.png\" alt=\"Abstract Waves\" height=\"90\" /\u003e\u003c/td\u003e\n\u003ctd\u003e\n\u003ccode\u003est2webgl DdcfzH\u003c/code\u003e\u003cbr/\u003e\n\u003ca href=\"demo/DdcfzH/index.html\"\u003edemo/DdcfzH/index.html\u003c/a\u003e\u003cbr/\u003e\n\u003ci\u003e\u003ca href=\"https://www.shadertoy.com/view/DdcfzH\"\u003eshadertoy.com/view/DdcfzH\u003c/a\u003e\u003c/i\u003e\u003cbr/\u003e\n\u003c/td\u003e\n\u003c/tr\u003e\u003c/table\u003e\n\n## Output\n\nThe tool generates files in a directory named after the shader ID:\n- `index.html`: A standalone HTML file with the shader\n- `shader.js`: The WebGL2 shader code\n- `shader.json`: Shader metadata and code\n\nIf any directory already exists, the tool will refuse to overwrite it unless the `--force` flag is used:\n\n```bash\n# Overwrite existing directories\nshadertoy2webgl --force \u003cshader-id\u003e [\u003cshader-id\u003e...]\n```\n\n## Testing\n\n```bash\n# Run tests\nnpm test\n\n# Run tests with coverage (requires Node.js \u003e= 20)\nnode --test --coverage test/\n```\n\nThe test suite verifies:\n- Shader fetching and conversion\n- File generation\n- Error handling\n- Output validation\n- Uniform handling\n\n\n## License\n\n[MIT](LICENSE)","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmetaory%2Fshadertoy2webgl","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmetaory%2Fshadertoy2webgl","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmetaory%2Fshadertoy2webgl/lists"}