Need help with the Maths of these nodes

One of the problems was that in your original file the object you were instancing had the “ball fruit” material so the material was displacing the original instance and effecting all the instances (before the geometry nodes).

Sorry not quite true

From your original file I got rid of the material in your “individual box” and realized the instances in the geometry node setup.

1 Like

Oh you mean that version (I thought you meant the green and red one the last version)

Ok in that one I did not get rid of the material in the “individual box” bit I did realize the instances which is why it works. Once they are realized they are no longer separate instances and the displacement acts on the whole thing (not each instance separately)

1 Like

I’ve got you.

Actually, here’s what I’m working with initially, please help me with it if you don’t mind:

The intent is, wherever I slide the red colored node to, the instances get spiked up and that part is colored darker blue, which exactly is happening with the desired version on the right. And the failed version on the left (without applying the Realize Instances node) still fail to display what I want, as usual.

Here’s what it looks like WITH the Realize Instances node applied:
image

I failed to make sense of what montrousity is happening. Would you mind helping me understand what’s wrong with it?
ask-scale.blend (1.3 MB)

ask-scale.blend (1.3 MB)

There are 2 problems, the displacement is using generated cords so the GN setup is using the bounding box of the whole thing.

The other problem is that as the instances are rotated you get ugly displacement on the corners.

If your goal is the one on the right I would start with a sphere instead of a cube. and scale the generated cords, especially the z axis (although you will not get exactly the same result because the instances are offset.

1 Like

Thanks a lot!

Geometry Nodes and Shader Nodes don’t work well together, it seems. How their Maths work also are vastly different from each other.
I think I should remove the Geometry Nodes and copy paste the balls manually, that way, the balls won’t get messed up by anything in the Geometry Nodes.

It depends on what you do, but in this case you are complicating things.

You should probably try to do the displacement in geometry nodes not in the shader.

You could use an empty to drive the displacement in the Geometry nodes and use the same empty to drive the shader mixing (object cords). But this would still be complex.

I have to go to sleep so good luck!

1 Like

I actually am working on a detailed stuff like this:

When I slide the red node up and down, those instances transform a lot, including rotating, color changing, scaling, translating in a very small detail level, and only in a certain part of each instance.

I’m not familiar with Geometry Nodes, can it do that, can it model objects procedurally in a micro detailed level like that? Assume that it could, then could Geometry Nodes be connected to the same the black-white mask in Shader Nodes so that whenever the black-white mask be adjusted then the data from both SN and GN be affected at the same time?

Good night!

Now I see what you want to do and I predict many problems, you have moved the goal posts to mars!

Geometry nodes are in a very early stage, what we have are low level basic building blocks,
There are people who can do incredible things with them but the node groups are huge and the resulting calculation time too. Take a look at this:

You will see that sozap has worked really hard to get this result and he is not doing “micro” details, the node group screen shot (which is unreadable) will give you an idea of how complex this is. I am nowhere near his level of understanding geometry node/math.

He did not model it all with Geometery nodes, he made pre built petals etc. Geometry nodes are not really suitable for complex modeling. He used them to play with existing geometry.

To do something on this level you would need learn a lot, you will not be able to do it by just asking random questions. The first thing you would have to do is learn the basics, it seams like you are not jumping into the deep end of a swimming pool – you are jumping into the ocean!

If you want true “micro details” you will find that Blender has a hard job dealing with extreme high poly objects (it looks like this would be pretty extreme). I think that something like this with micro displacement could grind Blender to a halt.

To give you an idea of Blenders performance try this file:

HiIshPolyDisplace.blend (1.7 MB)

There are not really “micro” details and on my system adjusting the shift already lags (in this file I destructively subdivided the original sphere because the subdivision modifier also slows things down.

To do something like that procedural I would recommend Houdini, which is the best node based procedural software that exists. Houdini is much more complicated (and powerful) than Blender and it would not be easy!

This project goes over my head, it has been interesting trying to help but I think I have reached the limit.

3 Likes

That’s awesome, thanks for sharing.

Hey, I wanna show off my setup too!
This is Shader Nodes for one instance in my screenshot above, each instance starts from a default cube:


image

But yeah, my Geometry Nodes knowledge is not comparable to you and definitely not to that person you linked.
It’s a shame that Geometry Nodes’ algorithm is too different from Shader Nodes’ algorithm. I don’t think I will ever reach you guys’ levels in GN.

About “micro” details, I think I’m using that word incorrectly. I think I meant generally “small details”. SN has a lot of Mathematical functions which allow displacing very small vectors because Mathematically, numbers are infinitely small.

1 Like

Hey man. Just want to say, thank you.
You were the only person to have been able to help me with my two posts in the last two days.
Without you, I wouldn’t have reached any conclusion for my questions.

GN has not been very nice to me. I guess I will remove the GN from the balls and just copy-paste the instances by hand to prevent GN from ruining my SN.

Hope its Maths and algorithms can match with SN’s more in the future to give me an easier time to learn it.

1 Like

Your forms look beautiful and answer something that was bothering me, “why you were using vector displacement instead of normal displacement”. It looks like you have fair knowledge of vector math already.

I am not sure, maybe it does not fit your calculations but it could be easier to start with a more spherical form in the first place, or a spherised Cube (which is what I used.)

As for geometry nodes, simple operations are no problem like the basic instancing, instance rotation placement etc

The vector math for displacement could also be done in geometry nodes, and probably has more possibilities but one thing to bare in mind is that if you displace in the shader, the calculations are only needed when you render or render preview.
If you try my file in Eevee (Material preview) you will not see actual displacement but it does give you an idea of what is going on (bump) without the lag.

This means that you can edit your file in Eevee or solid and Blender will be much more responsive, only having to add the displacement calculations if you want to preview it in render preview.

You are welcome, I enjoy experimenting and am pleased to have helped.

1 Like

Thanks. I’ve taken notes of everything you taught me.

I once made a topic about Geometry Nodes vs Shader Nodes here.
And looks like you have already been aware of it.

At the time, I didn’t know that GN could procedurally model an object to a very delicate level like SN, for example, SN can rotate vectors, but by using Mathematics, SN allows a lot of controls over the process of rotating vectors that aren’t available in the Vector Rotation node:

  • the intensity of rotation (which vector gets rotated more than the others)
  • the shape of rotation (rotating based on another function, e.g. Sine wave)
  • the pattern of rotation (a wave length of vectors get rotated but the adjacent one does not)

… All of that allow me to create very complicated looking object, just by rotating ALONE.

Such delicacy, such intricacy, all made possible by Shader Nodes. When I made that GN vs SN thread, I thought no way that GN could beat SN in Procedural Modeling. And in response, a few people in that thread got mad at me for underestimating GN.

But I’ve just learnt now that GN can possibly do all of what I thought only SN could do, which is overpowered. Because GN also allows attaching hairs which is impossible with SN.

1 Like

Yes I have been wishing for a long time that the 2 modes would be more compatable.

As it stands many nodes from the shader editor have been “translated” into geometry nodes, I wish they could do it the other way around too.

You can not copy/paste a set of math nodes from one mode to the other (even if they exist in both).

There have also been other node systems with very interesting functions, like animation nodes but each system seems to be alien to the other.

A more generic approach would be great but would probably mean changing a lot of code down the line.

Time will tell.

1 Like

Hi! Someone was able to solve the problem:
modeling - Geometry Nodes messes up Vector Displacement - Blender Stack Exchange

I have no idea what they are doing in that GN setup though. I’m just shamelessly copying the nodes setup now so that I can meet my deadline.

1 Like

That is really cool, what he has done is save the position of each instance, then after realizing the instances he stores those values to the realized geometry, which are now just components of the same mesh (not individual instances).

What I was not aware of is that you can use those multiple positions in that way in the shader material by subtracting the positions from the object position. That is very interesting.

I have to study the shader a bit more to see what is going on, the normalize sets the positions from 0 to 1 for each position, the rest I get a bit lost (the 2 scale and subtract). I will investigate it.

Thank you for posting this is interesting info.

One thing that occurs to me is that you will probably want to use the instance rotation to set the rotation of your displacements, as it stands they all have the same rotation.

Seeing that setup, I would say it is likely that you can set them in a similar way by storing the rotation of the instances and passing that into the shader as-well with the vector rotate node.

Things are looking up :smiley:

1 Like

I think you will like this. :smiley:

I managed to get the rotations into the shader (I checked and they do look correct). the vector rotate node did not help but a simple mapping node did the trick.

It took me a while to work out that I only had to rotate the vector that maps the texture. rotating all the initial vector was messing up the scaling and displacement.

I also added a wave texture and a mix for the displacement, the wave texture shows the rotation well.

This is what I did in the geometry nodes to get the rotation;

The file;
askRotation.blend (141.3 KB)

5 Likes

Thank you!
Sorry, I might have to reply later, I’m getting stuck with my deadline at the moment.