Texture alpha channel bad quality

Hello, I’m adding a texture to a material.
this is the material

new MeshStandardMaterial( {color: 0x00ff4a, emissive:0xca3131} ),

The texture looks like this
fen_rosa_uno

I’m adding it to a material in this way:

material.alphaTest = 0.35;
material.alphaMap = textures[key];
material.alphaMap.magFilter = NearestFilter;
material.alphaMap.wrapT = RepeatWrapping;
material.alphaMap.repeat.y = 1;

I’m using the same texture as map texture and as alpha map.

The problem that I’m having is that, when zooming, the texture is really pixeletated
13

I was wonder how to mitigate this effect, how to have a kind of blending.

I’ve read this
https://medium.com/@bgolus/anti-aliased-alpha-test-the-esoteric-alpha-to-coverage-8b177335ae4f

And I’ve tried to set the sample alpha to coverage variable in the renderer like this

const gl = renderer.getContext();
gl.enable(gl.SAMPLE_ALPHA_TO_COVERAGE);

But it is not working, I obtain a strange effect:
32

Try tweaking material.alphaMap.anisotropy, and setting magFilter to THREE.LinearFilter and minFilter to THREE.LinearMipMapLinearFilter

1 Like

Thank you Sasha. minFilter to THREE.LinearMipMapLinearFilter improve the result quite a lot. Getting better textures, and cutting them with the “Foreground selection tool” on gimp, complete the job. Thanks :wink: