Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion src/core/MeshRefractionMaterial.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -67,8 +67,9 @@ export function MeshRefractionMaterial({
const geometry = (material.current as any)?.__r3f?.parent?.object?.geometry
// Update the BVH
if (geometry) {
const geometry_ni = geometry.index ? geometry.clone().toNonIndexed() : geometry.clone()
;(material.current as any).bvh = new MeshBVHUniformStruct()
;(material.current as any).bvh.updateFrom(new MeshBVH(geometry.clone().toNonIndexed(), { strategy: SAH }))
;(material.current as any).bvh.updateFrom(new MeshBVH(geometry_ni, { strategy: SAH }))
}
}, [])

Expand Down