Random Tile Selection Node Group

I’ve been working today on a Node Group that I thought might be of interest to the community.

As part of one of my ongoing projects, a large medieval/fantasy castle I had got a set of very low-res basic textures for background characters all loaded onto 1 texture map, and had set up the shader to randomly select which texture to use.

However, I found that setting it up was quite tedious as I had used a colour ramp to direct which texture to use.

I felt that I could definitely improve this, and wanted a way to procedurally be able to do this without any messing around with setting colour ramps.

So, as a test run I created a 4 x 4 grid with different colours, and duplicated the plane a bunch of times. If anyone is interested in a more detailed breakdown of my Node setup I’d be happy to help!