Hello again, I’ve got another question! It seems that, while designing my gaming library, I keep running into one issue after another that I’ve never encountered before. I’ve been on this problem for a while, but I only just today learned that it’s called Texture Bleeding. Since I’m trying to write a library I’m hoping to learn a way to fix the bleeding programmatically rather than in a shader, as I want this library to be as simple for users to use as possible. Here’s an example of the texture bleeding going on:
As you can see based on the texture for the blend map being used here, there shouldn’t be any of the sand texture being blended on the left side of the map, as it is completely red on the blend map texture. Same with the bottom of the map, stone shouldn’t be blended there as the blend map is completely black there. From what I can tell it’s like the entire texture has been offset by a certain amount and is just throwing the texture coordinates that are offset off the map onto the opposite side of the map, if that makes sense (not quite sure if I am describing it correctly, hopefully you can see what I mean though).
I’m not sure if LWJGL has always been doing this and in previous projects I’ve just never noticed or if it’s an error in my code somewhere. I can’t think of anything at all that’d cause this to happen based on my coding, but who knows. I’ve tried researching other people who have had the same issue as me, but I can’t seem to fix this. I tried using:
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL11.GL_NEAREST);
While this does stop the texture bleeding, it also prevents all the blending between textures that actually should be happening on the terrain.
Can anyone help me out with this? Is there a way to fix this programmatically in my library for the convenience of the library users, or can it only be fixed in a shader? Also, if you know, does LWJGL always act like this, or is it probably just an error in my code somewhere? I’m sorry if this was a long post, I am terrible at describing issues with programming , but if you need any more information please just ask. I will provide as much of the needed info as I can for you.
Thank you in advance guys (and gals)!