hello-worlds
hello-worlds copied to clipboard
Instanced-based Terrain Chunk implementation
Flatten CPU draw-calls of terrain chunks by implementing them as instance geometries. Then, pass the vertex buffer to a shader that uses per-instance uniforms so that each individual mesh can get it's own vertex displacement.
https://protectwise.github.io/troika/three-instanced-uniforms-mesh/
"You can set per-vertex attributes with the usual BufferAttribute and per-instance attributes with InstancedBufferAttribute, the latter using gl.vertexAttribDivisor."
CAVEAT: will only work with geometries with the same number of vertices all the way down. This probably won't work on the #11 RingWorld implementation, which allows for irregular subdivisions.