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
The latest (v1.22.0) Cesium for Unreal generates the same BoundingBoxes for all primitives in the glTF according to the
boundingVolume in tileset.json as below image.
CurrentBoundingBox
We propose the change to calculate minimum size of BoundingBoxes for each primitive component as below image.
OurFixesBoundingBox
BoundingBoxes are calculated in the loadPrimitive function of CesiumGltfComponent.cpp. We changed this function to calculate min
and max by using the indicesView as bellow and it could generate the smallest BoundingBox for each primitive.
TRACE_CPUPROFILER_EVENT_SCOPE(Cesium::ComputeAABB)
const std::vector<double>& min = positionAccessor.min;
const std::vector<double>& max = positionAccessor.max;
glm::dvec3 minPosition{std::numeric_limits<double>::max()};
glm::dvec3 maxPosition{std::numeric_limits<double>::lowest()};
for (int32_t i = 0; i < indicesView.size(); ++i) {
const uint32 index = indicesView[i];
minPosition.x = glm::min<double>(minPosition.x, positionView[index].X);
minPosition.y = glm::min<double>(minPosition.y, positionView[index].Y);
minPosition.z = glm::min<double>(minPosition.z, positionView[index].Z);
maxPosition.x = glm::max<double>(maxPosition.x, positionView[index].X);
maxPosition.y = glm::max<double>(maxPosition.y, positionView[index].Y);
maxPosition.z = glm::max<double>(maxPosition.z, positionView[index].Z);
}
#if ENGINE_MAJOR_VERSION >= 5
To make the above enable, we remove the following line in the loadPrimitiveGameThreadPart function.
pMesh->boundingVolume = boundingVolume;
Would you consider adopting the above for BoundingBox optimization?
The text was updated successfully, but these errors were encountered:
kring
added
research
Explore an idea or prototype a concept and share the results
question
Further information is requested
and removed
research
Explore an idea or prototype a concept and share the results
labels
Jul 17, 2023
The latest (v1.22.0) Cesium for Unreal generates the same BoundingBoxes for all primitives in the glTF according to the
boundingVolume in tileset.json as below image.
CurrentBoundingBox
![CurrentBoundingBox](https://user-images.githubusercontent.com/79615787/220963361-85e2c710-078c-4510-96cb-7834bad152ee.png)
We propose the change to calculate minimum size of BoundingBoxes for each primitive component as below image.
OurFixesBoundingBox
![OurFixesBoundingBox](https://user-images.githubusercontent.com/79615787/220963396-42b70fb0-21f0-4d5d-83c6-3fc22e5f0554.png)
BoundingBoxes are calculated in the loadPrimitive function of CesiumGltfComponent.cpp. We changed this function to calculate min
and max by using the indicesView as bellow and it could generate the smallest BoundingBox for each primitive.
To make the above enable, we remove the following line in the loadPrimitiveGameThreadPart function.
Would you consider adopting the above for BoundingBox optimization?
The text was updated successfully, but these errors were encountered: