5
$\begingroup$

first time poster and Blender novice here. I am trying to use Geometry Nodes in Blender 3.1.2 to extrude subdivided faces of a cube at random to make something like a Borg Cube. Then, still using geo nodes, I want to apply a glowing/emissive material to randomly chosen "little cubes" on all 4 of their sides (If they are not chosen by the random number generator then I do not want that extrusion to have any glowing faces. This way it makes it look like some of the small cubes can glow on their sides while others cannot glow at all.) A quick example image of what I have so far:

enter image description here

The problem with that image above is that I am simply scattering glowing faces randomly across the sides of the extrusions. They aren't grouped up in any way. I would really like to group them up based on randomly chose top faces but I am having a hard time mapping the effect. For further clarity if my goal doesn't make sense yet:

enter image description here

Here is my node tree so far: enter image description here

Am I going in the right direction trying to use Transfer Attribute to map the 'Side' output of the Extrude Mesh node to a randomized index of the cube's faces? Is there something wrong with my Index node? Multiplying by it seems to dristribute the emissive material all over, including on my top faces. What nodes should I be using to do this kind of material mapping (if it's possible at all). It seems like I'm just barely missing something and could not find any info on the web after hours of searching and trying all day. I would be so relieved to get some guidance and thoughts.

Lastly, for what it's worth, here is my original node tree set up, with very similar output results as my current:

enter image description here

$\endgroup$

1 Answer 1

6
$\begingroup$

Result:

Final result

result 360

The way I did:

First I separated the extruded faces from the top faces, then, for every four indexes, i got a different ID for the Random Value node that outputs a boolean to the Set Material node, which has the side faces geometry as input. In the end, I joined the top geometry with the sides.

Geometry Nodes

Edit:

No Separate Geometry method:

geometry nodes without splitting

Edit 2: Capture Attribute

Geometry Nodes Capture Attribute method

This method is better because it's not dependent on the face index order, so you can modify the mesh but still know what faces are from the same group.

Here's the result when triangulating the faces before setting the material with the older methods:

Triangulate wrong result

The new method still works when doing this:

Triangulated correct result

$\endgroup$
2
  • 2
    $\begingroup$ Note: The Floor node is not needed since the ID integer input will convert the value to the closest smaller integer. The node is there just for easy logic understanding. $\endgroup$
    – Hulifier
    Apr 26, 2022 at 7:15
  • 1
    $\begingroup$ Can verify this method works! Thanks so much! :) $\endgroup$
    – Xfacter
    Apr 26, 2022 at 16:50

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.