Randomize image texture input Possible?

Lets say you have a folder with 10 different wood textures,
do you know if any way to maybe randomize the input for
the image texture node?

The idea is to focus on building the wood floor by hand with individual
objects but let a random option swap out the image textures.


Object info node - you can use either the object index or random and feed that value into a switcher group (made by you) to pick the texture.

Hi DruBan,

I am not sure if I follow you. How can you use the object index or random with a switcher group?

An OSL Script would work, or if you want it to render on GPU then something like:



The ‘Greater Than’ outputs 1 or 0 (based on true or false), so the Mix will output either input rather than blend them.

Interesting trick. Funnily, if you assign the object mesh-data with no active users, it breaks the functionality. How is the ‘random’ identity of the object assessed/stored?

Hi CeKuhnen. From your other thread I guess you are abandoning this approach? Using Blenderallday’s UV coordinate jittering technique in combination with different images might be the best solution. Anyway Spaced has laid out above how to use the math node to make a switcher, so you should be good now, but post back if you want a five-pole switch I have one lying around somewhere.

BTW randomizing color can be done this following way too which might be faster from scratch just by virtue of fewer nodes and render faster too by virtue of fewer (none) logic ops…:wink:


Hopefully it was obvious the RGB nodes were placeholders for Image Texture node, but good point to make it clear :slight_smile:

If you want a random RGB colour (not a specified range), then:


well exactly the same question and nobody answered to the question: Random texture from a folder… a script is needed…

You can do in this way

This is a way, not real solution, some more node manipulations may be needed.

well I did this https://www.youtube.com/watch?v=Ne4At27xceg

Video unavailable

Still no real quick solution. Would be great if someone could crack this an easy way. a script would be awesome

I posted a solution to this in another thread, that was in principle about the same problem, have a look over there:

There are also other proposals and ideas in there.
I added a slighty variated version: