Skip to content

Commit a7d0825

Browse files
authored
fix: disable frustum culling for SkinnedMesh to prevent clipping during animation (#7856)
## Summary SkinnedMesh bounding box is computed at rest pose and doesn't update during animation, causing incorrect frustum culling when bones move outside the original bounds. fix #7847 ## Screenshots before <img width="396" height="520" alt="image" src="https://github.com/user-attachments/assets/d2c854b5-c859-4664-9e0e-11c83775b3e7" /> after <img width="949" height="656" alt="image" src="https://github.com/user-attachments/assets/ce93d04f-1562-429f-8f2c-cb5c0ea404ae" /> ┆Issue is synchronized with this [Notion page](https://www.notion.so/PR-7856-fix-disable-frustum-culling-for-SkinnedMesh-to-prevent-clipping-during-animation-2e06d73d365081d8b585e9e4afa52d67) by [Unito](https://www.unito.io)
1 parent 10feb1f commit a7d0825

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

src/extensions/core/load3d/LoaderManager.ts

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -166,6 +166,10 @@ export class LoaderManager implements LoaderManagerInterface {
166166
fbxModel.traverse((child) => {
167167
if (child instanceof THREE.Mesh) {
168168
this.modelManager.originalMaterials.set(child, child.material)
169+
170+
if (child instanceof THREE.SkinnedMesh) {
171+
child.frustumCulled = false
172+
}
169173
}
170174
})
171175
break
@@ -212,6 +216,10 @@ export class LoaderManager implements LoaderManagerInterface {
212216
if (child instanceof THREE.Mesh) {
213217
child.geometry.computeVertexNormals()
214218
this.modelManager.originalMaterials.set(child, child.material)
219+
220+
if (child instanceof THREE.SkinnedMesh) {
221+
child.frustumCulled = false
222+
}
215223
}
216224
})
217225
break

0 commit comments

Comments
 (0)