I have started with LWJGL3 and trying to built game engine. I'm stuck on generating terrains. I have one image that contains two textures.

enter image description here

So now for example I want to generate terrain with only texture 2, so my texture coordinates looks something like this : textures : (0.6f,0f) (0.9f,1f) .....

Everything is fine if terrain is not long, but if I stretch terrain on z-axis, terrain is using texture 1. As you can see on image. I just can't understand why is doing that ? enter image description here


The cause is most likely mipmaps being shrunk so much that the texture 1 bleeds out. There is a high chance that both textures merge together in one pixel at the last mipmap level. Try disabling mipmaps.

| improve this answer | |
  • \$\begingroup\$ Disabling mipmaps will increase aliasing, which may not be desired. If you have the option to use array textures, this can let you get both the benefits of packing tiles in an atlas and mipmapping without unwanted blending between tiles. \$\endgroup\$ – DMGregory Jul 13 '19 at 17:55
  • \$\begingroup\$ Thank you both for help. I will check this option with using array textures. \$\endgroup\$ – Filip Cacic Jul 13 '19 at 18:23

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.