# \[BUG\] Hair alpha dithering glitches in 4.17

**URL:** <https://forums.unrealengine.com/t/bug-hair-alpha-dithering-glitches-in-4-17/401467>\
**Category:** Rendering\
**Tags:** UE4-17, unreal-engine, bug-report, Rendering, question\
**Created:** [August 10, 2017, 1:44pm UTC](https://forums.unrealengine.com/t/bug-hair-alpha-dithering-glitches-in-4-17/401467 "2017-08-10T13:44:58Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![Gomo](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Gomo](https://forums.unrealengine.com/u/Gomo)\
**Post date:** [August 10, 2017, 1:44pm UTC](https://forums.unrealengine.com/t/bug-hair-alpha-dithering-glitches-in-4-17/401467/1 "2017-08-10T13:44:58Z")

</div>

After switching from 4.15 to 4.17 we noticed that hair, especially short hair, is rendering much worse.  
Dither glitches appear in places where opacity is set to 0.  
Below comparison of rendering hair on photorealistic human sample (lef 4.15, right 4.17):

 ![204062-hairrenderingdifference.jpg](https://d3kjluh73b9h9o.cloudfront.net/original/4X/f/a/4/fa4380a32c4fc3c6b87dedaf4e106636e66a9985.jpeg)

And how it looks like in our case:

![204063-image-2017-08-10-14-30-41-307.png](https://d3kjluh73b9h9o.cloudfront.net/original/4X/1/2/2/122ddad2f47a5e018f19656fd29f552a8f0063b8.png)

---

<div class="post-metadata">

**Author:** ![anonymous\_user\_d2b909bf](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_d2b909bf](https://forums.unrealengine.com/u/anonymous_user_d2b909bf)\
**Post date:** [August 14, 2017, 9:52pm UTC](https://forums.unrealengine.com/t/bug-hair-alpha-dithering-glitches-in-4-17/401467/2 "2017-08-14T21:52:52Z")

</div>

Hello Gomo,

Thank you for letting us know of this issue, we have created a ticket for this issue which you can view here:

> **[The Unreal Engine Issues and Bug Tracker](https://issues.unrealengine.com/issue/UE-48382)**
>
> Welcome to the Unreal Engine Issue and Bug Tracker. You can check the status of an issue and search for existing bugs. See latest bug fixes too.

Cheers!

---

<div class="post-metadata">

**Author:** ![mlindborg](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@mlindborg](https://forums.unrealengine.com/u/mlindborg)\
**Post date:** [August 15, 2017, 8:09am UTC](https://forums.unrealengine.com/t/bug-hair-alpha-dithering-glitches-in-4-17/401467/3 "2017-08-15T08:09:04Z")

</div>

To fix, disable dithering in material details and replace it with a dithering node.

---

<div class="post-metadata">

**Author:** ![Gomo](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Gomo](https://forums.unrealengine.com/u/Gomo)\
**Post date:** [August 16, 2017, 8:33am UTC](https://forums.unrealengine.com/t/bug-hair-alpha-dithering-glitches-in-4-17/401467/4 "2017-08-16T08:33:19Z")

</div>

For some reason using dithering node resolved this issue in Photorealistic Character sample but not in our implementation, so in some cases it helps.  
I’ll investigate it further.

---

<div class="post-metadata">

**Author:** ![stororokw](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@stororokw](https://forums.unrealengine.com/u/stororokw)\
**Post date:** [December 16, 2017, 12:13am UTC](https://forums.unrealengine.com/t/bug-hair-alpha-dithering-glitches-in-4-17/401467/5 "2017-12-16T00:13:39Z")

</div>

In “Engine\Shaders\Private\MaterialTemplate.ush”  
search for GetMaterialCoverageAndClipping  
and comment out

```
float2 DepthGrad = {
    ddx( Parameters.SvPosition.z ),
    ddy( Parameters.SvPosition.z )
};
Dither = frac( Dither + dot( DepthGrad, float2( 4093, 3571 ) ) );

```

Seems to be doing some sort of filtering? Maybe someone can explain why this was added.  
After in console type in the command " **recompileshaders changed"**

---

<div class="post-metadata">

**Author:** ![Gomo](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Gomo](https://forums.unrealengine.com/u/Gomo)\
**Post date:** [December 17, 2017, 2:56pm UTC](https://forums.unrealengine.com/t/bug-hair-alpha-dithering-glitches-in-4-17/401467/6 "2017-12-17T14:56:26Z")

</div>

Thanks, I’ll check this out.

---

<div class="post-metadata">

**Author:** ![Gomo](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Gomo](https://forums.unrealengine.com/u/Gomo)\
**Post date:** [December 18, 2017, 3:28pm UTC](https://forums.unrealengine.com/t/bug-hair-alpha-dithering-glitches-in-4-17/401467/7 "2017-12-18T15:28:09Z")

</div>

AFAIK we experienced this bug when Opacity Mask Clip Value was different than default.

---

<div class="post-metadata">

**Author:** ![Maralath](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Maralath](https://forums.unrealengine.com/u/Maralath)\
**Post date:** [January 22, 2023, 10:34pm UTC](https://forums.unrealengine.com/t/bug-hair-alpha-dithering-glitches-in-4-17/401467/8 "2023-01-22T22:34:02Z")

</div>

Hey mate. Go into project settings, anti-aliasing method inside the engine rendering tab, it should be set to either Temporal Anti-Aliasing (TAA) or Temporal Super-resolution (TSR). Also make sure to activate Anti-Aliasing.
