tiled textures not working.

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By 1997
:warning: Old Version Published before Godot 3 was released.

I’ve got a desert plain mesh that I added a tillable sand texture and expanded the UV of the mesh in blender until I had the right sand size for the mesh. now when I imported the mesh into Godot the texture does not tile like it did in blender, so it left me with a tiny square of texture in the middle of the mesh. I found under the fixed material I was using if you edit the diffuse texture you can add flags, there was a flag called “repeat”. once it was checked the texture tiled to the rest of the mesh in the view port, but once I play the game it goes back to the one tiny texture in the center of the mesh. HELP.

:bust_in_silhouette: Reply From: rgrams

Save the texture as a resource (the little save button at the top of the inspector), and load that instead of the image file itself. That way it will remember its flag settings. Otherwise they tend to reset to the defaults you set in project settings >> image loader.

:bust_in_silhouette: Reply From: zendorf

I ran into this issue a while back and realised that you need to go to the projects settings and make sure that image loader>repeat is set to on! Not sure why this is a setting at all, since why would you turn it off?

If I remember correctly, I was getting the texture repeating in the viewport but not when the game was playing. Turning on this global toggle on solved my issues so hopefully this works for you.

I thought the same originally, but if you also have mipmaps on, or maybe filtering, you can get artifacts at the edges of sprites, especially at different zoom levels.

rgrams | 2016-05-27 12:17

I had a small revelation(!) However, this may be a 2D only thing and I’m probably using the wrong technical terms:
It seems to me as if the repeat function only works properly if applied to a 4x4, 8x8, 16x16 and so on -pixel sprite. Other, “uneven” formats will result in smeared edges or simply nothing at all. In this image, sprite 1,2 & 3 were uneven (9x8 & 66x32 pixels) and the bottom sprite was a 16x16 sprite.
enter image description here

stillinthe90s | 2016-06-08 10:29

:bust_in_silhouette: Reply From: Sojan

Another way to do it (can be preferable in some instances where more complex texture mixes are required, and if the object is not to big), is baking it on a single 4k (or whatever size is more convenient) texture in blender.