静态托管(GitHub Pages)没有本机 Node 后端:壁纸库列表 / 属性保存 / 删除 / 诊断流在线上不可用 —— 这是设计如此,不是故障;「选择文件夹」纯前端扫描仍可用。
这是 wallpaper-engine-web-loader 的浏览器端测试台:一个静态页面 + WebGL2,
不装 Wallpaper Engine、不装任何 Windows 依赖,就能实时渲染 scene.pkg / .mpkg 场景壁纸。
本仓库不分发任何真实壁纸,默认载入的是我们自己用算术生成的合成样例。
| 区域 | 是什么 |
|---|---|
| 顶部 tab(控制台 / 说明 / 壁纸设置) | 三个页面:控制台=渲染与调试;说明=本页;壁纸设置=壁纸自带选项与对应 API 的对照表 |
| 左侧「选择壁纸」 | 壁纸库列表(本机后端提供,或点「选择文件夹」在浏览器里扫描本地目录) |
| 左侧「壁纸参数」 | 当前壁纸 project.json 里声明的可自定义项(滑条 / 勾选 / 取色 / 下拉 / 文本、条件隐藏项) |
| 右侧「设置1」 | 分辨率 / 适应方式 / DPR / FPS 上限 / 音量 / 系统实况 / 指针注入 / 鼠标尾迹 / 暂停·重挂载·释放·新窗口·滤镜 |
| 右侧「壁纸」 | 渲染舞台(iframe 内跑渲染器);右上角有全屏按钮 |
| 右侧「控制台」 | 渲染器日志与 /diag 诊断流;顶栏按钮可收起,拖动上沿可调高度 |
| 底部状态栏 | 库数量 / 当前壁纸 / 分辨率 / DPR / 帧率上限 / 实测 FPS |
那一行就是「切换栏」:当前壁纸是第一个 tab(标题即壁纸名),后面是本页补丁按壁纸库生成的其它壁纸 tab, 最右边的 + 会切到「选择未选中的壁纸」——它把左侧列表切到「选择壁纸」并过滤掉当前项, 你在左边点一个就完成切换。
那张表把 Wallpaper Engine 自带的壁纸选项(翻转 / 播放速度 / 显示颜色选项:亮度·对比度·饱和度·色调偏移 …) 与本页能改它的方式一一对上:能改的给出 API / JSON 键 / 查询参数,WE 自带不需要写的明确标「自带,无需实现」。
线上是纯静态托管,没有本机 Node 后端:壁纸库列表 / 属性保存 / 删除 / 打开所在文件夹 / 渲染器诊断流
(/api/* 与 /diag)全部不可用 —— 这是设计如此,不是故障,页面会把这些控件置灰并写明原因。
「选择文件夹」纯前端扫描照常可用,默认壁纸仍是合成样例。完整功能请在本仓库源码目录跑
node server/we-scene-demo-server.mjs 8899(或 bash start-demo.sh)。
wallpaper-engine-web-loader。tools/make-sample.mjs 生成,无第三方内容。This is the browser-side test bench of wallpaper-engine-web-loader: one static page plus
WebGL2 renders Wallpaper Engine scene.pkg / .mpkg wallpapers live — no Wallpaper Engine install,
no Windows dependencies. This repository redistributes no real wallpaper; the default is a synthetic sample we generate ourselves.
| Area | What it is |
|---|---|
| Top tabs (Console / Guide / Wallpaper settings) | Three pages: console (render + debug), this guide, and the table mapping Wallpaper Engine's own wallpaper options to the API that changes them |
| Left “Choose wallpaper” | The library list (from the local Node backend, or scanned in-browser via “Choose folder”) |
| Left “Wallpaper parameters” | The customizable items declared in the wallpaper's project.json |
| Right “Settings 1” | Resolution / fit / DPR / FPS cap / volume / live system / pointer injection / mouse trail / pause · remount · release · new window · filter |
| Right “Wallpaper” | The render stage (the renderer runs inside an iframe); fullscreen button top-right |
| Right “Console” | Renderer log and the /diag stream; collapse with the button, drag the top edge to resize |
| Status bar | Library counts / current wallpaper / resolution / DPR / FPS cap / measured FPS |
The current wallpaper is the first tab (its title is the wallpaper name); further tabs are generated from the library by this page's patch, and the + at the right jumps to “choose another wallpaper” — it switches the left list to “Choose wallpaper”, filters out the current item, and one click there performs the switch.
The table pairs Wallpaper Engine's own wallpaper options (flip / playback rate / colour options: brightness, contrast, saturation, hue shift …) with how this page changes them: an API, a JSON key or a query parameter where one exists; “built-in, nothing to implement” where Wallpaper Engine already owns it.
Online is plain static hosting with no local Node backend, so the library listing, property saving, deleting,
reveal-in-folder and the diagnostics stream (/api/*, /diag) are unavailable — by design, not a
failure; those controls are greyed out with the reason shown. “Choose folder” still works and the default wallpaper remains
the synthetic sample. For the full bench run node server/we-scene-demo-server.mjs 8899 in the source tree.
oneincase/webwallgl, MIT) — its attribution and licence are unchanged.tools/make-sample.mjs and carries no third-party content.三类来源分清楚:WE 自带 无需我们实现;
本页已实现 给出可直接用的 API;需实现 给出计划中的键名与挂点。
右侧「设置1」里出现的开关就是本页的实现面;「壁纸参数」里的项来自壁纸自己的 project.json。
| WE 里的名字 | WE 内部键(本机 ui_zh-chs.json 实测) | 本页怎么改(API / 键 / 参数) | 状态 |
|---|---|---|---|
| 翻转(水平翻转) | ui_browse_properties_alignment_flip_horizontally | 渲染输出整体 transform: scaleX(-1):__wp.setDisplay({flipH:true}) / ?fliph=1(对应 CSS 变量 --mpw-flip-h) | 需实现 |
| 对齐方式 / 缩放 | ui_browse_properties_alignment · …_alignment_zoom | 已实现:工具条「分辨率 / 适应方式」(#fit)+ ?fit=cover|contain|stretch;缩放走壁纸 project.json → general.zoom 与相机层 zoom | 已实现 |
| 播放速度 0.5–2× | ui_browse_properties_playback_rate | 全局动画/视频时间倍率:__wp.setPlaybackRate(1.5) / ?rate=1.5(乘到动画 dt 与 video.playbackRate) | 需实现 |
| 显示颜色选项(总开关) | ui_browse_properties_show_color_options | 打开后才显示下面四项;关闭时四项不参与滤镜:__wp.setDisplay({colorOptions:false}) | 需实现 |
| 亮度 / 对比度 / 饱和度 / 色调偏移 | ui_browse_properties_brightness · _contrast · _saturation · _hue_shift | 合成一条 CSS filter 挂在渲染输出上:brightness(b) contrast(c) saturate(s) hue-rotate(h deg);API __wp.setDisplay({brightness:1.1, contrast:1.05, saturation:1.2, hue:15}),查询参数 ?bright=1.1&contrast=1.05&satur=1.2&hue=15。做法与 DSH 插件一致(插件就是 CSS filter,见 dsh-mpkg-wallpaper/lib/client.js 的「画面亮度」段) | 需实现 |
| 音量 / 静音 | ui_browse_monitors_mute · WE 全局音量 | 已实现:工具条「音量」滑条 #volume;页面内 __wp.setVolume(0.5) | 已实现 |
| 对动作做出反应(视差/陀螺仪) | ui_browse_properties_parallax | 不做(用户口径:无陀螺仪 / 不做这项);若将来做,走指针注入通道 __wp.pushPointer(x,y) 已有 | 不做 |
| 录音(WE 自带录屏 / 录音音量) | ui_settings_hotkeys_action_recording · ui_settings_recording_volume | WE 客户端自带功能,不在页面内实现;要录屏用系统/浏览器自带录制(MediaRecorder 可后续按需加) | 自带 |
project.json → general.properties)| 项 | 本页怎么改 | 状态 |
|---|---|---|
| 滑条 / 勾选 / 取色 / 下拉 / 文本 / 分组标题 / 条件隐藏 | 左侧「壁纸参数」面板直接改;等价的 URL 形式 ?props=name:value,…(本机后端会落盘保存) | 已实现 |
| 粒子层 / 动画层 / 文本层覆盖 | 属性面板里同名项(visible/alpha/color/brightness/origin/scale/size/parallaxDepth/text) | 已实现 |
| 参数 | API / 控件 |
|---|---|
| 逻辑分辨率 / 适应方式 / DPR | #resolution · #fit · #dpr;查询参数 ?res=1920x1080&fit=cover&dpr=1 |
| FPS 上限 | #fps(无上限 = 跟随显示器) |
| 系统实况(歌名 / 频谱) | #live-system;本机后端读 media-control,频谱走麦克风 |
| 指针注入 / 鼠标尾迹 | #pointer-push · #trail-on;坐标通道 __wp.pushPointer(x,y) |
| 质量档位 / AA / 滤镜 | ?q=low|mid|high · ?aa=fxaa|msaa4 · #fx |
// 浏览器控制台(先选中一张壁纸,等 __wp 就绪)
const wp = document.querySelector('#frame').contentWindow.__wp
wp.setDisplay({ brightness: 1.15, contrast: 1.05, saturation: 1.2, hue: 12 }) // 颜色选项
wp.setDisplay({ flipH: true }) // 翻转
wp.setPlaybackRate(1.5) // 播放速度
wp.setVolume(0.4) // 音量
wp.pushPointer(0.5, 0.5) // 指针(归一化坐标)
说明:上表中标 需实现 的 API 是本页下一步要接的键名(写成文档先定契约, 实现后本页会把状态改成「已实现」并补一条门禁)。WE 自带项不需要我们写任何代码。
Three sources, kept apart: WE built-in (nothing for us to implement),
implemented here (the API you can call today), to implement
(agreed key names and the hook point). The toggles in “Settings 1” are this page's implementation surface; the items in
“Wallpaper parameters” come from the wallpaper's own project.json.
| Name in WE | WE's internal key (measured from this machine's ui_zh-chs.json) | How this page changes it | Status |
|---|---|---|---|
| Flip (horizontal) | ui_browse_properties_alignment_flip_horizontally | Whole output transform: scaleX(-1): __wp.setDisplay({flipH:true}) / ?fliph=1 | to implement |
| Alignment / zoom | ui_browse_properties_alignment · …_alignment_zoom | Implemented: toolbar “Resolution / fit” (#fit) and ?fit=cover|contain|stretch; zoom follows project.json → general.zoom and camera-layer zoom | implemented |
| Playback rate 0.5–2× | ui_browse_properties_playback_rate | Global time multiplier: __wp.setPlaybackRate(1.5) / ?rate=1.5 (multiplies animation dt and video.playbackRate) | to implement |
| Show colour options (master) | ui_browse_properties_show_color_options | When off, the four below are excluded from the filter chain: __wp.setDisplay({colorOptions:false}) | to implement |
| Brightness / contrast / saturation / hue shift | …_brightness · …_contrast · …_saturation · …_hue_shift | One CSS filter on the render output: brightness() contrast() saturate() hue-rotate(); __wp.setDisplay({brightness:1.1,contrast:1.05,saturation:1.2,hue:15}), query ?bright=…&contrast=…&satur=…&hue=…. Same approach the DSH plugin already uses (CSS filter — see its “screen brightness” section) | to implement |
| Volume / mute | ui_browse_monitors_mute · WE global volume | Implemented: toolbar “Volume” slider #volume; in-page __wp.setVolume(0.5) | implemented |
| React to motion (parallax / gyroscope) | ui_browse_properties_parallax | Not doing (no gyroscope); the pointer channel __wp.pushPointer(x,y) already exists if wanted later | N/A |
| Recording (WE recorder / recording volume) | ui_settings_hotkeys_action_recording · ui_settings_recording_volume | Owned by the WE client; not implemented in-page (system/browser recording is the alternative) | built-in |
project.json → general.properties)| Item | How to change it | Status |
|---|---|---|
| Slider / checkbox / colour / combo / text / group / condition-hidden | The left “Wallpaper parameters” panel; URL form ?props=name:value,… (the local backend persists it) | implemented |
| Particle / animation / text layer overrides | Same-name items in the properties panel | implemented |
| Parameter | API / control |
|---|---|
| Logical resolution / fit / DPR | #resolution · #fit · #dpr; query ?res=1920x1080&fit=cover&dpr=1 |
| FPS cap | #fps (uncapped = follow the display) |
| Live system (title / spectrum) | #live-system; the local backend reads media-control, the spectrum comes from the microphone |
| Pointer injection / mouse trail | #pointer-push · #trail-on; coordinate channel __wp.pushPointer(x,y) |
| Quality tiers / AA / filter | ?q=low|mid|high · ?aa=fxaa|msaa4 · #fx |
// Browser console (pick a wallpaper first and wait for __wp)
const wp = document.querySelector('#frame').contentWindow.__wp
wp.setDisplay({ brightness: 1.15, contrast: 1.05, saturation: 1.2, hue: 12 })
wp.setDisplay({ flipH: true })
wp.setPlaybackRate(1.5)
wp.setVolume(0.4)
wp.pushPointer(0.5, 0.5)
Rows marked to implement are the key names this page will wire next (documented first as a contract; when implemented the status flips to “implemented” and a gate covers it). Wallpaper Engine's own options need no code from us.