2
$\begingroup$

I was trying to follow this tutorial to create a rope using geometry nodes: https://www.youtube.com/watch?v=2VzYMah-nTg And at 10:14 he does a step where he uses the curve parameter factor as a texture coordinate. When I follow this step, and after plugging my coord attribute into the color I get the following result (shaded flat to make the effect a little clearer) : enter image description here And here is the result after using it as a texture coordinate on a wave texture: enter image description here As you can see, there is a segment of the rope where the waves are really squished together.

What I am pretty sure is happening, is that it has a value for each segment in the profile curve, and interpolates between them, and then because the last segment goes from 1 back to 0, because it is a circle, the texture map messes up there. I can sorta fix this problem by increasing the resolution of this circle a bunch, that will just squish this problem area to be really small, but I am planning to have quite a few of these ropes in my scene, so too many vertices is gonna cause problems.

The thing is. It seems to make sense that it does this, considering the steps that are taken in the tutorial, but the strange thing is that I don't see this happening in the tutorial. So, my question... what is Default Cube doing differently? And how could I fix this?

$\endgroup$
0

2 Answers 2

1
$\begingroup$

So, although not a perfect solution, since it is not gonna help in every scenario. I ended up rotating one of the profile curve circles, so that this problem is on the inside of the rope, so that it is not visible.

$\endgroup$
1
$\begingroup$

There's a problem, as you have said, with the linear interpolation of curve parameters over the last section of a cyclic curve. It's from (penultimate -> 0) instead of (penultimate -> 1). The same point is expected to carry 2 values: 0 on the way out, and 1 on the way in.

So this GN setup..

enter image description here

..results in this, when attempting to use the outputs in a shader (same curve, 2 views)..

enter image description here

I think the only fix would be to have access to GN's interpolation algorithm, and carve out a special case for cyclic samples? Which we don't. I'd be happy to be contradicted.

One get-around would be to massively over-sample the curve, to make the interpolation over last segment as small as possible, which I think the tutorial does.. but that's ugly...

Here's another ugly solution, but at least, without the bad segment, and letting the shader do the over-sampling, which it does, anyway. Ugly, because it's stupidly complicated.

  1. A GN group which passes out information about the underlying curve in the vertices of the mesh swept along it, using a hack similar to the one here:

enter image description here

which can be used like this:

enter image description here

  1. Whose outputs can be picked up by a shader in the following way, to find the X and Y of the mesh in 'Curve Space', and derive the V coordinate from it:

enter image description here

obtaining a clean result:

enter image description here

.. I'm hoping someone will give me good cause to delete this answer ... :)

$\endgroup$
1

Not the answer you're looking for? Browse other questions tagged .