Problems optimizing r3f scene

If you mean literally a few dozen blocks - then there’s likely something essentially wrong with the rendering, maybe you’re using too high of a resolution, or too hardcore postprocessing. You should be easily able to render 1000 cubes, without instancing, at 60fps.

  1. Iirc, by it’s nature <Edges> helper from drei was a bit questionable when it comes to recreating the edge geometries on each state update (ie. it duplicates entire geometry of the original object to create the outline, doubling the amount of workload for the renderer.) I’d first check if removing the edges wouldn’t help.

  2. I’d just skip MeshTransmissionMaterial all together. It looks pretty but it’s slow, and you don’t have anything in the background to show the transmission effect anyways. For what you have in the scene - you should easily be able to just go for MeshLambertMaterial (best), or MeshStandardMaterial (slower, but still faster than transmission material.)

  3. At any given point, only 8-10 cubes are visible. If you’re aiming for 1000s or 100000s of cubes, consider virtualising the scrollable list of cubes.