It did help. The issue here is, that I want linear filtering in order to really take advantage of the textures, instead of the blocky look of the nearest filter. Now, using texture2DLodEXT instead of just texture2D, I’ve managed to “sort of” get rid of the seams. They are not perfect due to the 5px padding I use and this line:
Which is more or less trial and error. You can still see the padding, but it’s good enough for me.
I used this example: ogre/SGXLib_TextureAtlas.glsl at c7cf1e078a4ede4fbbc23b2c1a8441bc31af3a6b · OGRECave/ogre · GitHub
Which linked to this example: http://www.gamedev.net/topic/534149-solved-texture-seams-using-atlas-with-screenshots/
Which originates from this example: Terrain texturing explained - Journal of Ysaneya - GameDev.net
Look at this example using texture2D: https://www.babylonjs-playground.com/#LIVRIY#51
Now look at this example using texture2DLodEXT: https://www.babylonjs-playground.com/#LIVRIY#50
Huge difference, and since it’s an extension for webgl1(enabled by default in webgl2), I assume it’s decently supported.
So the last real issue now is mipmapping. I know nasim is working on a way of dealing with it, taking up a bit of extra space on the texture, but should be worth it, since the glitter you see in the background, caused my mipmaps, get’s crazy if you have a moving object close to the ground.
Look what happens if you force a lower resolution mipmap level: https://www.babylonjs-playground.com/#LIVRIY#52
The seams get pretty clear.
I did a test as well to see if the determination of mipmap level function worked as expected: https://www.babylonjs-playground.com/#LIVRIY#53
So I’m far from done, but still getting a little closer.