I’m trying to create a wooden floor from a set of textures. My idea is, to use one image for each floor board. Thus, I create appropriate scaled cubes for every floor board and want to randomly apply one of my floor board textures to each of those.
This works pretty well to the point where I want to limit the generated floor to the extents of a room. At this point everything falls to pieces.
I tried two approaches. One using the Array Modifier and the other using Geometry Nodes, which is my favourite. As both are using the same material, I will first explain my material. Afterwards I will explain the approaches.
I would like to stay non-destructive. Nevertheless, I tried destructive workarounds, which led to other or similar problems.
How can I solve this?
My idea is, to stack all textures of a type in one image. Thus, I can choose one of them by choosing the corresponding range of y-coordinates. As I’m still in the proof of concept, I don’t currently use wood textures. Instead, I created a structured image with different colors, where every color represents one wood image:
Here is my material:
And this is how the node “RandInt – Color-Index” works:
The Geometry Nodes Approach
I’m using the following Geometry Nodes setup:
When muting the Realize Instances node, this creates the following result, which is fine:
When I try, to limit this to the extents of a room by applying a Boolean modifier, nothing happens.
And when I unmute the Realize Instances node of my Geometry Nodes setup, the Boolean modifier works but my material does not work properly anymore:
The Array Modifier Approach
I added two Array modifiers to an instancer object like this:
This gives me the following result:
When I apply a Boolean modifier on the instancer object, it does exactly what it says: It intersects the instancer objects but not the instances. Instead, it creates one complete floor board instance for every instancer object, that remains at least partly after the boolean operation: