{
  "id": 16439736,
  "title": "Three.js Terrain Scatter: Fix Floating, Then Fix Clumping",
  "url": "https://urgent.news/2026/10/25/three-js-terrain-scatter-fix-floating-then-fix-clumping",
  "topic": "tech",
  "section": "Tech",
  "published": "2026-10-25T06:28:33.000Z",
  "source": {
    "name": "Dev.to",
    "slug": "dev-to",
    "url": "https://dev.to/alicia_lu/threejs-terrain-scatter-fix-floating-then-fix-clumping-lif"
  },
  "original_language": "en",
  "account": "This report details the issues of floating terrain instances and their clumping in Three.js, focusing on tests conducted using the Three.js 0.186.1 and three-mesh-bvh 0.9.16 libraries. The experiments were performed on an 80 by 80 metre height field with 4,225 vertices and 8,192 triangles, using a Ryzen 9 9950X processor and an RTX 5070 Ti graphics card. The terrain was created in Houdini and exported to JSON format as a GLB file.\n\nTwo methods of placing instances on the terrain were compared: downward raycasting (both plain and BVH accelerated) and the MeshSurfaceSampler. The BVH accelerated raycasting method showed a significant reduction in placement time, with median CPU placement times of 2.5-10.2 milliseconds for 1,000 points and 10,000 points, compared to 218.0-2,047.9 milliseconds for plain raycasting. However, the BVH method did not improve the distribution of instances, as both methods still produced clumping.\n\nThe MeshSurfaceSampler, which samples the geometry's attributes, showed a median nearest-neighbor distance of 0.369 meters at 10,000 points, with a significant number of points having neighbors closer than 0.5 meters. This indicates that the sampler does not guarantee separation of instances on the terrain surface.",
  "summary": "AI-assisted disclosure: Codex assisted with research, code and writing. Measurements, failure cases and limitations are retained from the original article. Originally published by Alicia on 2026-10-25: Digital Garden by Alicia . Putting an instance on the terrain and keeping it away from its neighbors are separate jobs. In this desktop test, ordinary downward raycasting and its BVH accelerated…",
  "key_points": [
    "BVH accelerated raycasting reduces placement time significantly",
    "MeshSurfaceSampler does not guarantee separation of instances",
    "Both methods produce clumping of terrain instances"
  ],
  "editors_take": "The persistent clumping issues across both raycasting and MeshSurfaceSampler methods indicate that current Three.js workflows still struggle to ensure uniform instance distribution on complex terrain surfaces.",
  "illustration": null,
  "coverage": {
    "outlets": 1,
    "also_reported_by": []
  },
  "ai_generated": true,
  "disclaimer": "Summaries, key points and the editor’s take are written by software from other outlets’ reporting and may contain errors — always check the linked original."
}