Convert glTF to 3D Tiles for streaming of enormous fashions in AWS IoT TwinMaker

Have you ever skilled lengthy wait instances when loading up a 3D scene in AWS IoT TwinMaker? Maybe battling poor rendering efficiency when navigating a fancy 3D mannequin? There’s a method to convert your fashions into the 3D Tiles normal for environment friendly streaming in a scene.

On this weblog you’ll discover ways to compress a 3D mannequin or Level Cloud file into 3D tilesets utilizing Cesium ion and easy methods to create a TwinMaker scene utilizing the transformed 3D tilesets. Utilizing 3D tilesets, you possibly can cut back the unique mannequin dimension by 50% to 90% and enhance the rendering efficiency in an AWS IoT TwinMaker powered dashboard.


On this weblog publish, a number of file extensions and mannequin course of requirements are referenced. Earlier than getting began, here’s a fast refresher on the terminologies that you’ll encounter on this weblog:

  • glTF – Graphics Language Transmission Format is a regular file format for three-dimensional scenes and fashions. A glTF file makes use of one in all two doable file extensions: .gltf or .glb
  • Cesium ionCesium ion is a sturdy, scalable, and safe platform for 3D geospatial information provided by Cesium.
  • Draco CompressionDraco is an open-source library for compressing and decompressing 3D geometric meshes and level clouds. It’s meant to enhance the storage and transmission of 3D graphics. Cesium gives to make use of this compression to additional cut back file dimension.
  • 3D Tileset3D Tiles is an Open Geospatial Consortium (OGC) Group Customary. The 3D tileset is used for sharing, visualizing, fusing, and interacting with large heterogeneous 3D geospatial content material throughout desktop, internet, and cellular functions.

AWS IoT TwinMaker helps 3D property within the glTF and 3D Tiles format. glTF is the usual for displaying 3D content material on an online browser, however immediately, very giant (>100MB) and/or very advanced fashions (>10K nodes) can take too lengthy to render. glTF, and it’s binary format glb, might be transformed to the 3D Tiles format to keep away from lengthy load instances and low body price. 3D Tiles makes use of a hierarchical degree of element (HLOD) to stream content material in tiles which might be spatially bounded. Streaming content material means a big asset will solely render smaller chunks relying on the place the consumer is oriented within the 3D scene. A tile can render the chunks in batches of distinct fashions, or situations of the identical mannequin might be optimally rendered. Level clouds may also be rendered in a tile as an entire mannequin or individually as spatially bounded factors. The 3D Tiles 1.0 format makes use of JSON and binary format to retailer the totally different tile sorts. This reorganization of enormous 3D property permits IoT TwinMaker to ship a 3D scene with excessive constancy, a better body price, and quicker loading. Quick rendering of 3D scenes is crucial for successfully visualizing information in your digital twin.

Cesium ion is a strong, totally managed platform for managing 3D geospatial information. Cesium ion’s 3D Tiling Pipeline compresses and converts giant 3D fashions from many codecs (gltf, .glb, .obj, .las, .laz, .fbx, .dae) into 3D Tiles to optimize rendering and streaming of the content material to any machine. Cesium ion shops 3D fashions, converts fashions into 3D Tiles, and exports the tilesets to an AWS S3 bucket. We are going to stroll you thru a step-by-step information to transform a big mannequin into 3D Tileset and import it as an AWS IoT TwinMaker scene utilizing Cesium ion. The method will contain working the supplied scripts to assemble an IoT TwinMaker Scene with the transformed 3D Tilesets.


  1. An account on Cesium ion. You possibly can register Cesium and select the suitable subscription plan based mostly on what you are promoting requirement on this Cesium’s pricing web page. To comply with this weblog publish, you possibly can select the free group tier for the reason that mannequin dimension is smaller than 5GB.
  2. An current AWS IoT TwinMaker Workspace
  3. AWS Cloud9 will likely be used for this weblog. In case you select to run this in one other atmosphere, the next is required:
    • Node.js, NPM, and Git put in
    • A desktop with no less than 5GB space for storing and 4GB of ram to run the script.

Open Supply Mannequin

For this text we are going to use the open supply Cookie Manufacturing facility Warehouse mannequin. This mannequin will likely be downloaded in later steps. The CF_BUILDING.glb is 57MB.

Cookie Factory Warehouse Model prior to conversion

Cookie Manufacturing facility Warehouse Mannequin


Step 1: Create a Cesium entry token

  1. Login to your Cesium account and go to the tokens web page
  2. Click on Create token
  3. Title it TwinMaker token
  4. Toggle on the next permission scopes:
    • property:learn
    • property:write
    • property:record
    • archives:learn
    • archives:write
  5. Click on Create

    Tutorial reference for Cesium authentication
    Cesium ion access token generation: toggle on the permissions in this image

    Cesium ion entry token technology: toggle on the permissions on this picture

Step 2: Put together the cesium_sample script

Notice: The script on this weblog isn’t beneficial for a manufacturing atmosphere. Cesium ion is a third occasion service so it’s essential to explicitly verify that you just opt-in to make use of it. We suggest reviewing phrases and circumstances that apply to this script on the Cesium web site

  1. Go browsing to AWS Console and choose a area that helps AWS IoT TwinMaker
  2. Launch AWS Cloud9 in your AWS Console
  3. Create a brand new atmosphere and choose t2.medium and Amazon Linux 2.
  4. Within the terminal run this command to obtain the Cookie Manufacturing facility Warehouse mannequin
    curl -O

  5. Within the terminal for AWS Cloud9, run the command under to clone the aws-iot-twinmaker-samples repo
    git clone

  6. Set up node modules for the scene_utils lib
    cd aws-iot-twinmaker-samples/src/libs/scene_utils
    npm set up

  7. In case you are utilizing a dev machine apart from AWS Cloud9, guarantee you’ve got created AWS credentials
      • Minimal permissions are encapsulated within the following coverage JSON:
            "Model": "2012-10-17",
            "Assertion": [
                    "Effect": "Allow",
                    "Action": [
                    "Useful resource": "arn:aws:iottwinmaker:<AWS_REGION>:<ACCOUNT_ID>:workspace/*"
                    "Impact": "Permit",
                    "Motion": [
                    "Useful resource": "*"

  8. Run this command under to set your AWS Area environmental variable to the area of your AWS IoT TwinMaker workspace. The command under is utilizing us-east-1 however could also be totally different on your atmosphere.
    export AWS_REGION=us-east-1

Step 3: Automated Conversion and Scene Creation

  1. Set the atmosphere variable CESIUM_ACCESS_TOKEN with the token you created in Step 1

  2. Run the pattern script together with your workspaceId, a given sceneId, and the native path to CF_BUILDING.glb.
    npx ts-node samples/cesium_sample/pattern.ts --workspaceId [WORKSPACE_ID] --sceneId [SCENE_NAME] --assetFilePath [PATH_TO_3D_MODEL] --dracoCompression

    Notice: The argument –dracoCompression is used right here to lower the dimensions of the asset. Don’t use this argument in the event you add a Pointcloud file (.las/.laz), not lined on this weblog.

    This script uploads your 3D mannequin to Cesium ion, waits for the completion of the tiling pipeline, then exports the 3D Tileset to your WORKSPACE_ID’s S3 bucket. Then it creates/edits SCENE_ID and provides a single node with the 3D Tileset mannequin. The mannequin you downloaded to AWS Cloud9 is within the dwelling listing, ~/atmosphere/CF_BUILDING.glb

    a. Kind “sure” when prompted to opt-in
    b. Look forward to the next actions to be taken in your behalf:

    • Add your 3D mannequin to Cesium ion and look ahead to the tiling pipeline to finish 3D Tiles conversion.
    • Create an archive of the transformed tileset and obtain the tileset in a compressed .zip.
    • Add the uncompressed contents of the .zip to your IoT TwinMaker workspace’s S3 bucket.
    • Add the tileset as a node in an IoT TwinMaker scene.
  3. View the Scene in your IoT TwinMaker workspace to see the scene and mannequin created for you.


You now have a brand new IoT TwinMaker scene together with your 3D asset compressed utilizing 3D Tiles! Click on the Snap to ground checkbox on the appropriate to see the complete mannequin above the ground.

Example scene with the CF_BUILDING 3D tileset

Instance scene with the CF_BUILDING 3D tileset

File Dimension Compression

Now, navigate to Amazon S3, and find your AWS IoT Twinmaker workspace S3 bucket. Checking the dimensions of the Cookie Manufacturing facility 3D Tileset in S3 reveals a lower in dimension from 57MB to 2.9MB. That could be a 95% compression.

S3 folder size calculation for the cookie factory tileset

S3 folder dimension calculation for the cookie manufacturing facility tileset

File Load Time Comparability

Scene Viewer took round 32 seconds to load the unique 57MB glb file when it’s immediately added to the scene.

IoT TwinMaker scene with the original CF_BUILDING.glb – S3 GetObject network call timing tab shows >20s of load time

IoT TwinMaker scene with the unique CF_BUILDING.glb – S3 GetObject community name timing tab reveals >20s of load time

Compared, Scene Viewer takes round 40ms to load the 3D tileset, lowering the loading time by 99.9%.

IoT TwinMaker scene with the cookie factory 3D tileset – accumulation of S3 GetObject network calls complete within 1 second as seen on the request timeline

IoT TwinMaker scene with the cookie manufacturing facility 3D tileset – accumulation of S3 GetObject community calls full inside 1 second as seen on the request timeline

Notable Variations

It’s clear that 3D Tiles improves the loading and rendering expertise of your 3D asset visualization. Nonetheless, the 3D tileset is doesn’t but help geometric and semantic metadata. The Cesium crew is presently engaged on this. At present, the mesh hierarchy of the unique file can’t be used for the sub-model choice characteristic. The photographs under compares a scene with the unique CF_BUILDING glb and its mesh hierarchy breakdown to the scene with the CF_BUILDING tileset with none hierarchy breakdown.

IoT TwinMaker scene with the original CF_BUILDING.glb – mesh hierarchy list is supported

IoT TwinMaker scene with the unique CF_BUILDING.glb – mesh hierarchy record is supported

IoT TwinMaker scene with the CF_BUILDING 3D tileset – there is no mesh hierarchy

IoT TwinMaker scene with the CF_BUILDING 3D tileset – there isn’t a mesh hierarchy

It is suggested to make use of the 3D Tiles conversion for big property that function context for the background of a scene. Within the Cookie Manufacturing facility instance, in the event you wished the highlighted node to be additional damaged down and annotated then it needs to be extracted as a separate glTF/glb asset and added on to the scene. This may be completed with free and customary 3D instruments like Blender.


  1. Problem with the Cesium ion tiling course of: If there may be any error throughout the tiling conversion course of, the pattern script will notify you to examine in your asset on the Cesium ion website asset web page. One widespread subject is {that a} mannequin is already draco compressed which isn’t supported as a supply file for Cesium ion. For different points please publish to the Cesium Group Discussion board to succeed in the Cesium ion crew immediately.
  2. Script stop as a result of a step took too lengthy: The default wait instances for tiling and downloading archives from Cesium ion is 5 minutes for every step. For very giant recordsdata (>1GB) this might take longer. Please learn the documentation of the pattern script to see easy methods to proceed with the subsequent step after Cesium finishes processing your asset.


On this weblog, you realized easy methods to convert a regular glTF/glb file into the optimized 3D Tiles and created a scene in AWS IoT TwinMaker with quicker loading velocity. You possibly can apply this to any of your giant property. You may as well edit the script on your use case. To discover ways to customise the Scene Util script, please go to the supply pattern code.

Listed here are different mannequin conversion blogs obtainable, with extra to return:
Learn how to convert and compress OBJ fashions to glTF to be used with AWS IoT TwinMaker

Concerning the authors

Harry Wandersman Harry is a Software program Improvement Engineer on the IoT TwinMaker frontend service crew. Harry has labored within the IoT house since 2018, serving to construct and develop the IoT SiteWise and TwinMaker providers. Harry is keen about 3D graphics and immersive digital experiences, and its software in IoT to help digital twins.
Chris Azer is a Principal IoT Specialist Options Architect serving to prospects with their digital twin initiatives. Chris has labored in varied roles at AWS since 2017 supporting companions and prospects with architecting IoT options. This features a broad set of use instances protecting the DoD, Manufacturing, State and Native Authorities, Federal and Civilian, Sensible Cities, Companions, and others. His profession in Industrial Automation dates again to 2004 the place he continues to help enterprises immediately with their sensible manufacturing journey.


Leave a Reply

Your email address will not be published. Required fields are marked *