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
CesiumGltfComponent.cpp copies the glTF vertex data into a TArray<FStaticMeshBuildVertex>, which represents the mesh as an array of structures. Then, it calls Init on various Unreal "vertex buffer" classes to copy that data into Unreal's structure of arrays form.
This is pointless. We can just copy the glTF data into the FPositionVertexBuffer, FColorVertexBuffer, and FStaticMeshVertexBuffer instances directly and save some heap allocations and a pass over the vertex data. The only slightly tricky thing about this is that we need to determine the total number of texture coordinates required before we can start populating any of them. Previously, we could count and copy simultaneously. So this will require a slight reorganization of the code.
The text was updated successfully, but these errors were encountered:
I was originally going to do this as part of #1515, but decided against it in order to avoid merge conflicts. @azrogers is currently making significant changes to this same code as part of the Unreal side of CesiumGS/cesium-native#926.
kring
changed the title
Eliminate an unnecessary copy operation while creating Unreal meshes from til4es
Eliminate an unnecessary copy operation while creating Unreal meshes from tiles
Sep 4, 2024
CesiumGltfComponent.cpp
copies the glTF vertex data into aTArray<FStaticMeshBuildVertex>
, which represents the mesh as an array of structures. Then, it callsInit
on various Unreal "vertex buffer" classes to copy that data into Unreal's structure of arrays form.This is pointless. We can just copy the glTF data into the
FPositionVertexBuffer
,FColorVertexBuffer
, andFStaticMeshVertexBuffer
instances directly and save some heap allocations and a pass over the vertex data. The only slightly tricky thing about this is that we need to determine the total number of texture coordinates required before we can start populating any of them. Previously, we could count and copy simultaneously. So this will require a slight reorganization of the code.The text was updated successfully, but these errors were encountered: