World Aligned Texture axis

Hi, I’m making a world aligned floor material for a scene I’m working on and found a reference for the basic setup in among the first couple Google results. Here’s the setup I’ve made:

I’d also like for someone to explain it to me since I simply copied what I saw in the reference. I figured out that the constant for the multiply node controls the tiling of the texture, but I have no idea what the second one does.
Anyway, here’s my actual problem:

What I’d like to find out is how to change axis that the texture aligns to, either automatically based on normal direction or something, or statically so I can just create two instances of the base material for the XY and ZY orientation.

It is about what channels you mask comming out from world position node. See the axis in the bottom left of your screenshot? You have selected RG in your component mask. Red Green. The texture will be in XY plane. But for what you are intending to do, you should check out WorldAlignedTexture material function.

the add simply offsets the texture position. not really necessary.

Using the WorldAlignedTexture function fixed it. Thanks! :slight_smile: