PointsMaterial
Quick answer
PointsMaterial controls the size, color, texture, and distance attenuation of Points primitives. Set size with sizeAttenuation, supply a map for round or glowing dots, and adjust blending and depthWrite so dense clouds composite cleanly. vertexColors reads per-vertex color for density or elevation ramps.
new THREE.PointsMaterial ( parameters )
Key points
- sizeAttenuation false fixes point size in screen pixels regardless of depth.
- A radial-gradient map turns square points into soft round dots.
- alphaTest above 0 discards transparent texels and can remove sorting artifacts.
Example
function makeDotTexture(size) {
const canvas = document.createElement('canvas');
canvas.width = canvas.height = size;
const ctx = canvas.getContext('2d');
const r = size / 2;
const gradient = ctx.createRadialGradient(r, r, 0, r, r, r);
gradient.addColorStop(0, 'rgba(255,255,255,1)');
gradient.addColorStop(0.6, 'rgba(255,255,255,0.9)');
gradient.addColorStop(1, 'rgba(255,255,255,0)');
ctx.fillStyle = gradient;
ctx.fillRect(0, 0, size, size);
const texture = new THREE.CanvasTexture(canvas);
texture.colorSpace = THREE.SRGBColorSpace;
return texture;
}
const material = new THREE.PointsMaterial({
size: 6,
sizeAttenuation: false,
map: makeDotTexture(64),
vertexColors: true,
transparent: true,
depthWrite: false,
alphaTest: 0.02
});
const cloud = new THREE.Points(geometry, material);
Notes
- AdditiveBlending saturates to white where many points overlap, destroying density cues.
- Transparent points with depthWrite true hide points behind them unpredictably.
English edition written for Atlaslog. Code is taken from the original Chinese page and runs unchanged.
Atlaslog (2026). PointsMaterial. https://www.jingweizhi.com/en/three/api/points-material.html (accessed 2026-11-03).