Plugin that adds support for Potree point cloud datasets (v1.x and v2.0).
Builds a synthetic additive-refinement tileset and streams point cloud nodes on demand. Each point is sized by the deepest active node at its position, resolved in the vertex shader against a texture encoding the active node hierarchy.
Extends PointCloudEffectsPlugin, so the point shape, size clamping, eye dome lighting and debug color options are available here too.
import { TilesRenderer } from '3d-tiles-renderer/three';
import { PotreePlugin } from '3d-tiles-renderer/three/plugins';
// scene, camera and renderer are initialized here
const URL = 'https://raw.githubusercontent.com/potree/potree/refs/heads/develop/pointclouds/lion_takanawa/cloud.js';
const tiles = new TilesRenderer();
tiles.registerPlugin( new PotreePlugin( {
url: URL,
pointShape: 'sphere',
edlStrength: 0.4,
edlRadius: 1.4,
} ) );
tiles.setCamera( camera );
tiles.setResolutionFromRenderer( camera, renderer );
tiles.group.rotation.x = - Math.PI / 2;
tiles.group.position.set( - 0.85, - 4.87, - 0.65 );
scene.add( tiles.group );
camera.position.set( 4, 2, 7 );
renderer.setAnimationLoop( () => {
camera.updateMatrixWorld();
tiles.update();
renderer.render( scene, camera );
} );On this page
Methods
new PotreePlugin(
// PointCloudEffectsPlugin options plus the ones below.
options?: {
// Url of the dataset metadata file, `cloud.js` for v1 or `metadata.json` for v2. Falls back to `tiles.rootURL`.
url: string | null = null,
// Multiplier on the point size. Can be adjusted after construction.
pointScale: number = 1,
// Whether to set the renderer error target to a value suited to point spacing based geometric error.
useRecommendedSettings: boolean = true
}
)