Blending 4 textures together with a shader, it's working, but I'm getting a darker edge

Godot Version



It’s been a long time since I’ve worked with shaders, and I remember encountering this before, but I don’t remember the correct way of doing this to avoid the dark edges.


btw I noticed the data type was set to “data” instead of “color”, that made the colors more vibrant, but didn’t fix the edges.

is it the repeat mode you’re thinking about? im not sure

Sorry the image above may not be clear, what you’re looking at is two separate planes, not a single rectangle with a repeated texture. Notice how edges of each plane darkens. The next picture should make it more clear. Notice the first layer is a crisp red to the edge, but the purple texture has red bleeding through on it’s edge.

That is because the pixels on the other side of those edges are red, as they wrap around, because your texture repeats. You can set texture mode to not repeat or you can increase the resolution of your texture to make that bleed pixel smaller or you can make your UV mapping not reach that last pixel. The choice is yours depending on what matters most to you.