# Texture compression artifacts when using alpha

**URL:** <https://forums.unrealengine.com/t/texture-compression-artifacts-when-using-alpha/385045>\
**Category:** Rendering\
**Tags:** alpha, compression, unreal-engine, question\
**Created:** [February 15, 2017, 11:14pm UTC](https://forums.unrealengine.com/t/texture-compression-artifacts-when-using-alpha/385045 "2017-02-15T23:14:34Z")\
**Posts on this page:** 10\
**Page:** 1

<div class="post-metadata">

**Author:** ![Stephane\_Roncada](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Stephane\_Roncada](https://forums.unrealengine.com/u/Stephane_Roncada)\
**Post date:** [February 15, 2017, 11:14pm UTC](https://forums.unrealengine.com/t/texture-compression-artifacts-when-using-alpha/385045/1 "2017-02-15T23:14:34Z")

</div>

I am seeing weird artifacts with texture compression when an alpha mask is present in the texture’s alpha channel. It seems the alpha channel is causing artifacts in the RGB channels, please see pictures:

Here’s the texture without an alpha channel:

 ![126453-texturediffuse_noalpha.jpg](https://d3kjluh73b9h9o.cloudfront.net/original/4X/4/6/d/46dbd781973a31828b8c4cd4e06587ba85de015f.jpeg) “Texture without alpha channel”

Here’s the same texture with an alpha channel, notice the artifacts around the edges:

 ![126454-texturediffuse_withalpha.jpg](https://d3kjluh73b9h9o.cloudfront.net/original/4X/e/f/e/efeace93906d213e02920e6a219dc0225f15ef84.jpeg)

Here’s the actual alpha channel:

 ![126455-texturealpha.jpg](https://d3kjluh73b9h9o.cloudfront.net/original/4X/5/3/9/539d0581a28f1e72643e53bcea7b709349da5fd2.jpeg)

Why is the alpha channel affecting the look of the RGB channels?

Thank you for your time!

---

<div class="post-metadata">

**Author:** ![Deathrey](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Deathrey](https://forums.unrealengine.com/u/Deathrey)\
**Post date:** [February 17, 2017, 10:20am UTC](https://forums.unrealengine.com/t/texture-compression-artifacts-when-using-alpha/385045/2 "2017-02-17T10:20:31Z")

</div>

Are you importing your textures as PNGs ?

---

<div class="post-metadata">

**Author:** ![ergoproxy](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@ergoproxy](https://forums.unrealengine.com/u/ergoproxy)\
**Post date:** [February 17, 2017, 10:40am UTC](https://forums.unrealengine.com/t/texture-compression-artifacts-when-using-alpha/385045/3 "2017-02-17T10:40:39Z")

</div>

It depends on what you’re exporting your texture as. Try exporting the texture as targa 32 bit. Then hook it up in unreal and let me know how you got on.

---

<div class="post-metadata">

**Author:** ![ergoproxy](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@ergoproxy](https://forums.unrealengine.com/u/ergoproxy)\
**Post date:** [February 17, 2017, 10:42am UTC](https://forums.unrealengine.com/t/texture-compression-artifacts-when-using-alpha/385045/4 "2017-02-17T10:42:44Z")

</div>

Also when you double click the texture what is your compression set to?

---

<div class="post-metadata">

**Author:** ![Stephane\_Roncada](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Stephane\_Roncada](https://forums.unrealengine.com/u/Stephane_Roncada)\
**Post date:** [February 17, 2017, 5:30pm UTC](https://forums.unrealengine.com/t/texture-compression-artifacts-when-using-alpha/385045/5 "2017-02-17T17:30:50Z")

</div>

The texture is a 32 bit targa file, and the compression setting is BC7. I have tried using Default and Masks compression settings and it still looks the same. I have not tried importing a PNG version of the texture though.

---

<div class="post-metadata">

**Author:** ![Luos](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/luos/32/918700_2.png) [@Luos](https://forums.unrealengine.com/u/Luos)\
**Post date:** [February 17, 2017, 6:10pm UTC](https://forums.unrealengine.com/t/texture-compression-artifacts-when-using-alpha/385045/6 "2017-02-17T18:10:29Z")

</div>

This is a bit of an odd situation because alpha and RGB should not interfere with eachother. At least, after extensive testing on my end about a year ago which game me my conclusion.

That said, I did some tests and besides BC7 compression all the results had this: (me swapping between alpha on/off)

![](https://d3kjluh73b9h9o.cloudfront.net/original/4X/c/d/d/cdd0e5c115240515bfa1c6114bb4a1db8b71c27c.gif)

For me personally though, BC7 (DX11) compression is the only one that has a constant result without the artifacts.

To solve this, if your work allows it… you might want to save the alpha separately (put it in the R channel \> compress as alpha) from the RGB image.

edit: which is why I moved this up to bug reports.  
(im notan ue4 dev, just an admin on answerhub)

---

<div class="post-metadata">

**Author:** ![anonymous\_user\_fbe2d247](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_fbe2d247](https://forums.unrealengine.com/u/anonymous_user_fbe2d247)\
**Post date:** [February 18, 2017, 12:28pm UTC](https://forums.unrealengine.com/t/texture-compression-artifacts-when-using-alpha/385045/7 "2017-02-18T12:28:06Z")

</div>

With BC7 texture compression alpha actually stealing bits from rgb channels.  
With default compression rgb texture is using BC1(dxt1) and with alpha channel it’s using BC3(dxt5). BC3 stores rgb as BC1 and alpha as BC4 so these are never going mess with each others.  
There is detailed explanation.

---

<div class="post-metadata">

**Author:** ![Luos](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/luos/32/918700_2.png) [@Luos](https://forums.unrealengine.com/u/Luos)\
**Post date:** [February 18, 2017, 12:37pm UTC](https://forums.unrealengine.com/t/texture-compression-artifacts-when-using-alpha/385045/8 "2017-02-18T12:37:34Z")

</div>

that the thing, bc7 is one of the few compression where the alpha is NOT influencing RGB. (and vice versa)  
DXT5 in this case has the alpha interfering with RGB.

---

<div class="post-metadata">

**Author:** ![anonymous\_user\_0c62419a](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_0c62419a](https://forums.unrealengine.com/u/anonymous_user_0c62419a)\
**Post date:** [February 20, 2017, 5:17pm UTC](https://forums.unrealengine.com/t/texture-compression-artifacts-when-using-alpha/385045/9 "2017-02-20T17:17:45Z")

</div>

Hey guys,

I have reproduced this issue and logged a report for it here: [Unreal Engine Issues and Bug Tracker (UE-42093)](https://issues.unrealengine.com/issue/UE-42093)

You can track the report’s status as the issue is reviewed by our development staff. Please be aware that this issue may not be prioritized or fixed soon.

As you can see in the description I think this is due to the high contrast in the alpha channel in a small area (where the hard edges are). If you open the texture and change the “Min Alpha Value” to 0.1 that should help with the compression. If that still doesn’t help try to reduce the contrast further by changing the min and max alpha values. You can always increase the contrast back in the material graph.

,

---

<div class="post-metadata">

**Author:** ![mazatracker](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@mazatracker](https://forums.unrealengine.com/u/mazatracker)\
**Post date:** [February 27, 2018, 1:46pm UTC](https://forums.unrealengine.com/t/texture-compression-artifacts-when-using-alpha/385045/10 "2018-02-27T13:46:03Z")

</div>

I’m experiencing the same issue on 4.18.3 regardless of the texture having alpha or not. Artifacts are in the areas of high contrast in same places in every channel. Workaround described above doesn’t work for me.

Tried several other compression types (I’ve used Masks on first place), but no luck. The texture itself is a paint mask for an object, so there are a lot of intersecting areas of high contrast.

Please advise.
