Vertexless: Line (Fat Lines) + DataTexture + instancing

Hi community!

Here is an attempt to use DataTexture as the source for vertex data for individual instances of Line.

Picture:


10000 instances of 100 points (thus, 1M).
Demo: https://codepen.io/prisoner849/pen/zYLYgyB (r147)

Then, a thought was “why not try to apply the same approach to fat lines?”
And I’ve got two versions. The main difference from the previous approach with lines is you have to fetch a pair of coords per segment (start and end)

6 Likes

Nice result ! It is a bit hard for beginners.
What would be the pros and cons of your solution?

It’s not for beginners at all :slight_smile:

Never thought of this :slight_smile:
Pros: you don’t create buffer attributes.
Cons: you manage all the stuff in vertex shader.

Cons: you manage all the stuff in vertex shader.

Ok I understand it adds complexity to the code

Pros: you don’t create buffer attributes.

Why is it a pro? Is it not nice to have buffer attributes ?

Don’t take my words too serious :slight_smile:
You’re free to use whichever approach, that fits your needs and comfortable to work with.

Don’t take my words too serious :slight_smile:
You’re free to use whichever approach, that fits your needs and comfortable to work with.

Haha I know ! I just try to understand what is explicit for you and implicit for me. I would just like to know what I would earn not using buffer attributes like you mentionned

Nice as allways. For me i see your posted work more as some kind of art that something i could us or understand.

1 Like

For me, this is also art. In two respects. Once from the result :paintbrush: and once from the internal implementation :writing_hand:, especially the shader.

But you can learn certain techniques from it and use them in your own projects. :upside_down_face:

1 Like

Oh, the implementing of it in fat lines was real pain :smiling_face_with_tear: When I simply overlooked, that assigned the same variable to start and end, and got an empty screen with glsl warnings about division by zero, in console. Spent several hours, trying to figure out where is an error. Finally realized, that it’s in my DNA :sweat_smile: