Is there a better way to randomize multiple images?

I downloaded this free set of 5 image textures: https://3dsky.org/3dmodels/show/kerranova_slate_1

It came with a UV mapped object to put the tiles on:

I eventually figured out a way to randomly put a different one of the 5 images on each tile along with randomly rotating the images:






Could someone have a look at the attached file and let me know if there’s a better way to achieve this than what I did?

Slate Randomized Material.blend (240.9 KB)

ToDo: make random per island work in EEVEE via Geometry Nodes:

C:\Users\thinsoldier\Downloads\3D Downloads\3dsky.org Downloads\_work in progress\_slate texture kerranova\Slate

1 Like

BlenderGuru has a tutorial about randomizing tiled images: https://www.youtube.com/watch?v=-VgtSL5ZpYc

That’s a single tiled image. I have 5 images of different literal tiles (bathroom tiles, floor tiles) that are not meant to be seamlessly tiled.

Bump? Anyone? Anyone? Bueller?

Have you tried making 5 materials and then just using a Set Material Index node in Geometry nodes driven off of a Random Value Node?

(Example uses 3 materials)

Good luck.

Edit: sorry, guessing this isn’t ideal as you want the tiling to happen in the shader and not the geometry…

2 Likes

and why doesn’t Default Cube’s video help you?

Nah, i don’t care where it happens. I just want it to be faster and easier to setup and using Geometry Nodes looks like a much easier and faster solution. Thanks.

Tile all your images in the same image, and randomize the UV locations. You can use the shader nodes or the geo nodes for that.

1 Like

We need a case select node, everywhere. I’m doing a lot of “choose random image” in my work and the setup it just way too messy.

2 Likes

Following that discussion we had on the other thread, I created this node group that allows you to mix 10 different textures for a single material using the object info “random” output as source for the mix.

You just need to remember to connect the textures and tell the node group how many textures you are mixing. The node group is in the material applied to the Suzanne head.

I hope you find it useful somehow. @piranha4D, I invite you to see if the solution is elegant enough. :joy::joy:

random material and nodes.blend (193.7 KB)

4 Likes

I want to pile up some leaf debris in the corners. I downloaded some autumn leaves from 3dsky but once again I need a way to randomize which image texture gets used on each leaf.

The way I did this before is a royal pain.

1 Like

– moved to sketchbook –

1 Like

Just a stupid question, Why can’t you use the random factor in the shader editor just to randomize the textures? Is it necessary to create different materials?

Good work!

For a Shader, a pixel is the most primitive element, for Geometry, a vertex is. So, for a Shader, per-pixel, you can infer a coordinate-value on the 4-vertex plane through interpolation (sample per-pixel)… In GN, when distributing points on a 4-vertex plane, you just have the one face (sample per-face).

So, in GN, to increase your sampling space, you either need to fist distribute points, then delete (since each new point is now its own sample), or alternatively subdivide the face (to make more faces to sample).

Yes, other programs have this issue of “sampling context” also. A new Sample UV Surface node has been introduced in 3.4 Alpha, but even that will require a points distribution method other than “Distribute Points on Face”.

Good luck!

4 Likes

I am not aware of any way to choose from a list of different texture files in a single material based on a random value.

Basically making a sequence of mix nodes and using ramps or math nodes to create a sequence of boolean values to control the mixes.
I don’t know how to explain better. Maybe this image could help. Here I have just 3 different textures, but that could be much more. A math node with greater than or less then could perfectly do the job, I think. I never tried.

1 Like

That is similar to what I did before:

It is annoying.

1 Like

I think its fun. Hahahahaha…

Anyway, it’s always possible to create a nice node goup to automate this kind of need and make it easier for the future.

– moved to sketchbook thread –

1 Like