Visible lines between faces of a mesh with different textures on each face

I have converted an equiretangular image to cubemap by using PhotoDome for the equiretangular image and taking screen shot of 6 faces using ScreenshotTools, then I use them as texture for my cube, the only problem is there are visible lines at the edge of each face.


The problem seems to be caused by the texture as I have tried to give all faces white color and I did not see any lines on the edges. How do I fix this?

1 Like

Welcome aboard!

That would be easier to help with a repro in the Playground (maybe it is a problem with the mipmaps, you can try to use the BABYLON.Constants.TEXTURE_NEAREST_SAMPLINGMODE sampling mode and see if that helps).

Also, you can try to use the ReflectionProbe to create the cube texture:

@Evgeni_Popov How do I use BABYLON.Constants.TEXTURE_NEAREST_SAMPLINGMODE on an imported .glb? I have this same bug right now

You need to retrieve the texture you are interested in (through mesh.material.albedoTexture) and call the updateSamplingMode function on it.

You can get the mesh(/meshes) by using scene.getMeshByName(...). Or you can cycle through all the materials of the scene (scene.materials array) and call material.albedoTexture.updateSamplingMode(BABYLON.Constants.TEXTURE_NEAREST_SAMPLINGMODE) if material.albedoTexture exists.

2 Likes

It was actually .getActiveTextures()[0] for me and not .albedoTexture. It also didn’t fix the issue for me so I’ll make a new thread with a Playground instead, but thanks for the reply!

UPDATE: Nevermind, it turns out it’s a glitch with one of my post-processing filters instead, specifically the Depth of Field effect. Not a great idea to use it on a low FOV non-orthographic camera!