Dark edges on mesh when using alphaMap


I want to draw textures of a fixed size on a sphere, and only show parts of the sphere that has been drawn on. For this I’m using a canvas to draw to the material map and an Uint8Array as my alphaMap, where each pixel (stride?) corresponds to a fixed size texture on the sphere. Everything works fine, except that I’ve been getting dark edges on my Sphere where the alpha is cutoff. This issue is easy to fix by setting the texture.minFilter to nearestFilter, but I’m hesitant to do so as it lowers the overwall quality of the textures I want to render.

I’ve made a simplified fiddle to illustrate my issue:

I’m drawing white on a canvas, with a white background. I therefore don’t understand why I’m getting these black edges, but I’m assuming its related to how the edge pixels sample their texture?

Might be related to:
Seams in Transparent Edges of PNG Texture in BasicMeshMaterial and but I’ve tried fiddling with the alpha-channel, but it didnt help.

All help is much appreciated! :slight_smile:

Setting material.alphaTest=0.99 also seems to remove the darkened edges but then I wont be able to fade textures in and out

For future googlers: I solved it by drawing a low-res version of the entire texture on the sphere first, so that the edge pixels don’t sample black pixels but instead the low-res texture.