Randomzing Materials using Geometry Nodes

So I’ve made a node tree that takes multiple images and then chooses one randomly to assign onto a sphere. The randomization all works, but there’s one problem. When working in the shader editor, the Image Texture node has a dropdown for which shape you are mapping the image onto. This allows me to choose ‘Sphere’ and it works extremely well. But the Image Texture node in Geometry nodes does not have these options to choose from, which makes it so that the material just sucks. I would use attributes names, but there are two problems. One, there isn’t a plug in for that drop down so I wouldn’t be able to access the info. Second, the attribute names that are avaliable in the shader editor only go from Geometry Nodes to Shader not the other way around. Is there some way that someone knows of to make it so that the image maps correctly onto the sphere? Or to make it so that I can to attribute names from Shader to Geometry Nodes? Thanks!


Does this have to be done within geonodes? couldn’t you just have the material stuff done in the shader nodes?

1 Like

@Eldyn

Hi, One way you could do it, is by making a switch in material node and an attribute from geonodes.

Hope that helps.

1 Like

Very similar to AlphaChannel's one, using the object info random, and setting the material to the instances.

the shader nodes do the image picking

1 Like

Ah yes, that’s exactly what I need. For some reason it didn’t cross my mind to use the mix RGB as a switch. Thank you!
And thanks @DNorman as well for the help!

2 Likes

Hi,

Ok cool, there is another way, which would be to put all yr images in a big row, and use the mapping node with an X offset controlled by geonodes (just like a spritesheet for games), a little simpler to setup in the material editor.

However all your images will have to be the same size.