8
$\begingroup$

Blender 3.0 . I've made a offsetting geometry instances using geometry nodes(sorry, I had no idea how to explain expect the image below.)

enter image description here

I wanna use the Z value (used for offsetting instances) in the Shading tab so that each instance have a different emission strength value.

How can I get this Z value into my shading tab? Please consider that this value is gonna be different for the instances, I don't want a single value for the emission strength. Thank you

(I'm going for entirely procedural so please avoid manual cheating)

Here's the file. Open it, the two yellow reroutes should be connected.

(edited) Please 3.0 not 3.1 alpha

$\endgroup$
1
  • 1
    $\begingroup$ Added more explanation and the .blend file. Thank you all $\endgroup$
    – Barbod M
    Dec 27, 2021 at 19:01

2 Answers 2

9
$\begingroup$

In Blender 3.1 alpha, you can use this node setup:

enter image description here

Note that is important to set the capture attribute node to instance.

$\endgroup$
7
  • 1
    $\begingroup$ There's no "instance"!!! there's just point, edge, face, face corner and spline. Why is it like that? Are you using 3.0 or higher? $\endgroup$
    – Barbod M
    Dec 27, 2021 at 18:27
  • 1
    $\begingroup$ Yep, newest Blender 3.1 alpha $\endgroup$
    – Chris
    Dec 27, 2021 at 18:43
  • 1
    $\begingroup$ Thanks. I upvoted but not accepted. I hope someone finds a 3.0 solution. $\endgroup$
    – Barbod M
    Dec 27, 2021 at 18:51
  • 2
    $\begingroup$ @BarbodM this should be helpful: blender.stackexchange.com/a/245858/60486 $\endgroup$ Dec 27, 2021 at 19:45
  • 3
    $\begingroup$ With a couple of tweaks his answer is still valid for 3.0. Move the Capture Attribute node to after Realize Instances. Set it to "Face", and do the same to the Output attribute. You could also use "Float" there since you only want the Z, cutting the Separate XYZ from the material. For the Capture input you'll use a Position node with Separate XYZ depending on the data type you chose. Please note the Z data for each object is a gradient based on the surface position in the world, not a solid value tied for each object. You didn't specify what you need in your question. $\endgroup$
    – Rhaenys
    Dec 28, 2021 at 14:26
-1
$\begingroup$

I had a similar problem with Blender 3.1. No idea why, but apparently when you generate new geometry with geometry nodes and don't add the original input at the end, things get weird. See these setups - I just change the connections to "Join Geometry" and depending on that, the attribute either works or it doesn't...

enter image description here enter image description here enter image description here enter image description here

$\endgroup$
2
  • $\begingroup$ It works as it's supposed to. In your first setup the cube is made procedural and no material has been assigned to it, that's why it's not green. Use a set material node at the end of the geometry node setup. and about the join geometry node, it joins all objects to the first object in it's inputs. That's why the material is different in the last two setups. $\endgroup$
    – Barbod M
    Aug 16 at 19:02
  • $\begingroup$ Hey, but I'm setting the material index to 1 in every case. Shouldn't this do the same thing? Also, I remember that the Set Material node didn't work either... I mean, my problem is: the material works, the attribute doesn't. $\endgroup$
    – mik01aj
    Aug 24 at 15:57

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.