You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
frustrum culling is enabled on instanced meshes by default
the bounding sphere for frustum culling is automatically computed, the first time it is needed
the key property is a new boundingSphere property on the InstancedMesh itself. The values set on this override anything set on the geometry of the InstancedMesh.
however, applications need to manually recompute this every time they add or modify an instance's position using setMatrixAt()
Up to this point, frustum culling support in this component allowed the user to manually configure a bounding sphere using the fcradius and fccenter properties.
This still works OK if an instance mesh has members at start of day.
However if an instanced mesh is empty at start of day, the boundingSphere property on the InstancedMesh gets set to an empty sphere initially, and is never updated.
A further change is that the bounding sphere specified using fcradius and fccenter will now be applied to every instance, which can give a larger overall bounding sphere than specified, if the instances are spread out.
Restoring previous function should be a fairly simple fix. When we set boundingSphere on the InstancedMesh's geometry, we also set it on the InstancedMesh itself. This should also be back-compatible with the pre-1.5.0 way of doing things.
However, it could also be good to make available the new functionality to auto-compute boundingSpheres. How to do that, while continuing to offer the old interface, needs a little more thought.
Furthermore, three.js also auto-computes a boundingBox for the InstancedMesh, but again applications need to re-compute this on each add/remove/move. This is used when an InstancedMesh is passed in to Box3.expandByObject(). Perhaps we should try to make that function work as well?
The text was updated successfully, but these errors were encountered:
From A-Frame 1.5.0, we have an issue with frustum culling due to three,js changes to how this works for Instanced Meshes.
The key change is this one:
mrdoob/three.js#25591
Key changes are that:
boundingSphere
property on theInstancedMesh
itself. The values set on this override anything set on thegeometry
of the InstancedMesh.setMatrixAt()
Up to this point, frustum culling support in this component allowed the user to manually configure a bounding sphere using the
fcradius
andfccenter
properties.This still works OK if an instance mesh has members at start of day.
However if an instanced mesh is empty at start of day, the
boundingSphere
property on theInstancedMesh
gets set to an empty sphere initially, and is never updated.A further change is that the bounding sphere specified using
fcradius
andfccenter
will now be applied to every instance, which can give a larger overall bounding sphere than specified, if the instances are spread out.Restoring previous function should be a fairly simple fix. When we set
boundingSphere
on the InstancedMesh's geometry, we also set it on the InstancedMesh itself. This should also be back-compatible with the pre-1.5.0 way of doing things.However, it could also be good to make available the new functionality to auto-compute boundingSpheres. How to do that, while continuing to offer the old interface, needs a little more thought.
Furthermore, three.js also auto-computes a boundingBox for the InstancedMesh, but again applications need to re-compute this on each add/remove/move. This is used when an InstancedMesh is passed in to
Box3.expandByObject()
. Perhaps we should try to make that function work as well?The text was updated successfully, but these errors were encountered: