.glTF File Loader Plugin

Setup

The glTF loader files are located here.

Full Version

This loader supports both glTF 1.0 and 2.0 and will use the correct loader based on the glTF version string.

<script src="babylon.js"></script>
<script src="babylon.glTFFileLoader.js"></script>

Version 2 Only

This loader supports only glTF 2.0 and will fail to load glTF 1.0.

<script src="babylon.js"></script>
<script src="babylon.glTF2FileLoader.js"></script>

Version 1 Only

This loader supports only glTF 1.0 and will fail to load glTF 2.0.

<script src="babylon.js"></script>
<script src="babylon.glTF1FileLoader.js"></script>

Loading the Scene

Use one of the static function on the SceneLoader to load a glTF asset. See Load from any file type.

See an example here: Load a glTF Asset

API (Version 2)

Properties and Methods

See the available properties and methods from the API documentation.

Extensions

See the available extensions from the API documentation.

API (Version 1)

Properties

IncrementalLoading

Set this property to false to disable incremental loading which delays the loader from calling the success callback until after loading the meshes and shaders. Textures always loads asynchronously. For example, the success callback can compute the bounding information of the loaded meshes when incremental loading is disabled. Defaults to true.

BABYLON.GLTFFileLoader.IncrementalLoading = false;

HomogeneousCoordinates

Set this property to true in order to work with homogeneous coordinates, available with some converters and exporters. Defaults to false.

BABYLON.GLTFFileLoader.HomogeneousCoordinates = true;

Extensions

KHR_binary_glTF
KHR_materials_common