+1 vote

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.

in Engine by (81 points)

3 Answers

0 votes

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.

by (543 points)
–1 vote

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.

by (268 points)

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.

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

0 votes

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.

by (89 points)
Welcome to Godot Engine Q&A, where you can ask questions and receive answers from other members of the community.

Please make sure to read How to use this Q&A? before posting your first questions.
Social login is currently unavailable. If you've previously logged in with a Facebook or GitHub account, use the I forgot my password link in the login box to set a password for your account. If you still can't access your account, send an email to webmaster@godotengine.org with your username.