Need help with the Maths of these nodes

Not really, I enjoy playing with them but lack a lot of mathematical skill. The hardest part is to work out in which order you do the math.

Well unfortunately the bounding box of the object that has the geometry node setup is the bounding box of the resulting mesh (the whole stem with all the flowers). Not the individual bounding boxes of the instances. Which was part of the original problem.

That is why we needed to enter the store center points of each flower for the displacement math to work. To store those points on the whole geometry we had to realize the instances. Object cords are much more useful in this case and will stick to the instances as long as you subtract the instance center from them.

In the end I disobeyed your request and changed EVERYTHING.
:stuck_out_tongue_winking_eye:

Well not quite everything I did respect your displacement map……… except I used object cords and deleted a few float mix 0 to 1 nodes that did nothing.

I copied your math nodes from the shader editor into the geometry node setup. It was a lot easier than I expected – I just did copy/paste and it worked !!! I have not tried that for ages it did not used to work. I set up the displacement in GN.

First I made a vertical line of flower instances and realized the geo to be able to displace it.

All the displacement math is done on the flowers without rotation so that all the axis’s work.

Then I turned them back into instances (with the new “Split to instances node”) and did the rotations. There is no need to realize the instances again at the end so it is still only once.

Voila! It works a dream.

I did nearly everything in the GN setup, saved the gradient and the stripes as attributes and the shader looks like this:

All the fun is in G-nodes.

Remember you can get info from GN to shader not the other way around.

Also in GN you have so many more math nodes and rotation possibilities to play with.

Displacement is real it works in Eevee + solid view and renders faster in cycles.

Now I have man eating flowers that look straight out of “the little shop of horrors”.
:tada: :piñata:

AND they open their mouths properly, from the tip of the petals to the stem one after the other (not in a horrible vertical gradient!)

I think this one is killer. You can carry on adding math to the displacement in GN in the same way you were in the shader editor. You can also store more goodies for the shader.

Oh and I added an input outside of the GN to slide the gradient (you can also slide it inside the GN)

Be warned I used the “Split to instances node” you need 4.1 up.

I labeled the frames so you should be able to work it out.

Last but not least the file:

askFinal.blend (1.1 MB)

2 Likes