1
$\begingroup$

In a geometry node thing i'm making there is a part where i change the texture of the planes based on wich objects in the different collections is closer and it mostly works. Each object also has a falloff parameter (determines how quick the transition to other colors is) and when 2 objects in a collection have 2 different falloff values the planes in between them dont pick the highest value because they are closer to the 'weaker' object. How can i get the highest influence value of all the objects in the collection. (If for example an object closer to a plane has after calculating it based on the distance an influence of 1 and one further away has an influence of 3 because it has a higher 'strength' it should return 3)

here are some pictures of what i have now (the 2 spheres in the middle are for the blue texture and as you can see there is a line between them because the left one has a smaller falloff which causes the planes closer to the middle of the 2 to have a lower value than if the left sphere wouldnt be there)

I tried to just put an index node in the sample index nodes instead of the sample nearest together with an attribute statistic node to get the max calculated value for each point but i couldn't get that to work.

I hope i make some sense and thanks in advance.

wrong

nodes

This is how it should sort of look like when it is working properly ↓

right

New contributor
lolboer9999999 is a new contributor to this site. Take care in asking for clarification, commenting, and answering. Check out our Code of Conduct.
$\endgroup$

1 Answer 1

2
$\begingroup$

Proximity functionality in geonodes unfortunately doesn't support weighted distance, but for 2D checks you can use the third dimension to manipulate raycasting on cones:

Imgur mirror (SE image hosting has problems)

The above setup spawns cones with resolution of 128 vertices (should be enough for most purposes but you may want to reduce it for performance), and normally you would raycast down to find the nearest cone to get the nearest voronoi cell, but scaling the cones will have the weighting behavior:

Imgur mirror

So I scale the cones based on empty height, move all cones tips to $z=0$ and at the end move them a little lower as the grid is on $z=0$ of course and I raycast down. Here I'm randomizing colors per cone but obviously you could sample cone index or position or whatever.

Final result:

Imgur mirror

4.3

$\endgroup$
1
  • $\begingroup$ Also consider how you don't need to use cones and could get nonlinear falloff with e.g. spheres $\endgroup$ Commented 41 mins ago

You must log in to answer this question.

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