In threeJS, I used to resolve this issue by changing the sampling mode on the texture and in BabylonJS I thought it was texture.updateSamplingMode but that is not yielding any result unfortunately.
I’ve tried both RenderTargetTexture and the Texture sampling mode and still nothing.
the UV layout is a bit shattered. If you do it in 2 islands - outer hull and bottom, so the seams dont run over the surface, would that resolve the issue?
Best. WErner
If you test it out and try to draw the decal you can see there are seams, this occurs whenever the UVs are split into islands. It’s standard stuff.
I’ve been using this decal system now for 9 months and this is the only major setback on it. The other options (mesh decal) are not good unfortunately.
Usually you fix this with sampling mode and it only occurs when the UV is set up like this.
Does ThreeJS has a texture decal mode? Last time I looked, they only had mesh decal.
If they have texture decal mode, it would be interesting to know what they are doing in that case, because in my understanding it’s the discontinuity in uv space that leads to this rendering artifact.
You can improve things a little bit by setting the “nearest” sampling mode to the decal texture, but it won’t completely fix it:
No I don’t think ThreeJS has a decal system like BabylonJS.
BabylonJS is a much more advanced engine with all these great features. What Three does have is a way to fix the seams on textures where the UVs on the mesh are separate islands.
Its either an issue on the decal texture itself, or the MeshUVSpaceRenderer, or the RenderTargetTexture or the albedoTexture the decal ends up in on the material.
Decals have an alpha=0 background, so you will see the diffuse texture when there’s no decal color:
For me, the problem is when generating the decal texture, because we render in uv space. When there’s a discontinuity, we will render either in one island or in another one, but not in both. We would probably need to render some king of “thickness” to be sure that when the texture is read we get the right color (but I don’t know how that could be done).
Do the standard textures include this 1 pixel UV seam “thickness” already? or are they handled in another way, but there must be something in the usual texture function that corrects the UV seams, surely?
Couldnt you just repeat the pixels when it comes to the UV edge.
Isnt this kind of the same task as for a “render to texture”. In content tools there is this “seam” option which can be defined sometimes to overfill the edges.
Also, it’s quite heavy because you have to make a new render pass and have another texture for the mask (having one texture per mesh that can receive a decal is already the main drawback of the technique)…