I'm trying to convert the direction of a specific set of edges of a shape to point data, so that it is smooth when used in a shader. However I can't seem to figure out this conversion. Here's what my Geonodes are looking like so far:
In this attempt the direction for each edge is calculated with some simple vector math, then a selection of the horizontal edges is made. The edge directions of this selection are fed into an attribute called "horizontals". These "horizontals" are fed directly into a shader. This gives a consistent checkered pattern instead of a smooth gradient like I want. Setting the "Store Named Attribute" node to "Point" makes everything black.
From what I understand this is where sampling can come in handy, however the result is far from desirable:
Here the aforementioned edge selection is used in a "Separate Geometry" node so that it can be sampled. This gives a somewhat messy gradient while it should be smooth. Also, when moving the vertices up and down (no rotating) in Edit Mode there is jittering, making it unreliable.
How do I make this conversion properly?
vector
, and the green arrow points in the directionabs(vector)
, This doesn't look like the relation you probably want. I think you have to come up with a definition of which end of an edge is at the start of your 'direction', and which end is at the end of it. Of course, I might be misunderstanding your intent. $\endgroup$