minecraft-renderer 0.1.71 → 0.1.73

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.
Files changed (65) hide show
  1. package/README.md +3 -3
  2. package/dist/mesher.js +81 -81
  3. package/dist/mesher.js.map +3 -3
  4. package/dist/mesherWasm.js +1183 -943
  5. package/dist/minecraft-renderer.js +250 -79
  6. package/dist/minecraft-renderer.js.meta.json +1 -1
  7. package/dist/threeWorker.js +1732 -1001
  8. package/package.json +3 -3
  9. package/src/graphicsBackend/rendererDefaultOptions.ts +5 -10
  10. package/src/graphicsBackend/rendererOptionsSync.ts +1 -1
  11. package/src/lib/bakeLegacyLight.ts +17 -0
  12. package/src/lib/blockEntityLightRegistry.test.ts +18 -0
  13. package/src/lib/blockEntityLightRegistry.ts +75 -0
  14. package/src/lib/blockEntityLighting.test.ts +30 -0
  15. package/src/lib/blockEntityLighting.ts +53 -0
  16. package/src/lib/worldrendererCommon.reconfigure.test.ts +202 -0
  17. package/src/lib/worldrendererCommon.ts +152 -22
  18. package/src/mesher-shared/blockEntityMetadata.test.ts +33 -0
  19. package/src/mesher-shared/blockEntityMetadata.ts +19 -3
  20. package/src/mesher-shared/exportedGeometryTypes.ts +11 -0
  21. package/src/mesher-shared/models.ts +161 -92
  22. package/src/mesher-shared/shared.ts +15 -4
  23. package/src/mesher-shared/tests/liquidQuadInvariant.test.ts +40 -0
  24. package/src/mesher-shared/world.ts +12 -0
  25. package/src/mesher-shared/worldLighting.test.ts +54 -0
  26. package/src/playground/baseScene.ts +1 -1
  27. package/src/three/bannerRenderer.ts +10 -3
  28. package/src/three/chunkMeshManager.ts +663 -69
  29. package/src/three/cubeDrawSpans.ts +74 -0
  30. package/src/three/cubeMultiDraw.ts +119 -0
  31. package/src/three/documentRenderer.ts +0 -2
  32. package/src/three/entities.ts +5 -6
  33. package/src/three/entity/EntityMesh.ts +7 -5
  34. package/src/three/entity/gltfAnimationUtils.ts +5 -3
  35. package/src/three/globalBlockBuffer.ts +208 -12
  36. package/src/three/globalLegacyBuffer.ts +701 -0
  37. package/src/three/graphicsBackendOffThread.ts +16 -1
  38. package/src/three/itemMesh.ts +5 -2
  39. package/src/three/legacySectionCull.ts +85 -0
  40. package/src/three/modules/sciFiWorldReveal.ts +347 -703
  41. package/src/three/modules/starfield.ts +3 -2
  42. package/src/three/sectionRaycastAabb.ts +25 -0
  43. package/src/three/shaders/cubeBlockShader.ts +80 -17
  44. package/src/three/shaders/legacyBlockShader.ts +292 -0
  45. package/src/three/skyboxRenderer.ts +1 -1
  46. package/src/three/tests/chunkMeshManagerLegacy.test.ts +286 -0
  47. package/src/three/tests/cubeDrawSpans.test.ts +73 -0
  48. package/src/three/tests/globalLegacyBuffer.test.ts +360 -0
  49. package/src/three/tests/legacySectionCull.test.ts +80 -0
  50. package/src/three/tests/signTextureCache.test.ts +83 -0
  51. package/src/three/threeJsMedia.ts +2 -2
  52. package/src/three/waypointSprite.ts +2 -2
  53. package/src/three/world/cursorBlock.ts +1 -0
  54. package/src/three/world/vr.ts +2 -2
  55. package/src/three/worldGeometryExport.ts +83 -26
  56. package/src/three/worldRendererThree.ts +94 -25
  57. package/src/wasm-mesher/bridge/render-from-wasm.ts +214 -72
  58. package/src/wasm-mesher/bridge/shaderCubeBridge.ts +18 -6
  59. package/src/wasm-mesher/runtime-build/wasm_mesher_bg.wasm +0 -0
  60. package/src/wasm-mesher/tests/sectionRaycastAabb.test.ts +20 -0
  61. package/src/wasm-mesher/tests/shaderCubeInstances.test.ts +67 -5
  62. package/src/wasm-mesher/worker/mesherWasm.ts +70 -14
  63. package/src/wasm-mesher/worker/mesherWasmLightDirty.test.ts +11 -0
  64. package/src/wasm-mesher/worker/mesherWasmLightDirty.ts +15 -0
  65. package/src/worldView/worldView.ts +11 -0
package/README.md CHANGED
@@ -99,8 +99,8 @@ Renderer-owned options live in `RENDERER_DEFAULT_OPTIONS` and `RENDERER_OPTIONS_
99
99
  | Change | Live update | Reload required |
100
100
  |--------|-------------|-----------------|
101
101
  | Menu V2 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 |
102
+ | `rendererMesher` (`wasm` / `legacy-js`) | Yes recreates mesher workers | Chunks reload (`requiresChunksReload`) |
103
+ | `rendererWorldPerformance` | Yes recreates mesher workers | Chunks reload (`requiresChunksReload`) |
104
104
  | Volume | App `watchValue` only | No |
105
105
 
106
106
  Sync runs on the **main thread** only; `inWorldRenderingConfig` uses existing valtio `__syncToWorker` for off-thread backends. Do not call `subscribeRendererOptions` from mesher workers.
@@ -170,7 +170,7 @@ const blockLight = chunk.getBlockLight(pos)
170
170
  const skyLight = chunk.getSkyLight(pos)
171
171
 
172
172
  // Combined light level
173
- const light = Math.max(blockLight, skyLight * skyLightMultiplier)
173
+ const light = Math.max(blockLight, Math.min(skyLight, skyLightCap))
174
174
 
175
175
  // Light level to color multiplier
176
176
  const brightness = lightLevelToBrightness[light]