How to drive mix shader factor more efficiently along a curve

Hi, I’m working on this sort of setup

it feels like there is a more efficient way to do that setup, but how? I’ve been spending a bit of time to find a good solution to using the curve factor to drive some mix shader factor, this works but there might be something I might have overlooked.


emit_along_curve.blend (958.7 KB)

1 Like

Splines already have UVs. U is 0-1 along the length of the spline and V is the tangent.

1 Like

Your setup might work with a “normal” curve, but not with the geometry nodes setup audiumn provided, so i think this isn’t what he expected.

I think you have the right idea…

This is my simplified take:


… basically just capturing the factor in GN and doing the animating in Materials.

Good luck!

1 Like

Thanks for the idea, but I think the animation needs to be driven inside geonodes, I added a video of animation I’m working on in my initial comment.

Thanks, yeah I initially tried to do the smooth factor variation inside the geonodes but it resulted in a choppy animation, the color ramp indeed has to be inside the shader or the effect doesn’t look very good. I will swap wrap for modulo like you did though, otherwise it gives strange results.