Atlaslog
Atlaslog / three.js / API reference / PointsMaterial
three.js · API reference

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.

Last verified 2026-11-03 · three.js 0.160.0 · Cite this page
new THREE.PointsMaterial ( parameters )
Key points
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
Runnable examplesChinese originalAll API references
English edition written for Atlaslog. Code is taken from the original Chinese page and runs unchanged.
Cite this page

Atlaslog (2026). PointsMaterial. https://www.jingweizhi.com/en/three/api/points-material.html (accessed 2026-11-03).