after this line can you add:
texture.wrapS = texture.wrapT = THREE.RepeatWrapping?
Itâs possible that the texture filtering is pulling data from outside the texture, and without a wrap mode set, that data may be black pixels. Changing the wrap modes to either RepeatWrapping or ClampToEdgeWrapping may fix it?
I tried âtexture.wrapS = texture.wrapT = THREE.RepeatWrappingâ and âtexture.wrapS = texture.wrapT = THREE.ClampToEdgeWrappingâ but that not working the result still have the border
Simply yes. For better solution we can use in photoshop Filter âFlaming pear->Solidify Aâ
to fill transparent pixels not white but with color of our image.
Then add mask of image to make transparent again.
But photoshop have bug - totally transparent pixels became white. Here we need make mask more bright (not good) or use another program to save image with our mask.
You should probably make a glitch or a codepen showing the issue.
Hereâs a glitch you can âremixâ and add your code to the bottom of âscript.jsâ and then âshareâ us a link and we can see what youâre are describingâŚ
As I say the design image depend on the user input, so If can change black transparent to white just by JS or three.js then please share me your code on the Glitch, thanks.
I used this code and your original image. Not glitch site:
var material = new THREE.MeshBasicMaterial({
map: texture,
transparent: true,
//premultipliedAlpha:true
});
material.onBeforeCompile=function(){
this.premultipliedAlpha=true;
}