< voxforge

instanced rendering

VoxForge draws big components as one InstancedMesh per material instead of one mesh per voxel. This benchmark times both paths in plain three.js, on your GPU.

run it

Pick a voxel count and run both modes. mesh gives every voxel its own mesh, geometry and material, which is what React Three Fiber builds for each voxel in components under 512 voxels.instanced groups the voxels into one InstancedMesh per material (8 here), as VoxForge does from 512 voxels up. Picking still hits single voxels, through instanceId; the demo casts the same 200 rays in both modes and counts how many hit the same voxel.

your gpu > starting…

voxels
trials

The full sweep runs every size with 3 trials, like my recorded run; it takes minutes, longer on slower GPUs. Large per-voxel runs can freeze the page for several seconds at a time. Keep this tab in front while it runs.

> ready

Your results, with my RTX 5090's frame times for comparison
voxelsdraw calls
mesh → instanced
frame ms
mesh → instanced
fasteridentical picksmy rtx 5090
frame ms
Nothing run yet.

my results

Recorded 2026-10-23 on my NVIDIA GeForce RTX 5090 (ANGLE, Direct3D 11). Medians of 3 trials; every pick matched (200/200) at every size.

My RTX 5090, three.js 0.184.0 reproduction of both render paths
voxelsdraw calls
mesh → instanced
frame ms
mesh → instanced
build ms
mesh → instanced
512512 → 81.2 → 0.0395.8 → 1.4
4,0964,095 → 89.8 → 0.05032.0 → 1.1
16,38416,384 → 855.1 → 0.131112.2 → 2.8
32,76832,768 → 8135.4 → 0.219222.8 → 4.6
65,53665,536 → 8279.5 → 0.436475.0 → 11.4

At 4,096 voxels one voxel was culled from the per-voxel view, so that row shows 4,095 draw calls.

method

This measures the three.js scene graph only, not the whole app. It leaves out React and R3F reconciliation and pointer events, which add cost mainly to the per-voxel path. Your numbers depend on your GPU, browser and graphics backend, so they won't match mine exactly.