Tutorial: visual shader for floors/walls so texture repeats with scaling

This is showing how to get a texture to repeat along the XZ or XY axis that matches the nodes transform scale. So you can place repeating floors and walls and change their size and have them update automatically.

I just realized this isn’t working lol. When the object is rotated the scale is not correct. Anyone know the correct way to get the object scale from model_matrix?

I figured it out with AI. Not sure why it needs to be decomposed and recomposed like that but this way it works even if node is rotated. :face_with_raised_eyebrow:

You probably can skip the compose → decompose → xy compose, instead inserting your xy len → xy compose.

Previously you were creating a vector from a single component on each xform, then getting the length of that vector, which can be substantially more than using the value directly.

I believe this reduces your formula without changing it. Have you tried the Triplanar option on StandardMaterial3Ds?

Theres a checlbox in blender that can auto correct texture coordinates in edit mode.

Also this video by the author of the Mterrain godot addon:

https://youtu.be/YwnVl2YHXBc?si=nhtQwgOgs3L7qOB0