3
$\begingroup$

I want the geometry I create in Geometry Nodes to be generated with a Vertex Color gradient that I can use in the object's material.

In this example there are several rectangles, one original, and three more generated at each iteration of the Node Group.

Geometry Nodes iterative stepped gradient across geometry parts

Here's the inside of the Node Group:

grouped Geometry Nodes

As you can see, it's not really doing anything special in its current state. Just recursively creating a new transformed rectangle in each iteration. Brightness is supposed to get added in each iteration too, to step from black (0.0) to white (1.0), but this is not working.

In order to match the example I manually painted, the grayscale values should instead be approximately 0.0, 0.33, 0.66, 1.0.

The other (possibly greater) problem, is that despite being a property of vertices, vertex color appears not to be uniquely linked to each separate island of geometry.

If anyone knows how to do this, please share. I would like to access gradients from mesh vertices within my material, instead of having to make a separate material for each island of geometry. Thanks!

Example .blend file (Made with Blender 3.0.1)

$\endgroup$

1 Answer 1

5
$\begingroup$

There are a few small problems in your node tree:

  • your inputs and outputs are pink (= boolean) but you want to store Fac, which is a float. Boolean are either 1 or 0. No other value.

-> also inputs and outputs of your group node have to be changed

i hope/think, what you want is that?

enter image description here

result:

enter image description here

enter image description here

enter image description here

$\endgroup$
9
  • $\begingroup$ Thank you! The result is looking good! Is there also a way to do this using the Join Geometry node? Or is it only possible using Instance on Points? Because although I kept my example simple, what I ultimately want to do will involve more complex geometries, and I was planning to join them. $\endgroup$
    – Mentalist
    Commented Mar 3, 2022 at 4:21
  • $\begingroup$ You are welcome. I am not sure whether i understand you right. Of course you could do a "join geometry" at the end of my tree - it would work. Or do you mean something different? $\endgroup$
    – Chris
    Commented Mar 3, 2022 at 4:26
  • $\begingroup$ i have no idea now, how it should work because then you would have only one mesh which you cannot "separate" as you can do it with instances. I am sorry. Maybe some other GN pro's know how to do that. $\endgroup$
    – Chris
    Commented Mar 3, 2022 at 4:41
  • $\begingroup$ I've been playing with different node setups. I feel like I'm close. Could you please take a look at my .blend? Join is working, but the gradient is spread across the vertices, without treating each iteration of geometry as having its own "step" value. Maybe the ID Node could be the key? $\endgroup$
    – Mentalist
    Commented Mar 3, 2022 at 6:09
  • 1
    $\begingroup$ maan I just wanna thank you from the bottom of my heart cuz I am doing a light strip with all the individual led controlled by a color ramp and I couldn't find a way to translate the color ramp color to the leds (I just started guessing it prob had smt to do with the index) and after searching for days - I found your answer now and it's the exact solution. Thank you!!! :'D $\endgroup$ Commented May 9, 2023 at 7:53

You must log in to answer this question.

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