I'm trying to understand how this minecraft-like project determines which texture to draw on each face of a block: https://voxel-tools.readthedocs.io/en/latest/
I'd like to create blocks with different textures for different faces.
So I'm trying to understand how is bark drawn on only the sides of a wooden log and not the top?
But in general I cant figure out how Godot does texture wrapping either.
For example, this line in a spatial shader:
COLOR = texture(TEXTURE, UV);
seems to texture the mesh with the material that was assigned in the editor. But in 3d there are many faces of a mesh, how does the shader know which texture to apply to which face?
In the voxel-tool material the faces of the blocks are arranged in a 2d atlas like this:

However, i've seen other projects where the texture looks 3d like this:

How does Godot know how to wrap the textures around the materials?