v0.5.3
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.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.
0.5.1
Added
- Add a "tile" reference to tile mesh
userDatafield. - MVTAnnotationsDriver: add an optional "settle raycast" function
- Exports for default queues, caches.
Fixed
- MVTGlyphAtlasTexture: Fixed a case where glyph uvs woudl be incorrect after resizing, resulting in garbled text labels.
- MVTAnnotationsPlugin: Run settling and screen occupancy updates in an idle callback if there is remaining work.
- MVTAnnotations: Remove hard coded earth constants used during line parsing
- TilesRenderer: "active" tiles now have the parent explicitly assigned to the tiles renderer group without being added as children to ensure the tile mesh world matrices account for it.
- Traversal: Filter additive tile children using the parents geometric error to avoid loading and rendering too many children.
- EXT_structural_metadata plugin: Fix case where buffers were not decompressed before being read.
- DebugTilesPlugin: Initialize wireframe with a correct default.
Changed
- TilesRenderer: Added "toJSON" to tile instances to avoid cyclic references during serilization.