So I'm making this building with geometry nodes, and the rooftop consists of planes instanced on a grid. What I'd like to do is assign a material such that it it stretching across multiple instances, and not ending where the geometry of each of these tiles end. Is this even possible? I've attached an image of the building. So, instead of the same small piece of texture on each of the building blocks I'd like a big one that is on multiple blocks.
1 Answer
Your roof tile is the "Plane" object, and it's associated material is "Concrete material". The texture coordinates are generated by these two nodes:
This material will run separately for each instance of the "Plane", but the coordinates produced by the "Texture Coordinate" node are "Generated" coordinates. For your "Plane", this means it's the unit square mapped onto that mesh, with (0,0)
in one corner and (1,1)
in the other. So, even though this material is recalculated for every instance, it's always run with the same unit square coordinates feeding into the Mapping
node (which appears to scale them down to a tiny corner of your texture, which gets reused for every instance.
The simplest thing to do is switch from "Generated" to "Object" coordinates and then specify the "Object" as grid.002
:
This will generate texture coordinates based on the location relative to the location, rotation, and scale of the grid.002
object, so as the material is run for each instance of the Plane
, it will use texture coordinates based on the location of that instance with respect to the grid.002
.
The result will be that the entire texture will be mapped across the roof, subject to the scaling and other adjustments in your Mapping
node.
Here's my before and after using a 4200x4200 "burlap" texture:
-
$\begingroup$ Great, thanks! I have one more question. So now it works on the roof, but I have the concrete slab going around the roof that has the same material, and now the top of it has the material mapped correctly, but it is stretched on the sides. What would be the best way to map the texture correctly on each side of it? Do I need to assign a different material somehow to each side with a different mapping or is there a simpler way? $\endgroup$ Commented Dec 27, 2021 at 18:43
.blend
file on Blend-Exchange? $\endgroup$