Files
VFXdemo/README.md
2026-04-01 20:29:33 +08:00

51 lines
1.1 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
# VFXdemo
一个用于快速复刻 ShaderToy 效果的本地工具页WebGL2 多预览面板 + 后端内容管理)。
## 启动
```bash
npm install
npm run dev
```
打开 `http://localhost:5180`
- 展示页:`http://localhost:5180/index.html`
- 管理页:`http://localhost:5180/admin.html`
## Docker 一键启动(国内镜像)
```bash
./start-docker-cn.sh
```
说明:
- Node 基础镜像走 `docker.m.daocloud.io`
- npm 安装源走 `https://registry.npmmirror.com`
- 默认使用 `5180`,若被占用会自动递增到可用端口(如 `5181`
- 启动完成后终端会打印最终访问地址
## 页面能力
- 预览墙:多个 VFX 同屏实时渲染,支持点进详情
- 每个小窗独立播放/暂停
- 管理页独立:在 `admin.html` 粘贴 GLSL 并保存到后端
- 保存后实时刷新前端展示,支持删除
## 兼容的 uniform
- `iResolution`
- `iTime`
- `iTimeDelta`
- `iFrame`
- `iMouse`
## 后端接口
- `GET /api/shaders` 获取列表
- `POST /api/shaders` 新增 shader`name`, `author`, `code`
- `DELETE /api/shaders/:id` 删除 shader
数据默认持久化在 `data/shaders.json`