v0.5.4
3d-tiles-renderer
Enables streaming and rendering of massive 3D datasets with adaptive level-of-detail for architecture and geospatial applications worldwide.
visualizationgeospatialarchitecturestreamingnasa
import { Color, FogExp2, Group } from 'three';
import { TilesRenderer, EnvironmentControls } from '3d-tiles-renderer/three';
import { TilesFadePlugin } from '3d-tiles-renderer/three/plugins';
// scene, camera and renderer are initialized here
// the terrain and the sky dome are separate tilesets
const URL = 'https://raw.githubusercontent.com/NASA-AMMOS/3DTilesSampleData/master/msl-dingo-gap/0528_0260184_to_s64o256_colorize/';
scene.background = new Color( 0xd8cec0 );
scene.fog = new FogExp2( 0xd8cec0, 0.0075 );
camera.position.set( 20, 10, 20 );
camera.lookAt( 0, 0, 0 );
camera.far = 4000;
camera.updateProjectionMatrix();
// controls for moving over terrain
const controls = new EnvironmentControls( scene, camera, renderer.domElement );
controls.minZoomDistance = 2;
controls.cameraRadius = 1;
controls.enableDamping = true;
// the data is stored Z up
const group = new Group();
group.rotation.x = Math.PI / 2;
scene.add( group );
const tilesets = [ 'colorize', 'sky' ].map( name => {
const tiles = new TilesRenderer( `${ URL }0528_0260184_to_s64o256_${ name }/0528_0260184_to_s64o256_${ name }_tileset.json` );
tiles.registerPlugin( new TilesFadePlugin() );
tiles.setCamera( camera );
group.add( tiles.group );
return tiles;
} );
renderer.setAnimationLoop( () => {
controls.update();
camera.updateMatrixWorld();
for ( const tiles of tilesets ) {
tiles.setResolutionFromRenderer( camera, renderer );
tiles.update();
}
renderer.render( scene, camera );
} );Install
npm install 3d-tiles-rendererChangelog
0.5.4
Added
- TilesFadePlugin: Add a Babylon.js tile fade plugin, available from "3d-tiles-renderer/babylonjs/plugins".
- TilesFadePluginBase: Export the shared fade plugin base class from the core plugins so fade plugins can be implemented for other engines.
- Support for PlayCanvas integration.
- PointCloudEffectsPlugin, PointCloudMaterial: Add "maxPointSize", a cap on the projected size of attenuated points in pixels, defaulting to 50 like Potree. Zero leaves them uncapped.
- ImplicitTilingPlugin: Add support for subtree files in the json format.
Fixed
- Traversal: Fix additive tilesets with external tileset or implicit subtree content rendering nothing once the root meets the error target. The additive parent error skip now only applies when the parent has renderable content, as in CesiumJS.
- Traversal: Mark empty "ADD" tiles as active and report empty tiles as visible on the same terms as renderable ones, fixing TilesFadePlugin never fading tiles below empty parents.
- ImageOverlayPlugin: Fix tile splitting stalling on leaf tiles with a low geometric error, leaving the overlay capped at the terrain resolution.
- PotreeLoader: Fix Potree 1.8 datasets failing to load, whose cloud.js lists point attributes as objects rather than names.
- PotreeLoader: Throw when a hierarchy or node file fails to download instead of decoding the error response as points.
- PotreeLoader: Throw a descriptive error for Potree 1.x datasets with LAS / LAZ node files and Potree 2.0 datasets with BROTLI encoding, which were requested as ".bin" and decoded as uncompressed data.
- PointCloudEffectsPlugin, PointCloudMaterial: Honor "sizeAttenuation = false", drawing points at "size" pixels as PointsMaterial does, and preserve the flag from the material being replaced.
- BatchTable: Fix "getDataFromId" returning a single number for VEC2, VEC3, and VEC4 binary properties.
- SUBTREELoader: Fix subtree parsing slowing quadratically with bitstream size.
- UnloadTilesPlugin: Fix tiles that are hidden and shown again being dropped from the GPU memory estimate and never unloading.
0.5.3
Added
- PotreePlugin: Add plugin for loading Potree point cloud datasets (v1.x and v2.0) with per point level of detail sizing.
- PointCloudEffectsPlugin: Add plugin for point cloud display options, including point shape, minimum point size, and eye dome lighting.
- MVTAnnotationsPlugin: Add support for changing "resolution" after initialization.
- GlobeControls: Adjust the globe controls to use stable orientation during rotation.
- TilesRenderer: Add "surface" field describing how cartographic values map onto the displayed tile geometry, defaulting to the ellipsoid.
- ProjectedSurface: Add a surface definition for tile geometry flattened onto a projected plane.
- GeneratedSurfacePlugin, TerrainRGBMeshPlugin: Add "projection" option to select the displayed surface shape, including displaying planar content in a different projection than it is stored in. Deprecates the "shape" option.
- ProjectionScheme: Added support for EPSG:8857, equal earth projection.
- TilesRenderer: Add "stats.refused", the number of tiles the last update could not queue for loading because the cache was full.
Fixed
- ImageOverlayPlugin: Fix overlays added without an explicit order being assigned an order of NaN.
- GeoJSONOverlay, MVTOverlay: Fix transparent seams along tile edges at high zoom levels caused by canvas transform precision.
- LRUCache: Fix "unloadUnusedContent" looping forever when fractional byte sizes cause the tracked total to drift above the summed item sizes. Byte sizes are now rounded to integers.
- MVTAnnotationsPlugin: Fix line features without a name or id sharing an id, causing them to be merged.
- MVTAnnotationsPlugin: Fix a crash when a tile visibility event is dispatched after the tile has been disposed.
- MVTGlyphs: Fix "update" throwing when called before the glyphs have been rendered for the first time.
- MVTGlyphAtlasTexture: Fix "drawChar" centering glyphs using the previously assigned canvas font.
- MVTGlyphAtlasTexture: Fix SVG icon outlines rendering at half the width of text outlines for the same "strokeWidth".
- TerrainLambertMaterial: Fix dark lines along tile edges when the terrain is viewed from above.
- BatchedTilesPlugin: Fix bug where tiles were not transformed properly before being added to the batched mesh instance.
Changed
- MVTAnnotationsPlugin: The driver's render group is only mounted under the tiles group if it has not already been parented elsewhere.
- Traversal: Skip recomputing the view error for tiles that are only visited to update their frame state, significantly reducing traversal time.
- MVTAnnotationsPlugin: Improve performance when removing the road labels of an unloaded vector tile.
- ImageOverlayPlugin, MVTAnnotationsPlugin: Map draped textures and annotations through "TilesRenderer.surface" so they support flattened, projected surfaces.
- QueryManager: Deprecate the r3f QueryManager class.
- GeneratedSurfacePlugin: Deprecate "getCartographicFromPosition" and "getPositionFromCartographic" in favor of the "TilesRenderer.surface" functions.
0.5.2
Added
- TerrainRGBMeshPlugin, TerrariumMeshPlugin: Add support for terrarium and terrain rgb formats.
- TilesRenderer: Dedicated queues for each host to avoid blocking on slow servers
- RasterElevationSamplingPlugin: Add plugin to examples to rasterize tiles to a texture, sample elevations.
- MVTAnnotationsPlugin: Add preload for MVT content if region bounding volume is available.
- MVTAnnotationsPlugin: Add support for calling "sampleCartographicElevation" from a plugin to perform a fast altitude fetch.
- MVTAnnotationsDriver: Add support for "sampleCartographicElevation".
- PriorityQueue: Add support for passing an abort signal for an object.
- MVTAnnotationsPlugin: Expose "maxSettleTimeMs" and "maxOccupancyUpdateTimeMs" for adjusting processing time.
- MVTAnnotationsPlugin: Add "horizonCutoff" to trim annotations at a distance.
- TileRenderer: Add a set of experimental error falloff parameters.
- MVTAnnotationsPlugin: Spread tile annotation parsing out among multiple frames with an exposed "maxParseTimeMs" setting.
- MVTAnnotationsPlugin: Add a
getAnnotationRankin place ofsortAnnotations - MVTAnnotationsPlugin: Add a
useIdleCallbackoption.
Fixed
- TilesRenderer, TilesFadePlugin: Keep fading-out tiles parented to the tiles renderer group until they are hidden.
- EnvironmentControls, GlobeControls: Fix orthographic camera zoom when adjusting zoomSpeed.
- GeoJSONOverlay: Fix content bounds check treating the normalized tile range as radians, causing every tile to report content.
- MVTAnnotationsPlugin: Adjust plugin to prefetch vector tile content.
- EnvironmentControls, GlobeControls: Fix orthographic camera zoom jumping when zooming into different points when using touch.
- MVTAnnotationsPlugin: Fix case that could stall annotation processing and loading.
Changed
- MVTAnnotationsPlugin: Deprecated
sortAnnotationsfunction in favor ofgetAnnotationRank.