- Read
CODEBASE_DOCUMENTATION.mdfor full architecture and file reference - Check current branch (
work1) - Run on
http://localhost:4444(do NOT use port 3000)
WebGL shader-based procedural texture generator. Uses mebiusbox's MIT-licensed pixy.js shader library. Built into a professional multi-layer texture creation tool with PBR export, 3D preview, gradient editor, undo/redo, and 119 pre-rendered sprite sheet particle effects (100 pixy-based + 19 custom GLSL).
editor.html- Main editor (loads src/app.js, has layers/PBR/gradient/export)index.html- Redirect to showcase.htmlpixy.module.min.js- 439KB MIT-licensed shader library by mebiusbox (DO NOT MODIFY)gallery.html- Live animated gallery of 70+ effectsparticles.html- 3D particle viewport + Browse 100 modesprite-gallery.html- 119 animated sprite sheets from pre-rendered PNGsgen-sprites.html- Headless generator for 100 pixy sprite sheetsgen-custom.html- 19 custom GLSL shaders (raymarching, fractals, physics)presets/- 38 JSON preset filessprites/- 118 pre-rendered sprite sheet PNGs (6x6 grid, 192px frames)
src/app.js- Main coordinator (init, animate, render, all subsystems)src/pixy-api.js- Facade around pixy exportssrc/defaults.js- 65+ effect types, ~100 default parameterssrc/render-pipeline.js- 6-pass pipeline (Base→Polar→CB→Tiling→Normal→Copy)src/layer-manager.js- Multi-layer CRUD, reorder, duplicatesrc/compositor.js- Ping-pong RT compositor, 9 blend modessrc/gradient-editor.js- Multi-stop gradient editor + 5 presetssrc/gradient-pass.js- Gradient color ramp post-processsrc/sprite-sheet.js- Animation frame capture → grid atlassrc/alpha-export.js- Alpha inference from luminance + PNG savesrc/export.js- PNG/JPEG/ZIP export (JSZip CDN)src/noise-sphere.js- 3D displacement preview spheresrc/preview-3d.js- MeshStandardMaterial + PBR maps on 3D geometrysrc/pbr-generator.js- Runs normal/roughness/AO/metallic passessrc/history.js- Undo/redo (50 snapshots, Ctrl+Z/Y)src/preset-loader.js- Preset bar UI + JSON loadingsrc/tile-preview-pass.js- 2x2 tiling visualizationsrc/ui/gui-setup.js- lil-gui parameter panelssrc/ui/layer-panel.js- Drag-to-reorder layer panelsrc/ui/toolbar.js- Quick-action buttonssrc/ui/pbr-panel.js- PBR map thumbnails + sliderssrc/ui/export-panel.js- Resolution selector + format buttonssrc/shaders/blend.js- 9 blend modes GLSLsrc/shaders/gradient-map.js- Luminance-to-gradient GLSLsrc/shaders/tile-preview.js- Tiling visualization GLSLsrc/shaders/pbr/- 4 PBR shaders (height-normal, roughness, ao, metallic)
pixy.module.min.jsis READ-ONLY.PIXY.ShaderChunkis mutable+exported for injection- Internal effect chunk dict
rris NOT exported — can't add new effect types via ShaderChunk alone - Custom GLSL shaders bypass pixy entirely (raw Three.js ShaderMaterial)
- All 65+ effects share ~100 params (unused silently ignored). Resolution always square.
- Sprite sheets: 6x6=36 frames, 192px each, 1152x1152 PNG atlas
- Circle mask:
smoothstep(.3,1.,d)+ luminance killsmoothstep(.0,.04,lum) - CanvasTexture flipY fix in shaders:
uGrid-1.-floor(f0/uGrid) - Three.js 0.174.0 from unpkg CDN. lil-gui from CDN. JSZip loaded on demand.
- Phase 0-7: ALL DONE (layers, gradient, UI, PBR, 3D preview, undo/redo, export)
- Phase 8: FUTURE (node graph editor)
- Sprites: 100 pixy + 19 custom GLSL = 119 total, pre-rendered via Puppeteer+Xvfb
- Custom GLSL: Raymarched nebula, black hole, plasma sphere, fractals, 5 warp tunnels, aurora, tornado, jellyfish, phoenix, god rays, singularity, bioluminescent, reality glitch, crystal geode
19 original fragment shaders. Each uses proper color theory:
- Split-complementary: Warp Tunnel (blue-violet + amber)
- Analogous warm: Warp Inferno (gold→orange→ember), Phoenix
- Triadic: Warp Void (violet + teal + gold)
- Complementary: Warp Electric (cyan + coral)
- Analogous cool: Warp Rainbow (teal→blue→violet HSV sweep)
- Gallery uses IntersectionObserver + round-robin (max 6/frame) for GPU efficiency
- Puppeteer needs Xvfb for WebGL:
xvfb-run --auto-servernum node save-sprites.mjs - Custom shaders NOT in editor yet — only in sprite gallery. Editor uses pixy effects only.
python3 -m http.server 4444 # serve locally
xvfb-run --auto-servernum --server-args="-screen 0 1280x1024x24" node save-sprites.mjs # gen pixy sprites
xvfb-run --auto-servernum --server-args="-screen 0 1280x1024x24" node save-custom.mjs # gen custom sprites