Open andretchen0 opened 3 months ago
In this <template /> ...
<template />
<template> <TresCanvas> <TresMesh> ... <MyMaterial :prop="myProp" /> </TresMesh> </TresCanvas> </template>
... if changing :prop changes the material :key:
:prop
:key
Changing the :prop again leads to:
Working on updating MeshReflectionMaterial from Cientos. It's based on this Drei component.
MeshReflectionMaterial
Both components use the key prop to force a rerender/recompile. Drei | Cientos
key
Using the key to force rerendering/recompiling currently doesn't work in the Cientos component.
Rerendering/recompiling the material's shader is required here for full reactivity.
https://stackblitz.com/edit/tresjs-basic-a7wxyh?file=src%2Fcomponents%2FTheExperience.vue
See Stackblitz.
all platforms
npm
Expected
In this
<template />
...... if changing
:prop
changes the material:key
:Bug
What happens instead
Changing the
:prop
again leads to:Context
Working on updating
MeshReflectionMaterial
from Cientos. It's based on this Drei component.Both components use the
key
prop to force a rerender/recompile. Drei | CientosUsing the
key
to force rerendering/recompiling currently doesn't work in the Cientos component.Rerendering/recompiling the material's shader is required here for full reactivity.
Reproduction
https://stackblitz.com/edit/tresjs-basic-a7wxyh?file=src%2Fcomponents%2FTheExperience.vue
Steps to reproduce
See Stackblitz.
System Info
Used Package Manager
npm
Code of Conduct