textures disappear on InstancedRigidBodies when moving or changing pointer
when i move around or change the pointer direction, the textures on InstancedRigidBodies vanish. it works fine with instances from drei.
"@react-three/rapier": "^1.3.1", "three": "^0.165.0", "next": "14.2.3",
https://github.com/pmndrs/react-three-rapier/assets/54137057/1f75a827-8438-4b2f-aa72-7e144ca9a7b8
any help or suggestions would be appreciated!
useEffect(() => {
meshRef.current?.computeBoundingBox()
}, [blocks])
ok so calling the method solved the issue
and computeBoundingSphere too...
on onAfterShadow
It's because of frustumCulled (this is set by default, it checks every frame if the object is in the frustum of the camera before rendering the object. If set to false the object gets rendered every frame even if it is not in the frustum of the camera.)
You either need to set boundingBox\Sphere big enough to cover possible translations of instances or set <instancedMesh frustumCulled={false}