minecraft-renderer 0.1.45 → 0.1.47
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +22 -0
- package/dist/mesher.js +17 -17
- package/dist/mesher.js.map +4 -4
- package/dist/mesherWasm.js +18 -18
- package/dist/minecraft-renderer.js +54 -54
- package/dist/minecraft-renderer.js.meta.json +1 -1
- package/dist/threeWorker.js +389 -389
- package/package.json +1 -1
- package/src/graphicsBackend/appViewer.ts +10 -0
- package/src/graphicsBackend/config.ts +2 -1
- package/src/graphicsBackend/index.ts +2 -0
- package/src/graphicsBackend/rendererOptionsSync.ts +243 -0
- package/src/graphicsBackend/types.ts +9 -1
- package/src/mesher-shared/blockPropertiesForMeshing.ts +79 -0
- package/src/mesher-shared/exportedGeometryTypes.ts +26 -0
- package/src/mesher-shared/models.ts +3 -79
- package/src/performanceMonitor/PerformanceMonitor.ts +77 -0
- package/src/performanceMonitor/constants.ts +24 -0
- package/src/performanceMonitor/formatPerformanceFactorsDebug.ts +16 -0
- package/src/performanceMonitor/index.ts +10 -0
- package/src/performanceMonitor/types.ts +27 -0
- package/src/three/documentRenderer.ts +5 -9
- package/src/three/graphicsBackendBase.ts +1 -2
- package/src/three/menuBackground/defaultOptions.ts +188 -30
- package/src/three/menuBackground/index.ts +10 -2
- package/src/three/worldGeometryExport.ts +3 -24
- package/src/three/worldRendererThree.ts +19 -1
- package/src/wasm-mesher/bridge/render-from-wasm.ts +5 -10
package/README.md
CHANGED
|
@@ -83,6 +83,28 @@ await viewer.startWorld(worldProvider, renderDistance)
|
|
|
83
83
|
viewer.updateCamera(position, yaw, pitch)
|
|
84
84
|
```
|
|
85
85
|
|
|
86
|
+
### Settings flow (app integration)
|
|
87
|
+
|
|
88
|
+
Renderer-owned options live in `RENDERER_DEFAULT_OPTIONS` and `RENDERER_OPTIONS_META` (`src/three/menuBackground/defaultOptions.ts`).
|
|
89
|
+
|
|
90
|
+
1. **Defaults** — spread `RENDERER_DEFAULT_OPTIONS` into your app options store (e.g. valtio `options`).
|
|
91
|
+
2. **Migration** — call `migrateRendererOptions(saved)` when loading persisted settings (legacy mesher/GPU keys → current renderer option names).
|
|
92
|
+
3. **Settings UI** — merge `RENDERER_OPTIONS_META` into your options meta; layout can stay app-owned.
|
|
93
|
+
4. **Menu startup** — `startMenuBackground(menuBackgroundOptionsFromStorage(options))`.
|
|
94
|
+
5. **Runtime sync** — after `AppViewer` + backend init, call once:
|
|
95
|
+
`subscribeRendererOptions(appViewer, options, { isSafari, isCypress, onRegisterFocusHandlers })`.
|
|
96
|
+
This updates `inWorldRenderingConfig`, `appViewer.config` (FPS/stats), and live menu-background controls when `currentDisplay === 'menu'`.
|
|
97
|
+
6. **App-only** — keep `volume` and bot/world hooks in the client (`applyRendererEnableLighting`, `applyRendererWorldViewOptions`, weather).
|
|
98
|
+
|
|
99
|
+
| Change | Live update | Reload required |
|
|
100
|
+
|--------|-------------|-----------------|
|
|
101
|
+
| Menu futuristic scene / camera / speeds | Yes (`backend.getMenuBackground`) | Mode switch needs restart |
|
|
102
|
+
| `rendererMesher` (`wasm` / `legacy-js`) | Proxy flag syncs | Yes — mesher worker script swap |
|
|
103
|
+
| `rendererWorldPerformance` | Config syncs | Yes — worker count |
|
|
104
|
+
| Volume | App `watchValue` only | No |
|
|
105
|
+
|
|
106
|
+
Sync runs on the **main thread** only; `inWorldRenderingConfig` uses existing valtio `__syncToWorker` for off-thread backends. Do not call `subscribeRendererOptions` from mesher workers.
|
|
107
|
+
|
|
86
108
|
## How Block Rendering Works
|
|
87
109
|
|
|
88
110
|
### 1. Chunk Data Flow
|