@@ -21,7 +21,7 @@ import {
2121 WebGLRenderTarget ,
2222} from ' three'
2323import { computed , onBeforeUnmount , shallowRef , toValue , watch } from ' vue'
24- import type { TresColor } from ' @tresjs/core'
24+ import type { TresColor , TresObject } from ' @tresjs/core'
2525import { BlurPass } from ' ./BlurPass'
2626import { MeshReflectionMaterial } from ' ./material'
2727
@@ -158,7 +158,7 @@ const hasDepth = computed(() => props.sharpDepthScale > 0 || props.blurDepthScal
158158const hasDistortion = computed (() => !! props .distortionMap )
159159const hasRoughness = computed (() => !! props .roughnessMap )
160160
161- const materialRef = shallowRef ()
161+ const materialRef = shallowRef < TresObject > ()
162162let blurpass: BlurPass
163163
164164const state = {
@@ -279,11 +279,11 @@ onBeforeUnmount(() => {
279279const { onBeforeRender } = useLoop ()
280280
281281onBeforeRender (({ renderer , scene , camera }) => {
282- const parent = ( materialRef .value as any ) ?.__tres ?.parent
282+ const parent = materialRef .value ?.__tres ?.parent
283283 if (! parent ) { return }
284284 // WebGPU compatibility: avoid importing three/webgpu (not exported in older versions).
285285 // Detect WebGPU renderer by its flag property defined in its class (`isWebGPURenderer: true`).
286- if (( renderer as any )? .isWebGPURenderer === true ) {
286+ if (' isWebGPURenderer ' in renderer && renderer .isWebGPURenderer === true ) {
287287 console .warn (' MeshReflectionMaterial: WebGPURenderer is not supported yet' )
288288 return
289289 }
0 commit comments