Interface GLTFLoaderOptionsAbstract
alwaysComputeBoundingBox: boolean;
alwaysComputeSkeletonRootNode: boolean;
animationStartMode: GLTFLoaderAnimationStartMode;
capturePerformanceCounters: boolean;
compileMaterials: boolean;
compileShadowGenerators: boolean;
coordinateSystemMode: GLTFLoaderCoordinateSystemMode;
createInstances: boolean;
customRootNode?: any;
dontUseTransmissionHelper: boolean;
extensionOptions: {
EXT_lights_area?: { enabled?: boolean };
EXT_lights_ies?: { enabled?: boolean };
EXT_lights_image_based?: { enabled?: boolean };
EXT_mesh_gpu_instancing?: { enabled?: boolean };
EXT_meshopt_compression?: { enabled?: boolean };
EXT_texture_avif?: { enabled?: boolean };
EXT_texture_webp?: { enabled?: boolean };
ExtrasAsMetadata?: { enabled?: boolean };
KHR_animation_pointer?: { enabled?: boolean };
KHR_draco_mesh_compression?: { enabled?: boolean };
KHR_gaussian_splatting?: { enabled?: boolean };
KHR_interactivity?: {
autoStart?: boolean;
enabled?: boolean;
parseOnly?: boolean;
strictValidation?: boolean;
};
KHR_lights_punctual?: { enabled?: boolean };
KHR_materials_anisotropy?: { enabled?: boolean };
KHR_materials_clearcoat?: { enabled?: boolean };
KHR_materials_coat?: { enabled?: boolean };
KHR_materials_diffuse_roughness?: { enabled?: boolean };
KHR_materials_diffuse_transmission?: { enabled?: boolean };
KHR_materials_dispersion?: { enabled?: boolean };
KHR_materials_emissive_strength?: { enabled?: boolean };
KHR_materials_fuzz?: { enabled?: boolean };
KHR_materials_ior?: { enabled?: boolean };
KHR_materials_iridescence?: { enabled?: boolean };
KHR_materials_pbrSpecularGlossiness?: { enabled?: boolean };
KHR_materials_sheen?: { enabled?: boolean };
KHR_materials_specular?: { enabled?: boolean };
KHR_materials_transmission?: { enabled?: boolean };
KHR_materials_unlit?: { enabled?: boolean };
KHR_materials_variants?: {
defaultVariant?: string;
enabled?: boolean;
onLoaded?: (controller: MaterialVariantsController) => void;
};
KHR_materials_volume?: { enabled?: boolean };
KHR_materials_volume_scatter?: { enabled?: boolean };
KHR_mesh_quantization?: { enabled?: boolean };
KHR_node_hoverability?: { enabled?: boolean };
KHR_node_selectability?: { enabled?: boolean };
KHR_node_visibility?: { enabled?: boolean };
KHR_texture_basisu?: { enabled?: boolean };
KHR_texture_transform?: { enabled?: boolean };
KHR_xmp_json_ld?: { enabled?: boolean };
MSFT_audio_emitter?: { enabled?: boolean };
MSFT_lod?: { enabled?: boolean; maxLODsToLoad?: number };
MSFT_minecraftMesh?: { enabled?: boolean };
MSFT_sRGBFactors?: { enabled?: boolean };
[key: string]: { enabled?: boolean; [key: string]: unknown } | undefined;
};
loadAllMaterials: boolean;
loadMorphTargets: boolean;
loadNodeAnimations: boolean;
loadOnlyMaterials: boolean;
loadSkins: boolean;
loggingEnabled: boolean;
onCameraLoaded?: (camera: Camera) => void;
onMaterialLoaded?: (material: Material) => void;
onMeshLoaded?: (mesh: AbstractMesh) => void;
onParsed?: (loaderData: IGLTFLoaderData) => void;
onSkinLoaded?: (node: TransformNode, skinnedNode: TransformNode) => void;
onTextureLoaded?: (texture: BaseTexture) => void;
onValidated?: (results: IGLTFValidationResults) => void;
preprocessUrlAsync: (url: string, rootUrl?: string) => Promise<string>;
skipMaterials: boolean;
targetFps: number;
transparencyAsCoverage: boolean;
useClipPlane: boolean;
useGltfTextureNames: boolean;
useMaxMorphTargetInfluencers: boolean;
useOpenPBR: boolean;
useRangeRequests: boolean;
useSRGBBuffers: boolean;
validate: boolean;
}
Hierarchy (View Summary)
- GLTFLoaderBaseOptions
- GLTFLoaderOptions
Index
Properties
Properties
always Compute Bounding Box
Defines if the loader should always compute the bounding boxes of meshes and not use the min/max values from the position accessor. Defaults to false.
always Compute Skeleton Root Node
Defines if the loader should always compute the nearest common ancestor of the skeleton joints instead of using skin.skeleton. Defaults to false.
Set this to true if loading assets with invalid skin.skeleton values.
animation Start Mode
The animation start mode. Defaults to FIRST.
Abstractcapture Performance Counters
Defines if the loader should capture performance counters.
compile Materials
Defines if the loader should compile materials before raising the success callback. Defaults to false.
compile Shadow Generators
Defines if the loader should compile shadow generators before raising the success callback. Defaults to false.
coordinate System Mode
The coordinate system mode. Defaults to AUTO.
create Instances
Defines if the loader should create instances when multiple glTF nodes point to the same glTF mesh. Defaults to true.
Optionalcustom Root Node
Defines the node to use as the root of the hierarchy when loading the scene (default: undefined). If not defined, a root node will be automatically created. You can also pass null if you don't want a root node to be created.
dont Use Transmission Helper
If true, the loader will not use the transmission helper when loading materials with transmission.
extension Options
EXT_lights_area?: { enabled?: boolean };
EXT_lights_ies?: { enabled?: boolean };
EXT_lights_image_based?: { enabled?: boolean };
EXT_mesh_gpu_instancing?: { enabled?: boolean };
EXT_meshopt_compression?: { enabled?: boolean };
EXT_texture_avif?: { enabled?: boolean };
EXT_texture_webp?: { enabled?: boolean };
ExtrasAsMetadata?: { enabled?: boolean };
KHR_animation_pointer?: { enabled?: boolean };
KHR_draco_mesh_compression?: { enabled?: boolean };
KHR_gaussian_splatting?: { enabled?: boolean };
KHR_interactivity?: {
autoStart?: boolean;
enabled?: boolean;
parseOnly?: boolean;
strictValidation?: boolean;
};
KHR_lights_punctual?: { enabled?: boolean };
KHR_materials_anisotropy?: { enabled?: boolean };
KHR_materials_clearcoat?: { enabled?: boolean };
KHR_materials_coat?: { enabled?: boolean };
KHR_materials_diffuse_roughness?: { enabled?: boolean };
KHR_materials_diffuse_transmission?: { enabled?: boolean };
KHR_materials_dispersion?: { enabled?: boolean };
KHR_materials_emissive_strength?: { enabled?: boolean };
KHR_materials_fuzz?: { enabled?: boolean };
KHR_materials_ior?: { enabled?: boolean };
KHR_materials_iridescence?: { enabled?: boolean };
KHR_materials_pbrSpecularGlossiness?: { enabled?: boolean };
KHR_materials_sheen?: { enabled?: boolean };
KHR_materials_specular?: { enabled?: boolean };
KHR_materials_transmission?: { enabled?: boolean };
KHR_materials_unlit?: { enabled?: boolean };
KHR_materials_variants?: {
defaultVariant?: string;
enabled?: boolean;
onLoaded?: (controller: MaterialVariantsController) => void;
};
KHR_materials_volume?: { enabled?: boolean };
KHR_materials_volume_scatter?: { enabled?: boolean };
KHR_mesh_quantization?: { enabled?: boolean };
KHR_node_hoverability?: { enabled?: boolean };
KHR_node_selectability?: { enabled?: boolean };
KHR_node_visibility?: { enabled?: boolean };
KHR_texture_basisu?: { enabled?: boolean };
KHR_texture_transform?: { enabled?: boolean };
KHR_xmp_json_ld?: { enabled?: boolean };
MSFT_audio_emitter?: { enabled?: boolean };
MSFT_lod?: { enabled?: boolean; maxLODsToLoad?: number };
MSFT_minecraftMesh?: { enabled?: boolean };
MSFT_sRGBFactors?: { enabled?: boolean };
[key: string]: { enabled?: boolean; [key: string]: unknown } | undefined;
} = {}
Defines options for glTF extensions.
Type Declaration
-
[key: string]: { enabled?: boolean; [key: string]: unknown } | undefined
Type Declaration
- { enabled?: boolean; [key: string]: unknown }
-
[key: string]: unknown
-
Optionalenabled?: booleanDefines if the extension is enabled
-
- undefined
- { enabled?: boolean; [key: string]: unknown }
-
OptionalEXT_lights_area?: { enabled?: boolean }Defines options for the EXT_lights_area extension.
-
Optionalenabled?: booleanDefines if the extension is enabled
-
-
OptionalEXT_lights_ies?: { enabled?: boolean }Defines options for the EXT_lights_ies extension.
-
Optionalenabled?: booleanDefines if the extension is enabled
-
-
OptionalEXT_lights_image_based?: { enabled?: boolean }Defines options for the EXT_lights_image_based extension.
-
Optionalenabled?: booleanDefines if the extension is enabled
-
-
OptionalEXT_mesh_gpu_instancing?: { enabled?: boolean }Defines options for the EXT_mesh_gpu_instancing extension.
-
Optionalenabled?: booleanDefines if the extension is enabled
-
-
OptionalEXT_meshopt_compression?: { enabled?: boolean }Defines options for the EXT_meshopt_compression extension.
-
Optionalenabled?: booleanDefines if the extension is enabled
-
-
OptionalEXT_texture_avif?: { enabled?: boolean }Defines options for the EXT_texture_avif extension.
-
Optionalenabled?: booleanDefines if the extension is enabled
-
-
OptionalEXT_texture_webp?: { enabled?: boolean }Defines options for the EXT_texture_webp extension.
-
Optionalenabled?: booleanDefines if the extension is enabled
-
-
OptionalExtrasAsMetadata?: { enabled?: boolean }Defines options for the ExtrasAsMetadata extension.
-
Optionalenabled?: booleanDefines if the extension is enabled
-
-
OptionalKHR_animation_pointer?: { enabled?: boolean }Defines options for the KHR_animation_pointer extension.
-
Optionalenabled?: booleanDefines if the extension is enabled
-
-
OptionalKHR_draco_mesh_compression?: { enabled?: boolean }Defines options for the KHR_draco_mesh_compression extension.
-
Optionalenabled?: booleanDefines if the extension is enabled
-
-
OptionalKHR_gaussian_splatting?: { enabled?: boolean }Defines options for the KHR_gaussian_splatting extension.
-
Optionalenabled?: booleanDefines if the extension is enabled
-
-
OptionalKHR_interactivity?: {
autoStart?: boolean;
enabled?: boolean;
parseOnly?: boolean;
strictValidation?: boolean;
}Defines options for the KHR_interactivity extension.
-
OptionalautoStart?: booleanWhether the selected default graph starts automatically after import. Defaults to true.
-
Optionalenabled?: booleanDefines if the extension is enabled
-
OptionalparseOnly?: booleanWhether to retain only the canonical source model and executable FlowGraph serialization without constructing runtime graphs. Defaults to false.
-
OptionalstrictValidation?: booleanWhether to enforce the ratified graph validation rules. Defaults to true. Set to false only for pre-ratification assets.
-
-
OptionalKHR_lights_punctual?: { enabled?: boolean }Defines options for the KHR_lights_punctual extension.
-
Optionalenabled?: booleanDefines if the extension is enabled
-
-
OptionalKHR_materials_anisotropy?: { enabled?: boolean }Defines options for the KHR_materials_anisotropy extension.
-
Optionalenabled?: booleanDefines if the extension is enabled
-
-
OptionalKHR_materials_clearcoat?: { enabled?: boolean }Defines options for the KHR_materials_clearcoat extension.
-
Optionalenabled?: booleanDefines if the extension is enabled
-
-
OptionalKHR_materials_coat?: { enabled?: boolean }Defines options for the KHR_materials_coat extension.
-
Optionalenabled?: booleanDefines if the extension is enabled
-
-
OptionalKHR_materials_diffuse_roughness?: { enabled?: boolean }Defines options for the KHR_materials_diffuse_roughness extension.
-
Optionalenabled?: booleanDefines if the extension is enabled
-
-
OptionalKHR_materials_diffuse_transmission?: { enabled?: boolean }Defines options for the KHR_materials_diffuse_transmission extension.
-
Optionalenabled?: booleanDefines if the extension is enabled
-
-
OptionalKHR_materials_dispersion?: { enabled?: boolean }Defines options for the KHR_materials_dispersion extension.
-
Optionalenabled?: booleanDefines if the extension is enabled
-
-
OptionalKHR_materials_emissive_strength?: { enabled?: boolean }Defines options for the KHR_materials_emissive_strength extension.
-
Optionalenabled?: booleanDefines if the extension is enabled
-
-
OptionalKHR_materials_fuzz?: { enabled?: boolean }Defines options for the KHR_materials_fuzz extension.
-
Optionalenabled?: booleanDefines if the extension is enabled
-
-
OptionalKHR_materials_ior?: { enabled?: boolean }Defines options for the KHR_materials_ior extension.
-
Optionalenabled?: booleanDefines if the extension is enabled
-
-
OptionalKHR_materials_iridescence?: { enabled?: boolean }Defines options for the KHR_materials_iridescence extension.
-
Optionalenabled?: booleanDefines if the extension is enabled
-
-
OptionalKHR_materials_pbrSpecularGlossiness?: { enabled?: boolean }Defines options for the KHR_materials_pbrSpecularGlossiness extension.
-
Optionalenabled?: booleanDefines if the extension is enabled
-
-
OptionalKHR_materials_sheen?: { enabled?: boolean }Defines options for the KHR_materials_sheen extension.
-
Optionalenabled?: booleanDefines if the extension is enabled
-
-
OptionalKHR_materials_specular?: { enabled?: boolean }Defines options for the KHR_materials_specular extension.
-
Optionalenabled?: booleanDefines if the extension is enabled
-
-
OptionalKHR_materials_transmission?: { enabled?: boolean }Defines options for the KHR_materials_transmission extension.
-
Optionalenabled?: booleanDefines if the extension is enabled
-
-
OptionalKHR_materials_unlit?: { enabled?: boolean }Defines options for the KHR_materials_unlit extension.
-
Optionalenabled?: booleanDefines if the extension is enabled
-
-
OptionalKHR_materials_variants?: {
defaultVariant?: string;
enabled?: boolean;
onLoaded?: (controller: MaterialVariantsController) => void;
}Defines options for the KHR_materials_variants extension.
-
OptionaldefaultVariant?: stringSpecifies the name of the variant that should be selected by default.
-
Optionalenabled?: booleanDefines if the extension is enabled
-
OptionalExperimentalonLoaded?: (controller: MaterialVariantsController) => voidDefines a callback that will be called if material variants are loaded.
-
-
OptionalKHR_materials_volume?: { enabled?: boolean }Defines options for the KHR_materials_volume extension.
-
Optionalenabled?: booleanDefines if the extension is enabled
-
-
OptionalKHR_materials_volume_scatter?: { enabled?: boolean }Defines options for the KHR_materials_volume_scatter extension.
-
Optionalenabled?: booleanDefines if the extension is enabled
-
-
OptionalKHR_mesh_quantization?: { enabled?: boolean }Defines options for the KHR_mesh_quantization extension.
-
Optionalenabled?: booleanDefines if the extension is enabled
-
-
OptionalKHR_node_hoverability?: { enabled?: boolean }Defines options for the KHR_node_hoverability extension.
-
Optionalenabled?: booleanDefines if the extension is enabled
-
-
OptionalKHR_node_selectability?: { enabled?: boolean }Defines options for the KHR_selectability extension.
-
Optionalenabled?: booleanDefines if the extension is enabled
-
-
OptionalKHR_node_visibility?: { enabled?: boolean }Defines options for the KHR_node_visibility extension.
-
Optionalenabled?: booleanDefines if the extension is enabled
-
-
OptionalKHR_texture_basisu?: { enabled?: boolean }Defines options for the KHR_texture_basisu extension.
-
Optionalenabled?: booleanDefines if the extension is enabled
-
-
OptionalKHR_texture_transform?: { enabled?: boolean }Defines options for the KHR_texture_transform extension.
-
Optionalenabled?: booleanDefines if the extension is enabled
-
-
OptionalKHR_xmp_json_ld?: { enabled?: boolean }Defines options for the KHR_xmp_json_ld extension.
-
Optionalenabled?: booleanDefines if the extension is enabled
-
-
OptionalMSFT_audio_emitter?: { enabled?: boolean }Defines options for the MSFT_audio_emitter extension.
-
Optionalenabled?: booleanDefines if the extension is enabled
-
-
OptionalMSFT_lod?: { enabled?: boolean; maxLODsToLoad?: number }Defines options for the MSFT_lod extension.
-
Optionalenabled?: booleanDefines if the extension is enabled
-
OptionalmaxLODsToLoad?: numberMaximum number of LODs to load, starting from the lowest LOD.
-
-
OptionalMSFT_minecraftMesh?: { enabled?: boolean }Defines options for the MSFT_minecraftMesh extension.
-
Optionalenabled?: booleanDefines if the extension is enabled
-
-
OptionalMSFT_sRGBFactors?: { enabled?: boolean }Defines options for the MSFT_sRGBFactors extension.
-
Optionalenabled?: booleanDefines if the extension is enabled
-
load All Materials
If true, load all materials defined in the file, even if not used by any mesh. Defaults to false.
load Morph Targets
Defines if the loader should load morph targets. Defaults to true.
load Node Animations
Defines if the loader should load node animations. Defaults to true.
NOTE: The animation of this node will still load if the node is also a joint of a skin and loadSkins is true.
load Only Materials
If true, load only the materials defined in the file. Defaults to false.
load Skins
Defines if the loader should load skins. Defaults to true.
Abstractlogging Enabled
If true, enable logging for the loader. Defaults to false.
Optional Abstracton Camera Loaded
Callback raised when the loader creates a camera after parsing the glTF properties of the camera.
Optional Abstracton Material Loaded
Callback raised when the loader creates a material after parsing the glTF properties of the material.
Optional Abstracton Mesh Loaded
Callback raised when the loader creates a mesh after parsing the glTF properties of the mesh. Note that the callback is called as soon as the mesh object is created, meaning some data may not have been setup yet for this mesh (vertex data, morph targets, material, ...)
Optional Abstracton Parsed
Raised when the asset has been parsed
Optional Abstracton Skin Loaded
Callback raised when the loader creates a skin after parsing the glTF properties of the skin node.
Optional Abstracton Texture Loaded
Callback raised when the loader creates a texture after parsing the glTF properties of the texture.
Optional Abstracton Validated
Callback raised after the asset is validated.
preprocess Url Async
Function called before loading a URL referenced by the asset. Setting this function allows parent-relative asset URIs and makes the callback responsible for URI safety.
Type Declaration
-
- (url: string, rootUrl?: string): Promise<string>
-
Parameters
- url: string
The URL referenced by the asset
OptionalrootUrl: stringThe root URL of the asset, if available
Returns Promise<string>
A promise that resolves to the URL to load
- url: string
skip Materials
If true, do not load any materials defined in the file. Defaults to false.
target Fps
When loading glTF animations, which are defined in seconds, target them to this FPS. Defaults to 60.
transparency As Coverage
Defines if the Alpha blended materials are only applied as coverage. If false, (default) The luminance of each pixel will reduce its opacity to simulate the behaviour of most physical materials. If true, no extra effects are applied to transparent pixels.
use Clip Plane
Defines if the loader should also compile materials with clip planes. Defaults to false.
use Gltf Texture Names
If true, the loader will derive the name for Babylon textures from the glTF texture name, image name, or image url. Defaults to false. Note that it is possible for multiple Babylon textures to share the same name when the Babylon textures load from the same glTF texture or image.
use Max Morph Target Influencers
When loading a mesh with morph targets, configure its MorphTargetManager so the morph shader is compiled
once for all targets (numMaxInfluencers = numTargets, optimizeInfluencers = false). This prevents the
shader from being recompiled (and the resulting one-frame visual glitch) when an animated morph target
influence passes through zero and the active influencer count changes.
Disable to restore the previous behavior, where only the currently active (non-zero) influencers drive the
shader. That is cheaper per frame for meshes with very large morph target counts, but recompiles the shader
during animation. Defaults to true.
Experimentaluse Open PBR
Load the glTF files using the OpenPBR material.
use Range Requests
Defines if the loader should use range requests when load binary glTF files from HTTP. Enabling will disable offline support and glTF validator. Defaults to false.
use SRGB Buffers
If true, load the color (gamma encoded) textures into sRGB buffers (if supported by the GPU), which will yield more accurate results when sampling the texture. Defaults to true.
validate
Defines if the loader should validate the asset.
Base class for glTF loader options that supports copying values from a partial options object.