Need help with the Maths of these nodes

Please help me check out the Maths of these nodes.

I’m combining the Shader Nodes and Geometry Nodes to create something.
This “Multiple Boxes” object is using Geometry Nodes to assign “Individual Box” object as instances on it.

Now, I use Shader Nodes for scaling, my intent is to scale the boxes larger along x and y axes (in other words, scale them horizontally). So, whenever that black line on the boxes is at (by sliding the red node here:


, the boxes will be scaled larger there.
Like this (for example):
image

The problem is, it doesn’t work out the way I expected:
image

Comparing the failed version and the desired version:
image

The desired version is done without Geometry Nodes, it’s just 5 boxes being copypasted manually.
The failed version uses Geometry Nodes, so I suspect that the problem comes from Geometry Nodes instead of Shader Nodes.

Here’s the Blender file:
ask-scale.blend (1.3 MB)

Thank you for any help!

I think the problem is that the material is calculated to map onto the geometry (not the other way around), the shader is calculated after the geometry.

You should find a way to scale the instances in geometry nodes instead of trying to use displacement in the material.

1 Like

Thank you!

My intent was not for scaling, scaling here is just an example. I initially wanted to transition between 2 materials (which also involves Vector Displacement), which is less effective to be used as an example and question. So, I still need to use Shader Nodes.

I still need help to fix my Geometry Nodes. I know Shader Nodes but Geometry Nodes is still quite new and unfamiliar to me.

I edited my answer because the material was displacing the instances individually, but “all together” if that makes sense.

Maybe this is more like what you expected, I realized the instances and gave the object your material (no need to set material)

1 Like

I think you have to do that in the shader editor, Blender can not mix 2 materials but you can mix 2 shaders.

2 Likes

I haven’t yet read your reply, but are you aware of this potential bug? I disconnected the Material Node in Geometry Nodes but the material is still applied to the instances:

File:
ask-scale.blend (1.4 MB)

You need to switch to solid view and then back to rendered view for that to update, the shaders have already compiled and you have to recompile them

2 Likes

Sorry Joseph was right.

1 Like

Thank you, it doesn’t work though. I’m trying to screen record.

@DNorman
@joseph

It would remove the material on the instances as soon as I disconnected the Material Node 5 minutes ago, that’s when I would still able to remove the material. Now the material gets stuck with the instances.

But I don’t think it matters much, just wanted to inform you about it.

Yes it happened to me too (which is why I said thought the instance had the material) but then went away, I think Joseph is right.

1 Like

Hey, why did you send me the project that we discussed 2 days ago lol.

Sorry It was a mistake (they both start with “Ask”) :rofl:

ask-scale2.blend (140.4 KB)

1 Like

I opened your original file and the object you are instancing does have the material, to get rid of it get rid of the material in the “individual box” object.

1 Like

Yes awesome, it is closer to what I want to achieve, the scaling now fortunately follows the black line.

But can you let them all scale along the Global X and Y axes? Each of them currently is scaling with respect to their own Local X and Y axes.

Actually I’m not sure if I need you to do that.
I can’t think straight now. Please pardon me, Imma take a 2 hours nap, it’s 1AM here. I’ll be back to discuss a bit later.

Back to what I think your goal is you should probably do it with the shader not in the geometry node setup.

Displace.blend (161.5 KB)

2 Likes

Hi!
Sorry, I overslept.

May I ask what was the difference in the Geometry Nodes set up between your file (ask-scale2.blend) and my file (ask-scale.blend)?

I was trying to see where my mistake could have been but both setups look the same.
Could you please point out what I did wrong and explain the intuition of it?

The only difference is that I set the material at the end, the material is displacing the object not the geometry nodes,

Edit:
I also realized the instances

I used object cords in the material (but it is the same as using the position from the geometry node)

1 Like

Yes, I’m aware, but what messed up the result was something in the Geometry Nodes setup.

I pointed out in my post that:
The desired version is done without Geometry Nodes, it’s just 5 boxes being copypasted manually.
The failed version uses Geometry Nodes, so I suspect that the problem comes from Geometry Nodes instead of Shader Nodes.
image

Oh that’s weird.
In the new file (ask-scale2.blend), I can’t find the things that you did, including “setting material at the end” and using “Object Texture Coordinate” in Shader Nodes.
The nodes look the same as the ones in my file, but somehow the result got right.

Could you please take a screenshot? I’m afraid that this might be a bug, again.