minecraft-renderer 0.1.33 → 0.1.35
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/dist/minecraft-renderer.js +56 -56
- package/dist/minecraft-renderer.js.meta.json +1 -1
- package/dist/threeWorker.js +422 -422
- package/package.json +1 -1
- package/src/graphicsBackend/config.ts +2 -1
- package/src/lib/worldrendererCommon.ts +2 -0
- package/src/playground/scenes/main.ts +1 -1
- package/src/three/chunkMeshManager.ts +808 -0
- package/src/three/entities.ts +42 -36
- package/src/three/graphicsBackendBase.ts +9 -1
- package/src/three/modules/blockBreakParticles.ts +438 -0
- package/src/three/modules/index.ts +2 -0
- package/src/three/modules/sciFiWorldReveal.ts +10 -21
- package/src/three/panorama.ts +1 -1
- package/src/three/worldRendererThree.ts +60 -39
- package/src/three/worldBlockGeometry.ts +0 -355
package/package.json
CHANGED
|
@@ -19,7 +19,7 @@ export const defaultWorldRendererConfig = {
|
|
|
19
19
|
|
|
20
20
|
// Debug settings
|
|
21
21
|
showChunkBorders: false,
|
|
22
|
-
enableDebugOverlay:
|
|
22
|
+
enableDebugOverlay: true,
|
|
23
23
|
debugModelVariant: undefined as undefined | number[],
|
|
24
24
|
futuristicReveal: false,
|
|
25
25
|
|
|
@@ -29,6 +29,7 @@ export const defaultWorldRendererConfig = {
|
|
|
29
29
|
addChunksBatchWaitTime: 200,
|
|
30
30
|
_experimentalSmoothChunkLoading: true,
|
|
31
31
|
_renderByChunks: false,
|
|
32
|
+
autoLowerRenderDistance: false,
|
|
32
33
|
|
|
33
34
|
// Rendering engine settings
|
|
34
35
|
dayCycle: true,
|
|
@@ -77,6 +77,7 @@ export abstract class WorldRendererCommon<WorkerSend = any, WorkerReceive = any>
|
|
|
77
77
|
enableChunksLoadDelay = false
|
|
78
78
|
texturesVersion?: string
|
|
79
79
|
viewDistance = -1
|
|
80
|
+
onRenderDistanceChanged?: (viewDistance: number) => void
|
|
80
81
|
chunksLength = 0
|
|
81
82
|
allChunksFinished = false
|
|
82
83
|
messageQueue: any[] = []
|
|
@@ -813,6 +814,7 @@ export abstract class WorldRendererCommon<WorkerSend = any, WorkerReceive = any>
|
|
|
813
814
|
this.viewDistance = d
|
|
814
815
|
this.chunksLength = d === 0 ? 1 : generateSpiralMatrix(d).length
|
|
815
816
|
this.allChunksFinished = Object.keys(this.finishedChunks).length === this.chunksLength
|
|
817
|
+
this.onRenderDistanceChanged?.(d)
|
|
816
818
|
})
|
|
817
819
|
|
|
818
820
|
worldEmitter.on('markAsLoaded', ({ x, z }) => {
|
|
@@ -219,7 +219,7 @@ class MainScene extends BasePlaygroundScene {
|
|
|
219
219
|
|
|
220
220
|
// Temporarily replace PerspectiveCamera with OrthographicCamera for block rendering
|
|
221
221
|
this.worldRenderer.camera = new THREE.OrthographicCamera(-1, 1, 1, -1, 0, 10) as any
|
|
222
|
-
this.worldRenderer.
|
|
222
|
+
this.worldRenderer.realScene.background = null
|
|
223
223
|
|
|
224
224
|
const rad = THREE.MathUtils.degToRad(-120)
|
|
225
225
|
this.worldRenderer.directionalLight.position.set(
|