[RESOLVED] Metahuman Hair renders on top of translucent materials

Here’s the way to create the problem. Bring in a metahuman with hair.
Create a cube in front of the metahuman and assign it a new material. Set the material type to translucent and set translucency pass to “Before DOF”. I also changed the Lighting mode to “Surface Forwardshading” to get access to translucency with roughness and normal. However this issue will happen even on the default lighting mode for translucency.
Create a point light in your scene and place it at a glancing angle (not necessary but shows the issue more clearly).
Everything renders correctly except the hair. I thought it was an issue with the hair material maybe but if you go into the metahuman BP and assign a new default material, the issue persists.

The only way to make it render correctly is by setting the translucency pass to “After DOF” (which is default) but now the glass or any translucent material doesn’t render correctly when it goes out of focus.

So I am essentially stuck, if I set to before dof to get right DOF, the hair shows up on top, if I set to after dof, the lighting is correct but the DOF is wrong for the glass.
I need to make a helmet glass for the metahuman so the hair renders behind the helmet glass and also works correctly with DOF.

Any suggestions or is this a UE bug/limitation?

3 Likes

Did you ever find a solution to this??

I’m using a metahuman with a Space helmet but cant right now because the hair looks ridiculous lol

No sir, still awaiting a fix! bumping this up in case anyone can either confirm if there is a solution or if this is a bug please!

I found a fairly stable fix

r.HairStrands.ComposeAfterTranslucency - 0

put this in the console commands for movie render queue as well as in your viewport

@Rysone

16 Likes

Helped with my issue too - thanks!

1 Like

Haven’t tested this solution but hopefully it will work in my case, thank you sooo much!!!

1 Like

r.hairstrands.composeaftertranslucency havnt helped me (tho I’m on 5.0)
but after some console investigation of commands with r.hairstrands.~ I found the:

r.HairStrands.DOFDepth = “1”

which worked like a charm and my metahuman now has reasonable hair render

7 Likes

Thank you for dropping a second solution!

Tried this right now and it instantly solved the issue!! Thanks for this!
Now I can get the hair to render behind the translucent surface and can set the translucency to “Before DOF” to get correct dof as well.

I would mark this as Resolved but I don’t think I can right? Since this is under the discussion category and not under question category?

2 Likes

yeaaaah buddy!!
ya that cvar works for the sort of the groom

and setting the dof setting to before is exactly needed for depth of field

glad this is solved!
resolved indeed

1 Like

Oh man, that solved my issue, thanks a lot!

2 Likes

Brillant topic not enough visibility !

1 Like