#Implementation of the Flow Field Ribbon

28 messages · Page 1 of 1 (latest)

strong mountain
fiery sand
#

my guess is one subdivided plane per ribbon.

You could do it with instances, but you'd have to do a lot of work to get them to join together smoothly.. and there wouldn't be much point to sending a matrix per quad vs just 2 vertices per rib in a ribbon

still tide
strong mountain
#

Oh my goodness, this is really complicated.🥲

fiery sand
#

Nah.

new Mesh(new PlaneGeometry(100,1,100,1),new ShaderMaterial({ ... your shader stuff here ... })

fiery sand
strong mountain
#

In spite's code ,He uses an invisible line (keypoints—position, normal, tangent—from points), but I find his naming conventions a bit odd. I think it would be more intuitive to use the tangent to describe the direction the point is moving in, and the normal to indicate the orientation of the ribbon’s surface. Then, in the CPU JavaScript, he updates the head point every frame using curlNoise. He uses a queue to remove points from the tail and insert updated ones at the head to update the entire line. He then remaps these points to the vertex attributes of the geometry and uses needUpdate notifications to trigger the update.

fiery sand
#

yeah thespite is on a whole other level.. he's a master of the craft.

fiery sand
#

id have thunk he would do that in the shader.. or maybe w precomputed 3d texture or smth

#

but maybe you're looking at an early demo, like polyshredder?

strong mountain
#

I think so, except that he only generates curl noise at this single point in the head, and then shifts everything back one position using a queue,

fiery sand
#

what app are you looking at?

strong mountain
fiery sand
#

yeah... in that one I guess i can see that.. he only needs to update the head and tail...

strong mountain
#

Yes, the CPU is also very fast.

fiery sand
#

not as fast as a mid range gpu 😄

#

but yeah. relatively fast.

#

thats a really pretty demo

strong mountain
#

Are you using a matrix like this to change the instance's orientation? ```export const lookAt2 = Fn(([dir]: [Node<'vec3'>]) => {
const d = dir.normalize()
const right = cross(d, vec3(0, 1, 0)).normalize()
const up = cross(right, d).normalize()

const rotationMatrix = mat3(right, up, d);
return rotationMatrix
})

fiery sand
#

in what?

strong mountain