3D Model Essentials
When importing 3D models into Decentraland, it’s important to make sure they’re in either glTF format. These models can include a variety of supported features. This section is all about how to make them compatible with Decentraland and following best practices.
Please note that all models, shaders, and textures must comply with the scene limitations .
Supported 3D Model Formats #
All 3D models in Decentraland must be in glTF format. glTF (GL Transmission Format) is an open project by Khronos providing a common, extensible format for 3D assets that is both efficient and highly interoperable with modern web technologies.
glTF models can have either a .gltf or a .glb extension. glTF files are human-readable, you can open one in a text editor and read it like a JSON file. This is useful, for example, to verify that animations are properly attached and to check for their names. glb files are binary, so they’re not readable but they are considerably smaller in size, which is good for the scene’s performance.
We recommend using .gltf while you’re working on a scene, but then switching to .glb when uploading it.
The following aspects of a 3D model can either be embedded in a glTF file or referenced externally:
- Textures can either be embedded or referenced from an external image file.
- Binary data about geometry, animations, and other buffer-related aspects of the model can either be embedded or referenced from an external .bin file.
📔 Note: Animations must be embedded inside the glTF file to use in Decentraland. Also, each model is only allowed to have 1 UV map.
Why We Use glTF #
We use glTF because it provides a powerful set of features that includes:
- Hierarchical objects
- Skeletal structure and animation
- Robust pipeline for materials and shaders
- Scene information such light sources and cameras (which can be used in future developments).
Compared to COLLADA, the supported features are very similar. However, because glTF focuses on providing a “transmission format” rather than an editor format, it is more interoperable with web technologies.
Export And Convert glTF #
Export To glTF From Blender #
Blender has a native gltf exporter.
To export select the models you want to be contained on the .glb file then go to File - Export - glTF 2.0
On the side panel check “Selected Objects” in case you want to export only the selected objects in the scene. Also, on the Mesh Dropdown select Apply Modifiers (if they were), then Export.
Export To glTF From 3D Studio Max #
3D Studio Max doesn’t support exporting to glTF by default, but you can install a plugin to enable it.
- Download the plugin from this link .
- Install the plugin by following these instructions .
- Export glTF files using the plugin by following these instructions .
Export To glTF From Maya #
Maya doesn’t support exporting to glTF by default, but you can install a plugin to enable it.
- Install the plugin by following these instructions .
- Export glTF files using the plugin by following these instructions .
📔 Note: As an alternative, you can try this other plugin too.
Export To glTF From Unity #
Unity doesn’t support exporting to glTF by default, but you can install a plugin to enable it.
Download the plugin from this link .
📔 Note: As an alternative, you can try this other plugin too.
Export To glTF From SketchUp #
SketchUp doesn’t support exporting to glTF by default, but you can install a plugin to enable it.
Download the plugin from this link .
Convert FBX Into glTF #
.fbx is a very popular standard for 3D models. It’s not supported by our engine, but you can easily export an .fbx model to .gltf format.
We recommend using these tools:
- Blender : An easy way to convert .fbx to glTF is by importing the .fbx to a scene using Blender and then export it from there.
- Facebook’s CLI tool : this is the most robust alternative, but requires using the command line.
- Blackthread : This the most complete web based tool. Less robust than the CLI, but a lot easier to use.
- Modelconverter : Another easy-to-use web based tool.
Preview a glTF Model #
A quick and easy way to preview the contents of a glTF model before importing it into a scene is to use the Babylon.js Sandbox . Just drag and drop the glTF file (and its .bin file if applicable) into the canvas to view the model.
In the sandbox you can also preview the animations that are embedded in the model, select which to display by picking it out of a dropdown menu.
Analyse glTF #
One great tool to analyze your glTFs is using glTF Sample Viewer . This tool allows you to inspect channels, textures, reaction to different light environments, preview animations and so much more! Ideal for single models.
Another helpful tool is gltf.report/ . Simply drag and drop your models onto the website to view the contents of the glTF package and assess which parts of the model can be optimized.
This tool can be especially useful for large files containing multiple models, textures, and animations. For instance, by organizing textures by size, you can easily identify which textures are using up the most resources.
Optimize a glTF #
The following tool offers some optimizations that will make 3D models lighter and faster to download for players in your scene.
Among other things, it converts .gltf format into .glb, which is binary and so occupies a lot less. It also places texture files outside the 3D model, which allows you to use the same texture on multiple models.
📔 Note: .glb format by default always has textures embedded in the file. The engine can’t recognize two embedded textures as the same, they need to be external files that share a same hash.
See also #
The following pages also cover topics related to 3D models for Decentraland: