docsby gkjohnson
Loading Draco and KTX2 compressed tiles
import { DRACOLoader } from 'three/addons/loaders/DRACOLoader.js';
import { KTX2Loader } from 'three/addons/loaders/KTX2Loader.js';
import { TilesRenderer } from '3d-tiles-renderer/three';
import { GLTFExtensionsPlugin } from '3d-tiles-renderer/three/plugins';

const URL = 'https://example.com/tileset.json';
const tiles = new TilesRenderer( URL );
tiles.registerPlugin( new GLTFExtensionsPlugin( {
	dracoLoader: new DRACOLoader(),
	ktxLoader: new KTX2Loader().detectSupport( renderer ),
} ) );
On this page

Methods

new GLTFExtensionsPlugin(
	options?: {
		// Enable the `EXT_structural_metadata` and `EXT_mesh_features` extensions.
		metadata: boolean = true,

		// Enable the `CESIUM_RTC` extension.
		rtc: boolean = true,

		// Additional GLTF loader plugins to pass to `GLTFLoader.register`.
		plugins: Array = [],

		// A `DRACOLoader` instance for Draco-compressed geometry.
		dracoLoader: Object = null,

		// A `KTX2Loader` instance for KTX2-compressed textures.
		ktxLoader: Object = null,

		// A `MeshoptDecoder` for Meshopt-compressed meshes.
		meshoptDecoder: Object = null,

		// Automatically dispose the DRACO and KTX loaders on `dispose()`.
		autoDispose: boolean = true
	}
)