Is there any public project that imports KML data into Cesium’s terrain by converting it into a 3D mesh or model? We are currently trying to develop a similar project using KML datasets and Cesium’s terrain to visualize fault systems in VR. We’ve gotten to a decent point in terms of visualization, but there are noticeable performance issues.
This is an interesting project — visualizing fault systems in VR sounds like a great use case for Cesium.
There isn’t currently a built-in KML loader in Cesium for Unity, so the approach you’re taking (converting to meshes) is along the right lines. A few suggestions that may help:
Pipeline approach:
Kevin Ring outlined a recommended workflow in a similar thread: convert KML → GeoJSON (or another easy-to-parse format), then read it in a Unity script and use CesiumWgs84Ellipsoid / CesiumGeoreference to convert coordinates to Unity world space. For terrain-relative placement, SampleHeightMostDetailed on Cesium3DTileset can clamp your geometry to the terrain surface.
For performance in VR, a few things to investigate:
Profile first — use the Unity Profiler to determine whether your bottleneck is CPU (tile loading, mesh generation) or GPU (draw calls, fill rate, shader complexity).
Increase Maximum Screen Space Error on your Cesium3DTileset — this is the single most effective lever for VR performance, as it reduces tile detail at distance.
Reduce Maximum Simultaneous Tile Loads if you’re seeing lag spikes.
Mesh complexity — if your fault meshes are high-poly, consider LOD or simplification. Unity’s VR rendering budget is tight (~11ms/frame for 90fps).
Consider 3D Tiles — if your fault data is large, converting it to 3D Tiles (e.g., uploading to Cesium ion) would give you automatic LOD and streaming, which is how Cesium is designed to handle large datasets performantly.
Could you share a bit more about your current pipeline (how you’re converting the KML), the approximate complexity of the meshes, and your target hardware? That would help us give more targeted advice.
Thank you for your welcome and suggestions @Jake, I will look closer into them. Currently, we have two working versions:
One that imports the 2023 U.S. National Seismic Hazard Model (NSHM3.0) from an existing MATLAB .stl file that our lab already uses. We reprojected that model to account for the Earth’s sphericity and then imported it into Blender to export as a .fbx file into Unity. We calculated the barycenter to orient the model using the Cesium Globe Anchor.
Another that parses the 2024 Statewide California Earthquake Center (SCEC) Community Fault Model (CFM7.0)'s KML files to render the faults at runtime. This gave us the Lon, Lat, and Ele coordinates, which we used to create meshes as connectors between these points. We were experiencing issues with the rendering of these faults but have since solved this issue by lowering the complexity of the meshes (as you have suggested) and other various methods of optimization. We also tried using SampleHeightMostDetailed to clamp the geometry, but some faults have as few as 4 points through a mountainous terrain which results in visible clipping, so we are holding off on that for now.
Our ultimate target is running this project on standalone VR goggles, but we are beginning by using HTC Vive Pro series goggles and hoping to move on from there.
Thank you again and I look forward to sharing once it is complete.