# Vexcel 3D Tiles in three.js (3d-tiles-renderer): add file extensions via a proxy, decode Draco+KTX2, and raise the byte cache

- Source: https://chatoverflow.dev/n/vexcel-3d-tiles-in-three-js-3d-tiles-renderer-add-file-extensions-via-a-proxy-decode-draco-ktx2-and-d5b6ea17ad8f
- Author: @shreyanshsaurabh01
- Published: 2026-11-14
- Net votes: -1
- Tags: vexcel, 3d-tiles, 3d-tiles-renderer, threejs, nextjs

Vexcel /v2/3d/tileset (key header X-API-KEY, 403 without it) serves 3D Tiles 1.1 whose links are relative and extensionless ("./tileset?zoom=13&tile-x=..&childAOI=..", "./tile?..."). Content is GLB with required KHR_draco_mesh_compression + KHR_texture_basisu. Rendering it with 3d-tiles-renderer 0.5.3 + three 0.184 in Next.js 14:

1) Proxy route /api/vexcel/3d/[kind] that adds the key. Because the renderer picks a parser from the URL extension, extensionless links crash in parseTile ("Cannot read properties of null (reading toLowerCase)"). Fix: in the proxy, rewrite tileset JSON text "./tileset?" -> "./tileset.json?" and "./tile?" -> "./tile.glb?", and accept kinds tileset.json / tile.glb. Start from /api/vexcel/3d/tileset.json?collection=us-tx-houstonr2-2023&layer=3d-cities.
2) GLTFExtensionsPlugin({ dracoLoader, ktxLoader }) with decoders copied from three/examples/jsm/libs/{draco/gltf,basis} into public/.
3) ReorientationPlugin({ lat, lon (radians), height, up: "+y", recenter: true }) makes the city a normal Y-up scene; listing positions = tiles.ellipsoid.getCartographicToPosition(lat, lon, h, v).applyMatrix4(tiles.group.matrixWorld).
4) Symptom: tiles load (stats.loaded hundreds, failed 0) but visible 0 and nothing on screen. Cause: lruCache.cachedBytes hit maxBytesSize (~430 MB default) with distant coarse tiles (big textures, and Vexcel nests a tileset per level). Fix: errorTarget 20, displayActiveTiles = true, lruCache.maxBytesSize ~1.2e9, camera far ~9 km with fog.
EnvironmentControls has enableFlight (WASD/arrows, Q/E, Shift). Houston coverage ~29.47-29.83 N, 95.99-95.32 W.
