Skip to content
This repository was archived by the owner on Feb 1, 2026. It is now read-only.

Commit 3c1640e

Browse files
authored
fix: typescript issues (#624)
* fix: update Stats component to use onRender instead of onAfterRender - Replaced the `onAfterRender` hook with `onRender` in the Stats component to align with the updated rendering lifecycle. - This change ensures that the stats rendering ends at the correct point in the render cycle, improving performance and accuracy. * fix: update useIntersect to use onRender instead of onAfterRender - Replaced the `onAfterRender` hook with `onRender` in the `useIntersect` function to align with the updated rendering lifecycle. - This change ensures that intersection checks occur at the correct point in the render cycle, improving performance and accuracy. * fix: update ContactShadows component to use TresRenderer for improved type safety - Replaced instances of `WebGLRenderer` with `TresRenderer` in the `ContactShadows.vue` component to enhance type safety and align with the TresJS framework. - Updated the `update` and `blurShadow` functions to accept the new renderer type, ensuring compatibility with the latest rendering lifecycle. - Added a `toValue` conversion for the `scene` parameter in the `update` function to maintain reactivity and proper scene handling. * fix: remove unused type import in ContactShadows.vue - Removed the unused import of `WebGLRenderer` from `ContactShadows.vue` to enhance code clarity and maintainability. - This change aligns with the ongoing effort to streamline type imports and improve type safety across the codebase. * fix: update model traversal to use Three.js Mesh for improved type safety - Replaced the type import of `TresObject` with `Mesh` from Three.js in both `useFBX` and `useGLTF` components to enhance type safety and align with Three.js standards. - Updated model traversal logic to utilize `instanceof Mesh` for better type checking, ensuring that shadow properties are correctly applied to mesh objects. * fix: improve object addition in EnvironmentScene for better type handling - Updated the `add` method in `EnvironmentScene` to iterate over objects and add them individually to `virtualScene`, enhancing type safety and clarity. - Added a TypeScript error suppression comment to address a type error encountered during the update. * fix: update type definitions for @types/node and @types/three - Upgraded `@types/node` from `22.10.5` to `24.0.3` and `@types/three` from `0.176.0` to `0.177.0` in `package.json` to ensure compatibility with the latest TypeScript features and improvements. - Updated `pnpm-lock.yaml` to reflect these changes, ensuring all dependencies are aligned with the new type definitions. * fix: enhance type definitions in Align component for improved type safety - Updated the type definition for the `parent` property in the `AlignCallbackOptions` interface to use `Object3D<Object3DEventMap>` for better type accuracy. - Changed the type of the `container` property to `Group` to align with Three.js standards. - Adjusted the `emit` call in the `update` function to cast `parent` as `Object3D<Object3DEventMap>`, ensuring type safety during event handling. * fix: update StatsGl component to use onRender for improved rendering lifecycle - Replaced the `onAfterRender` hook with `onRender` in the `StatsGl` component to align with the updated rendering lifecycle. - This change ensures that the stats update occurs at the correct point in the render cycle, enhancing performance and accuracy. * fix: refactor MeshReflectionMaterial to improve rendering lifecycle and type safety - Replaced the custom `onBeforeRender` function with the `onBeforeRender` from `useLoop` for better integration with the rendering lifecycle. - Enhanced type safety by ensuring the correct types are used for `renderer`, `scene`, and `camera`. - Removed redundant code related to rendering logic, streamlining the component and improving maintainability. - Added warnings for unsupported WebGPURenderer to inform users of limitations. - Updated texture matrix and projection matrix calculations to ensure accurate rendering behavior. * fix: enhance type safety in LOD component by updating Object3D type - Updated the import statement to include `Object3DEventMap` for improved type accuracy. - Modified the `levels` array and `object` assignment to use `Object3D<Object3DEventMap>`, ensuring better type handling and alignment with Three.js standards. * fix: enhance type safety and streamline imports in MeshReflectionMaterial and BakeShadows - Removed unused imports of `Object3D` and `Scene` in `MeshReflectionMaterial` to improve code clarity. - Updated the `BakeShadows` component to conditionally set shadow map properties only if the renderer is an instance of `WebGLRenderer`, enhancing type safety and preventing potential runtime errors. * fix: update @Tresjs/core dependency to a specific version URL for improved stability - Changed the dependency for `@Tresjs/core` from version `5.0.0-next.4` to a specific URL `https://pkg.pr.new/@tresjs/core@bb01f3d` in both `package.json` and `playground/vue/package.json` to ensure consistent behavior across environments. - Updated `pnpm-lock.yaml` to reflect the new dependency URL, maintaining alignment with the updated package structure. - Enhanced type safety in various components by refining type imports and ensuring correct usage of `Object3D<Object3DEventMap>` where applicable. * fix: update @Tresjs/core dependency to a stable version - Changed the dependency for `@Tresjs/core` from a specific URL to version `5.0.0-next.5` in both `package.json` and `pnpm-lock.yaml` to ensure consistent behavior and stability across environments. - Updated the lock file to reflect the new version, maintaining alignment with the updated package structure.
1 parent 8c3d55d commit 3c1640e

File tree

18 files changed

+323
-289
lines changed

18 files changed

+323
-289
lines changed

package.json

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,7 @@
5050
"build": "vite build",
5151
"release": "release-it",
5252
"lint": "eslint .",
53+
"typecheck": "vue-tsc --noEmit",
5354
"lint:fix": "eslint . --fix",
5455
"docs:dev": "vitepress dev docs",
5556
"docs:build": "vitepress build docs",
@@ -70,10 +71,10 @@
7071
},
7172
"devDependencies": {
7273
"@release-it/conventional-changelog": "^10.0.1",
73-
"@tresjs/core": "5.0.0-next.2",
74+
"@tresjs/core": "5.0.0-next.5",
7475
"@tresjs/eslint-config": "^1.4.0",
75-
"@types/node": "^22.10.5",
76-
"@types/three": "^0.176.0",
76+
"@types/node": "^24.0.3",
77+
"@types/three": "^0.177.0",
7778
"@typescript-eslint/eslint-plugin": "^8.19.0",
7879
"@typescript-eslint/parser": "^8.19.0",
7980
"@vitejs/plugin-vue": "^5.2.4",

playground/vue/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
"preview": "vite preview"
1010
},
1111
"dependencies": {
12-
"@tresjs/core": "5.0.0-next.2",
12+
"@tresjs/core": "https://pkg.pr.new/@tresjs/core@bb01f3d",
1313
"vue-router": "^4.5.0"
1414
},
1515
"devDependencies": {

pnpm-lock.yaml

Lines changed: 171 additions & 153 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/core/abstractions/ScreenSizer.vue

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,8 @@ const size = computed(() => ({ width: sizes.width.value, height: sizes.height.va
1313
1414
useLoop().onBeforeRender(({ camera }) => {
1515
const obj = innerRef.value
16-
if (!obj) { return }
17-
const sf = calculateScaleFactor(obj.getWorldPosition(worldPos), 1, camera, size.value)
16+
if (!obj || !camera.value) { return }
17+
const sf = calculateScaleFactor(obj.getWorldPosition(worldPos), 1, camera.value, size.value)
1818
obj.scale.setScalar(sf)
1919
})
2020

src/core/abstractions/useSurfaceSampler/index.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ import {
66
} from 'three'
77
import { MeshSurfaceSampler } from 'three-stdlib'
88
import { ref } from 'vue'
9-
import type { InstancedMesh, Mesh } from 'three'
9+
import type { InstancedMesh, Mesh, Object3DEventMap } from 'three'
1010

1111
export interface useSurfaceSamplerProps {
1212
/*
@@ -67,7 +67,7 @@ type TransformPayload = SamplePayload & {
6767
* This object's matrix will be updated after transforming & it will be used
6868
* to set the instance's matrix.
6969
*/
70-
dummy: Object3D
70+
dummy: Object3D<Object3DEventMap>
7171
/**
7272
* The mesh that's initially passed to the sampler.
7373
* Use this if you need to apply transforms from your mesh to your instances
@@ -101,7 +101,7 @@ export const useSurfaceSampler = (
101101
const position = new Vector3()
102102
const normal = new Vector3()
103103
const color = new Color()
104-
const dummy = new Object3D()
104+
const dummy = new Object3D<Object3DEventMap>()
105105

106106
mesh.updateMatrixWorld(true)
107107

src/core/loaders/useFBX/component.vue

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<script setup lang="ts">
22
import { ref } from 'vue'
3-
import type { TresObject } from '@tresjs/core'
3+
import { Mesh } from 'three'
44
import { useFBX } from '.'
55
66
export interface FBXModelProps {
@@ -52,8 +52,8 @@ defineExpose({
5252
const model = await useFBX(props.path as string)
5353
5454
if (props.castShadow || props.receiveShadow) {
55-
model.traverse((child: TresObject) => {
56-
if (child.isMesh) {
55+
model.traverse((child) => {
56+
if (child instanceof Mesh) {
5757
child.castShadow = props.castShadow
5858
child.receiveShadow = props.receiveShadow
5959
}

src/core/loaders/useGLTF/component.vue

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<script setup lang="ts">
22
import { watch } from 'vue'
3-
import type { TresObject } from '@tresjs/core'
3+
import { type Group, Mesh } from 'three'
44
import { useGLTF } from '.'
55
66
export interface GLTFModelProps {
@@ -77,14 +77,14 @@ const { state, isLoading } = useGLTF(props.path as string, {
7777
decoderPath: props.decoderPath,
7878
})
7979
80-
let modelObject: TresObject | null = null
80+
let modelObject: Group | null = null
8181
8282
watch(state, (newVal) => {
8383
if (newVal?.scene) {
8484
modelObject = newVal.scene
85-
if (props.castShadow || props.receiveShadow) {
86-
modelObject.traverse((child: TresObject) => {
87-
if (child.isMesh) {
85+
if ((props.castShadow || props.receiveShadow) && modelObject) {
86+
modelObject.traverse((child) => {
87+
if (child instanceof Mesh) {
8888
child.castShadow = props.castShadow
8989
child.receiveShadow = props.receiveShadow
9090
}

src/core/loaders/useGLTF/index.ts

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import type { TresLoader, TresLoaderOptions } from '@tresjs/core'
1+
import type { TresLoader, TresLoaderOptions, TresObject } from '@tresjs/core'
22
import { buildGraph, useLoader } from '@tresjs/core'
33

44
import { computed, type MaybeRef } from 'vue'
@@ -51,13 +51,12 @@ export function useGLTF(path: MaybeRef<string>, options?: UseGLTFOptions) {
5151
}
5252

5353
const result = useLoader(GLTFLoader, path, useLoaderOptions)
54-
5554
const nodes = computed(() => {
56-
return result.state.value?.scene ? buildGraph(result.state.value?.scene).nodes : {}
55+
return result.state.value?.scene ? buildGraph(result.state.value?.scene as unknown as TresObject).nodes : {}
5756
})
5857

5958
const materials = computed(() => {
60-
return result.state.value?.scene ? buildGraph(result.state.value?.scene).materials : {}
59+
return result.state.value?.scene ? buildGraph(result.state.value?.scene as unknown as TresObject).materials : {}
6160
})
6261

6362
return {

src/core/materials/meshReflectionMaterial/index.vue

Lines changed: 96 additions & 92 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
11
<!-- eslint-disable vue/attribute-hyphenation -->
22
<script setup lang="ts">
33
import { logWarning, useLoop, useTres } from '@tresjs/core'
4+
import type {
5+
Texture,
6+
} from 'three'
47
import {
58
Color,
69
DepthTexture,
@@ -14,19 +17,14 @@ import {
1417
Vector2,
1518
Vector3,
1619
Vector4,
20+
WebGLRenderer,
1721
WebGLRenderTarget,
1822
} from 'three'
19-
import { computed, onBeforeUnmount, shallowRef, watch } from 'vue'
23+
import { computed, onBeforeUnmount, shallowRef, toValue, watch } from 'vue'
2024
import type { TresColor } from '@tresjs/core'
21-
import type {
22-
Camera,
23-
Object3D,
24-
Scene,
25-
Texture,
26-
WebGLRenderer,
27-
} from 'three'
2825
import { BlurPass } from './BlurPass'
2926
import { MeshReflectionMaterial } from './material'
27+
import { WebGPURenderer } from 'three/webgpu'
3028
3129
export interface MeshReflectionMaterialProps {
3230
@@ -204,87 +202,6 @@ const fboBlur = new WebGLRenderTarget(
204202
},
205203
)
206204
207-
function onBeforeRender(renderer: WebGLRenderer, scene: Scene, camera: Camera, object: Object3D) {
208-
invalidate()
209-
210-
const currentXrEnabled = renderer.xr.enabled
211-
const currentShadowAutoUpdate = renderer.shadowMap.autoUpdate
212-
213-
state.reflectorWorldPosition.setFromMatrixPosition(object.matrixWorld)
214-
state.cameraWorldPosition.setFromMatrixPosition(camera.matrixWorld as Matrix4)
215-
state.rotationMatrix.extractRotation(object.matrixWorld)
216-
state.normal.set(0, 0, 1)
217-
state.normal.applyMatrix4(state.rotationMatrix)
218-
state.reflectorWorldPosition.addScaledVector(state.normal, props.reflectorOffset)
219-
state.view.subVectors(state.reflectorWorldPosition, state.cameraWorldPosition)
220-
221-
// NOTE: Avoid rendering when reflector is facing away
222-
if (state.view.dot(state.normal) > 0) { return }
223-
224-
// NOTE: Avoid re-rendering the reflective object.
225-
object.visible = false
226-
227-
state.view.reflect(state.normal).negate()
228-
state.view.add(state.reflectorWorldPosition)
229-
state.rotationMatrix.extractRotation(camera.matrixWorld as Matrix4)
230-
state.lookAtPosition.set(0, 0, -1)
231-
state.lookAtPosition.applyMatrix4(state.rotationMatrix)
232-
state.lookAtPosition.add(state.cameraWorldPosition)
233-
state.target.subVectors(state.reflectorWorldPosition, state.lookAtPosition)
234-
state.target.reflect(state.normal).negate()
235-
state.target.add(state.reflectorWorldPosition)
236-
state.virtualCamera.position.copy(state.view)
237-
state.virtualCamera.up.set(0, 1, 0)
238-
state.virtualCamera.up.applyMatrix4(state.rotationMatrix)
239-
state.virtualCamera.up.reflect(state.normal)
240-
state.virtualCamera.lookAt(state.target)
241-
state.virtualCamera.far = (camera as PerspectiveCamera).far
242-
state.virtualCamera.updateMatrixWorld()
243-
state.virtualCamera.projectionMatrix.copy((camera as PerspectiveCamera).projectionMatrix)
244-
245-
// NOTE: Update the texture matrix
246-
state.textureMatrix.set(0.5, 0.0, 0.0, 0.5, 0.0, 0.5, 0.0, 0.5, 0.0, 0.0, 0.5, 0.5, 0.0, 0.0, 0.0, 1.0)
247-
state.textureMatrix.multiply(state.virtualCamera.projectionMatrix)
248-
state.textureMatrix.multiply(state.virtualCamera.matrixWorldInverse)
249-
state.textureMatrix.multiply(object.matrixWorld)
250-
251-
// NOTE: Now update projection matrix with new clip reflectorPlane, implementing code from: http://www.terathon.com/code/oblique.html
252-
// Paper explaining this technique: http://www.terathon.com/lengyel/Lengyel-Oblique.pdf
253-
state.reflectorPlane.setFromNormalAndCoplanarPoint(state.normal, state.reflectorWorldPosition)
254-
state.reflectorPlane.applyMatrix4(state.virtualCamera.matrixWorldInverse)
255-
state.clipPlane.set(
256-
state.reflectorPlane.normal.x,
257-
state.reflectorPlane.normal.y,
258-
state.reflectorPlane.normal.z,
259-
state.reflectorPlane.constant,
260-
)
261-
const projectionMatrix = state.virtualCamera.projectionMatrix
262-
state.q.x = (Math.sign(state.clipPlane.x) + projectionMatrix.elements[8]) / projectionMatrix.elements[0]
263-
state.q.y = (Math.sign(state.clipPlane.y) + projectionMatrix.elements[9]) / projectionMatrix.elements[5]
264-
state.q.z = -1.0
265-
state.q.w = (1.0 + projectionMatrix.elements[10]) / projectionMatrix.elements[14]
266-
// NOTE: Calculate the scaled reflectorPlane vector
267-
state.clipPlane.multiplyScalar(2.0 / state.clipPlane.dot(state.q))
268-
// NOTE: Replacing the third row of the projection matrix
269-
projectionMatrix.elements[2] = state.clipPlane.x
270-
projectionMatrix.elements[6] = state.clipPlane.y
271-
projectionMatrix.elements[10] = state.clipPlane.z + 1.0
272-
projectionMatrix.elements[14] = state.clipPlane.w
273-
274-
renderer.shadowMap.autoUpdate = false
275-
renderer.setRenderTarget(fboSharp)
276-
if (!renderer.autoClear) { renderer.clear() }
277-
278-
renderer.render(scene, state.virtualCamera)
279-
blurpass.render(renderer, fboSharp, fboBlur)
280-
281-
// NOTE: Restore the previous render target and material
282-
renderer.xr.enabled = currentXrEnabled
283-
renderer.shadowMap.autoUpdate = currentShadowAutoUpdate
284-
object.visible = true
285-
renderer.setRenderTarget(null)
286-
}
287-
288205
watch(
289206
() => [props.resolution],
290207
() => {
@@ -360,12 +277,99 @@ onBeforeUnmount(() => {
360277
fboBlur.dispose()
361278
blurpass.dispose()
362279
})
280+
const { onBeforeRender } = useLoop()
363281
364-
useLoop().onBeforeRender(({ renderer, scene, camera }) => {
282+
onBeforeRender(({ renderer, scene, camera }) => {
365283
const parent = (materialRef.value as any)?.__tres?.parent
366284
if (!parent) { return }
367-
onBeforeRender(renderer, scene, camera, parent)
368-
invalidate()
285+
if (renderer instanceof WebGPURenderer) {
286+
console.warn('MeshReflectionMaterial: WebGPURenderer is not supported yet')
287+
return
288+
}
289+
if (renderer instanceof WebGLRenderer) {
290+
invalidate()
291+
292+
const currentXrEnabled = renderer.xr.enabled
293+
const currentShadowAutoUpdate = renderer.shadowMap.autoUpdate
294+
295+
state.reflectorWorldPosition.setFromMatrixPosition(parent.matrixWorld)
296+
state.cameraWorldPosition.setFromMatrixPosition(camera.value?.matrixWorld as Matrix4)
297+
state.rotationMatrix.extractRotation(parent.matrixWorld)
298+
state.normal.set(0, 0, 1)
299+
state.normal.applyMatrix4(state.rotationMatrix)
300+
state.reflectorWorldPosition.addScaledVector(state.normal, props.reflectorOffset)
301+
state.view.subVectors(state.reflectorWorldPosition, state.cameraWorldPosition)
302+
303+
// NOTE: Avoid rendering when reflector is facing away
304+
if (state.view.dot(state.normal) > 0) { return }
305+
306+
// NOTE: Avoid re-rendering the reflective object.
307+
parent.visible = false
308+
309+
state.view.reflect(state.normal).negate()
310+
state.view.add(state.reflectorWorldPosition)
311+
state.rotationMatrix.extractRotation(camera.value?.matrixWorld as Matrix4)
312+
state.lookAtPosition.set(0, 0, -1)
313+
state.lookAtPosition.applyMatrix4(state.rotationMatrix)
314+
state.lookAtPosition.add(state.cameraWorldPosition)
315+
state.target.subVectors(state.reflectorWorldPosition, state.lookAtPosition)
316+
state.target.reflect(state.normal).negate()
317+
state.target.add(state.reflectorWorldPosition)
318+
state.virtualCamera.position.copy(state.view)
319+
state.virtualCamera.up.set(0, 1, 0)
320+
state.virtualCamera.up.applyMatrix4(state.rotationMatrix)
321+
state.virtualCamera.up.reflect(state.normal)
322+
state.virtualCamera.lookAt(state.target)
323+
state.virtualCamera.far = (camera.value as PerspectiveCamera).far
324+
state.virtualCamera.updateMatrixWorld()
325+
state.virtualCamera.far = (camera.value as PerspectiveCamera).far
326+
state.virtualCamera.projectionMatrix.copy((camera.value as PerspectiveCamera).projectionMatrix)
327+
328+
// NOTE: Update the texture matrix
329+
state.textureMatrix.set(0.5, 0.0, 0.0, 0.5, 0.0, 0.5, 0.0, 0.5, 0.0, 0.0, 0.5, 0.5, 0.0, 0.0, 0.0, 1.0)
330+
state.textureMatrix.multiply(state.virtualCamera.projectionMatrix)
331+
state.textureMatrix.multiply(state.virtualCamera.matrixWorldInverse)
332+
state.textureMatrix.multiply(parent.matrixWorld)
333+
334+
// NOTE: Now update projection matrix with new clip reflectorPlane, implementing code from: http://www.terathon.com/code/oblique.html
335+
// Paper explaining this technique: http://www.terathon.com/lengyel/Lengyel-Oblique.pdf
336+
state.reflectorPlane.setFromNormalAndCoplanarPoint(state.normal, state.reflectorWorldPosition)
337+
state.reflectorPlane.applyMatrix4(state.virtualCamera.matrixWorldInverse)
338+
state.clipPlane.set(
339+
state.reflectorPlane.normal.x,
340+
state.reflectorPlane.normal.y,
341+
state.reflectorPlane.normal.z,
342+
state.reflectorPlane.constant,
343+
)
344+
const projectionMatrix = state.virtualCamera.projectionMatrix
345+
state.q.x = (Math.sign(state.clipPlane.x) + projectionMatrix.elements[8]) / projectionMatrix.elements[0]
346+
state.q.y = (Math.sign(state.clipPlane.y) + projectionMatrix.elements[9]) / projectionMatrix.elements[5]
347+
state.q.z = -1.0
348+
state.q.w = (1.0 + projectionMatrix.elements[10]) / projectionMatrix.elements[14]
349+
// NOTE: Calculate the scaled reflectorPlane vector
350+
state.clipPlane.multiplyScalar(2.0 / state.clipPlane.dot(state.q))
351+
// NOTE: Replacing the third row of the projection matrix
352+
projectionMatrix.elements[2] = state.clipPlane.x
353+
projectionMatrix.elements[6] = state.clipPlane.y
354+
projectionMatrix.elements[10] = state.clipPlane.z + 1.0
355+
projectionMatrix.elements[14] = state.clipPlane.w
356+
357+
renderer.shadowMap.autoUpdate = false
358+
renderer.setRenderTarget(fboSharp)
359+
if (!renderer.autoClear) { renderer.clear() }
360+
361+
renderer.render(toValue(scene), state.virtualCamera)
362+
if (renderer instanceof WebGLRenderer) {
363+
blurpass.render(renderer, fboSharp, fboBlur)
364+
}
365+
366+
// NOTE: Restore the previous render target and material
367+
renderer.xr.enabled = currentXrEnabled
368+
renderer.shadowMap.autoUpdate = currentShadowAutoUpdate
369+
parent.visible = true
370+
renderer.setRenderTarget(null)
371+
invalidate()
372+
}
369373
})
370374
defineExpose({ instance: materialRef })
371375
</script>

src/core/misc/BakeShadows.ts

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import { useTres } from '@tresjs/core'
2+
import { WebGLRenderer } from 'three'
23
import { defineComponent, watchEffect } from 'vue'
34

45
export const BakeShadows = defineComponent({
@@ -8,8 +9,10 @@ export const BakeShadows = defineComponent({
89
const { renderer } = useTres()
910

1011
watchEffect(() => {
11-
renderer.shadowMap.autoUpdate = false
12-
renderer.shadowMap.needsUpdate = true
12+
if (renderer instanceof WebGLRenderer) {
13+
renderer.shadowMap.autoUpdate = false
14+
renderer.shadowMap.needsUpdate = true
15+
}
1316
})
1417
},
1518
})

0 commit comments

Comments
 (0)