Cesium 3D Tiles recipes
Each recipe assumes the Gem is enabled and you understand the Getting started hierarchy.
1. Global terrain + imagery
Goal: Cesium World Terrain with Bing Aerial draped on top.
- Follow Getting started through the minimal hierarchy.
- Georeference: set a cartographic origin near your site of interest.
- Tileset:
FromCesiumIon, asset ID1, SSE16. - Same entity: Ion Raster Overlay, asset ID
2, material slot0. - Camera: Fly Controller + Origin Shift
UpdateRenderOrigin. - Add SunSky + Credits; enter play mode.
Verify: terrain refines on approach; imagery visible; attribution shown.
2. Photorealistic city
Goal: Google Photorealistic 3D Tiles (bandwidth and memory heavy).
- Place Georeference at the city center (lon/lat/height of a downtown point).
- Tileset:
FromCesiumIon, asset ID2275207. - Suggested knobs:
- Maximum screen space error ≈
8 - Maximum cached bytes ≥
1GiB - Consider Unload tiles in play mode while iterating in the Editor
- Optional: skip Bing overlay (photorealistic tiles already carry color).
- Origin Shift on camera; raise Fly Controller far clip if you orbit high.
Verify: building-scale mesh appears; watch memory and simultaneous loads. Lower SSE further only if the machine can sustain it.
Ensure your ion token and Google Photorealistic entitlement allow asset 2275207.
3. Offline photogrammetry
Goal: Local tileset.json with optional local imagery.
- Tileset:
FromLocalFile→ absolute path to yourtileset.json(loaded asfile://). - Georeference origin should match the dataset’s authoring CRS / survey origin (often a site LLH).
- Optional imagery: TMS Raster Overlay with a
file:///gdal2tiles directory, or URL Template pointing at a local HTTP server. - Request cache still helps remote dependencies if any remain; pure local trees work offline.
Verify: content loads with network disabled (after cache warm if hybrid). Use Debug Colorize Tiles temporarily to confirm LOD.
4. Place a Prefab at a GPS point
Goal: Drop authored content at a real-world coordinate.
- Ensure a level Georeference exists.
- On the Prefab root (or a locator entity), add CesiumGlobeAnchorComponent.
- Set height reference as needed (
Nonefor absolute ellipsoid height, or relative to ground / tileset). - Call:
DawnCesium::CesiumGlobeAnchorRequestBus::Event(
entityId,
&DawnCesium::CesiumGlobeAnchorRequests::MoveToLongitudeLatitudeHeight,
lonDegrees, latDegrees, heightMeters);
- Optional: Fly-To the camera to the same LLH so you can inspect placement.
Verify: Prefab sits on the expected site; moving the Transform updates LLH when detect-transform is on.
5. Low-end demo
Goal: Keep a globe interactive on limited GPUs.
- Start from recipe 1.
- Tileset: SSE
32(or higher), lowerMaximum cached bytes, setMaximum simultaneous tile loadsto a small explicit value (e.g.4). - Disable Create physics meshes unless you need collision.
- Prefer a single overlay; raise overlay SSE slightly if imagery dominates cost.
- Keep Origin Shift on—precision bugs are not a savings.
Verify: stable frame time while orbiting; expect coarser ground.
6. Private / self-hosted ion
Goal: Point tilesets and overlays at a private ion deployment.
- Create a
.cesiumionserverasset (Asset Processor registers*.cesiumionserver): server URL, API URL, default access token, OAuth application ID as needed. - On the tileset (and overlays): assign Ion server asset; leave component tokens empty to use the asset default, or set per-component tokens.
- Tools → Cesium panel: select the current server; use ion Assets / Quick Add against that server.
- Optionally set project
DefaultIonServerUrlfor the empty-asset fallback.
Verify: Troubleshoot Token succeeds against the private host; asset IDs from that server load.
Related
- Configuration and debugging when a recipe fails.
- Reference for buses used in scripts.