Hair glowing under point lights

Hello

In 4.24 (or 4.23?) we’ve noticed a problem came back with hair: when we look through hair towards the light source hair is overly lit (especially when the light source does not cast shadows). This stands even for hair examples provided by Epic.

Can someone help us with this?

Thank you,

Bumping this up too, having the same issue in 4.26

turn off capsule direct shadow in the skeletal mesh shadow options.

In case someone still has problems with this. This works fine on UE 5.4.

Close your unreal engine first, if it is open.
Look for the file in Programs → Epic games → UE (Your UE version) → ( now on the search tab paste this HairBsdf.ush) once your pc finds the file, click on the file and your pc is gonna ask What application you wanna use to open that file, search for Visual Studio.
Now look for this piece of code, (will be found below the big grey text wall):
const float Backlit = min(InBacklit, HairTransmittance.bUseBacklit ? GBuffer.CustomData.z : 1);

Once you have found it, delete that entire line of code or put // in the beggining of the line.

Now paste this in the same line:
const float Backlit = min(InBacklit, GBuffer.CustomData.z);

Save and close, no need for compiling.
Open unreal, let it recompile shaders and now you are able to go to your hair shader and set you backlit node to “0”

Without this piece of code, the backlit doesnt work, hence why it lets all light go through the hair.

2 Likes

(post deleted by author)

Tried this but the node doesn’t show up in the material?

Is the shading model of your material set to HAIR? Just making sure…
Also check the link that I mentioned in my response for the quick and forward explanation from the original poster.
I can’t really help much outside of this since I didnt came up with the code, I just did what the original poster said to do, and it worked just fine.
Also its worth to note that I’m using the 5.4.4 version, but I doubt the code has changed compared to the old versions.

Here’s the photo of the alteration of the code.

Here’s the actual file!!!
HairBsdf.ush (12.2 KB)

If you intend to replace the old one with the new one, MAKE SURE TO MAKE A COPY OF THE OLD ONE, WE NEVER KNOW WHAT MIGHT HAPPEN!!!

Hey thanks for getting back to me! My issue was that I needed to select “ClearCoat” when adding the attribute, I was looking for “Backlit”

Really appreciate your help, this is a huge fix and there’s almost nowhere else to find the answer.

1 Like

Glad I could help!!! Good luck on your project!