# Hair shader model base color lighting problems

**URL:** <https://forums.unrealengine.com/t/hair-shader-model-base-color-lighting-problems/352975>\
**Category:** Rendering\
**Tags:** black, unreal-engine, Lighting, question\
**Created:** [April 5, 2016, 3:40am UTC](https://forums.unrealengine.com/t/hair-shader-model-base-color-lighting-problems/352975 "2016-04-05T03:40:50Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![cridia](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/cridia/32/772487_2.png) [@cridia](https://forums.unrealengine.com/u/cridia)\
**Post date:** [April 5, 2016, 3:40am UTC](https://forums.unrealengine.com/t/hair-shader-model-base-color-lighting-problems/352975/1 "2016-04-05T03:40:50Z")

</div>

**Edit:** So I have managed to find what is causing it, though I still have no idea how to solve it. The moment I plug in something more than a constant into the base color, I will get those black artifacts. If it’s a constant (no matter what the value), I don’t get it (but of course, I will only get monochrome hair). So, anyone any idea what I am doing wrong here?

So, I have been trying out the new hair shader model and have run into some problems. Whatever I do, I am getting some really bad results when the hair is being hit by light.

 ![85288-haira.jpg](https://d3kjluh73b9h9o.cloudfront.net/original/4X/f/f/6/ff6a4a64f7a17652846ef712ea4ecfa1bf56ec61.jpeg)

In the above image, the light is coming from above and everything hit by the light is turning black. I was really looking forward to using the hair shader model, so I really want to know what I am doing wrong. For reference, here is the material I made (for testing sake).

 ![85290-hairb.jpg](https://d3kjluh73b9h9o.cloudfront.net/original/4X/5/6/d/56d048b3b593a06893c53fdc74fe796f1a2cb812.jpeg)

Apart from the lighting problem, another issue I have is that I have no idea what all the hair shader model specific outputs are supposed to do. More specifically;

- Scatter: Have no idea what this is. I figure it has something to do with light, but that’s about it.
- Tangent: The normal map of the hair shader perhaps?
- Backlit: the name tells me what it is supposed to do, but I don’t know what kind of inputs are best. Is an 0-1 okay or should I go with a vector?
- Pixel Depth Offset: No idea about this one.

I should also mention that the hair in my model is not based on billboards, but rather a part of the mesh.

---

<div class="post-metadata">

**Author:** ![TheFarqunator](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@TheFarqunator](https://forums.unrealengine.com/u/TheFarqunator)\
**Post date:** [April 6, 2016, 3:23am UTC](https://forums.unrealengine.com/t/hair-shader-model-base-color-lighting-problems/352975/2 "2016-04-06T03:23:05Z")

</div>

Hey, I had this issue too, it seems you cant have a saturation of 1, I think its a bug, but just open your constant3, and drop the saturation slider a fraction below 1 and you should be good to go.

---

<div class="post-metadata">

**Author:** ![cridia](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/cridia/32/772487_2.png) [@cridia](https://forums.unrealengine.com/u/cridia)\
**Post date:** [April 6, 2016, 7:12am UTC](https://forums.unrealengine.com/t/hair-shader-model-base-color-lighting-problems/352975/3 "2016-04-06T07:12:03Z")

</div>

Yeah, I figured it out already. Posted my answer to myself here too. Seems a moderator deleted it though.

---

<div class="post-metadata">

**Author:** ![cridia](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/cridia/32/772487_2.png) [@cridia](https://forums.unrealengine.com/u/cridia)\
**Post date:** [April 6, 2016, 3:51pm UTC](https://forums.unrealengine.com/t/hair-shader-model-base-color-lighting-problems/352975/4 "2016-04-06T15:51:37Z")

</div>

After screwing around a bit, I found the answer myself.

The problem was apparently, that if you plug a vector value into the base color, none of the R, G or B channels can be 0.

This is what happened when I plugged in a normal texture. Anything hit by light goes black and gives artifacts;

 ![85488-hairsolutiona.jpg](https://d3kjluh73b9h9o.cloudfront.net/original/4X/f/d/0/fd0601b1976b7713dcf5c54f9e5ccbcdca579859.jpeg)

However, when I added an additional value of 0.01 to each of the RGB channels of the texture, it changed into this (don’t mind the shadows being white; that’s just me not having finetuned the scatter, specular and whatnot settings). As you can see, the artifacts are gone and the whole thing renders quite nicely.

 ![85489-hairsolutionb.jpg](https://d3kjluh73b9h9o.cloudfront.net/original/4X/9/5/4/954a7d43df23d98b91ca4e70920eb815946a7c11.jpeg)

Pretty sure it’s a bug.

---

<div class="post-metadata">

**Author:** ![Grayve\_Rose](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Grayve\_Rose](https://forums.unrealengine.com/u/Grayve_Rose)\
**Post date:** [September 30, 2020, 1:23pm UTC](https://forums.unrealengine.com/t/hair-shader-model-base-color-lighting-problems/352975/5 "2020-09-30T13:23:28Z")

</div>

Ahh thanks. Just migrated over from 4.22 to 4.25, there’s been a number of changes and weird bugs and I’ve been spending a while trying to fix them, this was one of them and it was really frustrating and ugly. You can also instead do a simple clamp at a small value like .0001, cause even small adds of grey will wash out a lot of color so its better to preserve a small amount and not add anything. I appreciate you figured this out, glad its a simple fix.

 ![316622-saturationbugclamp.jpg](https://d3kjluh73b9h9o.cloudfront.net/original/4X/6/2/8/628000f1ce72156ccf8ba75bf2133da930f91fef.jpeg)
