How do I tile a texture in a Spatial Shader without knowing the tile factor?

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By nsrosenqvist

I’m trying to tile a texture along one axis so that it “fills” the entire surface. I’ve only found examples that multiply the uvs with a set numerical value, but the way I’d like for it to work is that I figure out the proportions of the texture and scale the uv based on the mesh proportions accordingly. So if the texture is 1x1 in width and height, and the mesh plane is 1x10, then the uv should be set to repeat the texture once along the first axis, and 10 times along the other.

I guess my question is, how do I access this information from the texture and mesh respectively and make use of it to perform these calculations?

Any help is appreciated! Thanks!