# Texture alpha channel bad quality

**URL:** <https://discourse.threejs.org/t/texture-alpha-channel-bad-quality/876>\
**Category:** Questions\
**Tags:** textures\
**Created:** [September 16, 2017, 11:42am UTC](https://discourse.threejs.org/t/texture-alpha-channel-bad-quality/876 "2017-09-16T11:42:09Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![edap](https://yyz1.discourse-cdn.com/flex035/user_avatar/discourse.threejs.org/edap/32/180_2.png) [@edap](https://discourse.threejs.org/u/edap)\
**Post date:** [September 16, 2017, 11:42am UTC](https://discourse.threejs.org/t/texture-alpha-channel-bad-quality/876/1 "2017-09-16T11:42:09Z")

</div>

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

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

```

The texture looks like this  
 ![fen_rosa_uno](https://cdck-file-uploads-canada1.s3.dualstack.ca-central-1.amazonaws.com/flex035/uploads/threejs/original/1X/ef312a58bc195c9121329521e52ef41228c45053.jpg)

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

```javascript
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](https://cdck-file-uploads-canada1.s3.dualstack.ca-central-1.amazonaws.com/flex035/uploads/threejs/original/1X/42cfc4c688df6908cc08bda4e44506d70ab0f370.jpg)

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](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

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

```

But it is not working, I obtain a strange effect:  
 ![32](https://cdck-file-uploads-canada1.s3.dualstack.ca-central-1.amazonaws.com/flex035/uploads/threejs/original/1X/a893aa938a850ef2517cbd1602bd64bae721f0e8.jpg)

---

<div class="post-metadata">

**Author:** ![sasha240100](https://yyz1.discourse-cdn.com/flex035/user_avatar/discourse.threejs.org/sasha240100/32/219_2.png) [@sasha240100](https://discourse.threejs.org/u/sasha240100)\
**Post date:** [September 17, 2017, 11:37am UTC](https://discourse.threejs.org/t/texture-alpha-channel-bad-quality/876/2 "2017-09-17T11:37:37Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![edap](https://yyz1.discourse-cdn.com/flex035/user_avatar/discourse.threejs.org/edap/32/180_2.png) [@edap](https://discourse.threejs.org/u/edap)\
**Post date:** [September 18, 2017, 8:27am UTC](https://discourse.threejs.org/t/texture-alpha-channel-bad-quality/876/3 "2017-09-18T08:27:36Z")

</div>

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 😉
