These are Fat Lines. With a single geometry.
Each line in a group, that forms a tetrahedron, has the same index, that uses in shaders to get data from a texture (texelFetch) to compose a transform matrix.
Data to the DataTexture writes from matrices of an array of Object3D (see them as kind of proxy objects). The texture size is 4 x amount_of_tetrahedra, thus 16 floats (4 x vec4, full data from matrix4) per row.
So just to make sure I understand: normally this would be slow if you were issuing draw calls for every edge (or every disconnected set of edges), but you’re able to batch things here because putting the model matrices into a texture?
This is super cool and super clever, and I’d never come up with it…
but for scenes like this how much more performant is it over batching or even better instancing?
SIDENOTE: These are the FIRST tubular lines I’ve ever seen working…
Most others are tube extrusions or even raymarched and I started to think it wasn’t practical to shade the lines…
Is that just an effect of the bloomPass or could you do a gradient across the fatLine width?
I just realized too “fat lines” may be a “meshline” so maybe that’s why.
I have this “Neon” project super shelved, but I have to use tubes to get the shading right.
All the Line and FatLine setups always render the lines flat…
Oh interesting, I thought you were pushing them onto a dataTexture and then doing the rebuild/processing yourself vs using instancedDrawing or more basic like InstancedBuffers.
I should have been clearer they are “pseudo tubes” where a gradient coloring implies the form.
Vs a tube geometry extruded along the path.
Fatlines have UVs?
What kind of mesh is it? A triangle fan or something?
Clearly I need to read more haha.
The capsule is great, Gsimone got that up quick!
I’m thinking though to do something like your tube endcaps demos floating around and merge geometry with the spherical endcaps.
That way it can still move/be flexible following a spline/etc