Home Unreal Engine

Grooms are badly lit, and don't deform correctly [Solved]

polycounter lvl 5
Offline / Send Message
BTDarmstad polycounter lvl 5
Hi, and welcome to my ever expanding list of problems I create for myself in Unreal Engine (5.2) by being unbelievably stubborn and unwilling to turn around and doing things in an easier way!

Lately, I've been experimenting with grooms, as part of a character redesign I'm working on, which used to have sculpted fur instead. I made the guides using Maya's Xgen, and exported it using Alembic for Grooms in order to get it to work in Unreal Engine with hair UVs. Disregarding the weird lighting in interior scenes, and bad deformation when animated for a moment, the groom itself looks pretty good:

^ This is the best lighting I can get at this time, and with the exception of the somewhat blotchy shadows in the chest area, it's not bad. However, this is using a large number of light sources for this specific angle and pose, so it's obviously never going to work in any real in-game scenario. This is where we get to the bad lighting and deformation (never mind the red arrows, it took me forever to figure out how to make eye joint rotations drive the planar eyes' texture offset so he can look at things):

^ Left is not using RBF interpolation, right is with RBF on. Without RBF, it looks mostly okay without simulation, because simulation makes the fur jittery in certain areas for whatever reason. However, the blendshape I use to make him smirk makes the fur spin out of control in that area. I have no idea why, because while I don't have any way to see the guides in Unreal Engine, the vertex normals look fine:

With RBF interpolation on, it's all just one big mess, so that's quite useless without the right setup, but it doesn't screw up the smirk blendshape like the normal interpolation does. RBF has this weird slot for skeletal meshes, but it won't accept my skeletal mesh:

^ What is this slot, and how do I use it? The description of this slot is absolutely useless, as it refers to things that don't exist in the editor as far as I can tell:

^ What does that even mean?

One possible explanation is that I don't have enough guides, but as far as I can tell, there are no guidelines for how much I can put into a groom before it's no longer viable for any real-time rendering. It's the areas with a low amount where the fur jitters with simulation, so maybe it is a bit low in those areas:

Also, about the lighting, I'm open to the idea that maybe I just don't know how to light a level properly. The thing I'm trying to do here is to create some sort of atmosphere, but not at the expense of visibility in this case. So the way I have lit it is with a bunch of massive light sources in an attempt at evenly lighting the environment. It looks like this. The screenshot from above is from the leftmost balcony:

^ I would love to know if this is the right approach to lighting the way I want, and if there are better alternatives. What is clear, though, is that this lighting approach doesn't seem to work with grooms, as far as I can tell.

Any help would be greatly appreciated!


  • BTDarmstad
    Offline / Send Message
    BTDarmstad polycounter lvl 5
    So I've made some progress here. It turns out that static lights don't work on grooms at all. Maybe I'm slow, but it's new to me that static lights only work on static objects - but it works on skeletal meshes? Are skeletal meshes static objects? But not on grooms, evidently.

    ^ Left is with voxels turned on, right is turned off. Without voxels seems to have some serious issues, and the lighting is way too bright anyway. With voxels, it's better, but there's still this strange and very noticeable banding effect on his chest. I think I've been through all the groom visualizers, but none of them narrow down what's causing this undesirable shadowing artifact.

    Even without the shadowing artifacts, these are still extremely harsh shadows and highlights, and I have no idea how to smooth it out. Is there a problem with indirect lighting? I tried connecting the color map to the emissive channel to bring back a little light in his eyes and the darkest parts of the fur (no emissive in the gifs), but I doubt this is a good workaround. It just made everything look flatter. It's strange how everything around the environment looks pretty smoothly lit, but for whatever reason the groom ends up with a way higher contrast than the rest of the scene.

    ^ Supposedly I have to make every light that is in the scene stationary or dynamic now. Lighting corners this way is really tough, and if anyone has any tips on interior lighting, that would be appreciated. Might even have to look into ways of lighting a scene without affecting the characters in the scene, because I don't want a moving character to suddenly be brightly lit because they're positioned right in front of an invisible light source.
  • BTDarmstad
    Offline / Send Message
    BTDarmstad polycounter lvl 5
    After just trying out some things, I figured that since I don't like how the character appears distractingly dark in the environment, I might as well put light sources in the character blueprint that follow him around. Again, I have no idea if this is common practice, or how much it affects performance later on, but it's what I'm going for until a better and more performant alternative presents itself.

    ^ Lighting is pretty good... But that fur on his cheeks. I just can't figure out what is causing that. I tried recreating the smirk blendshape, and I added some extra guides there and exported a new groom, but I get essentially the same result. For this particular scene, I could just put on a couple of extra joints at the corners of his mouth and do it that way, which hopefully works, but I just want to know why it's doing that despite normals appearing fine.

    ^ Current character blueprint lighting setup. Maybe some kind of HDRI would be a better choice, but I didn't find that right away, so I went with these lights for now.

    Edit: NOPE! Skinned mesh also creates this weird curly result for his cheeks. Is this a bug or something?

  • iam717
    Offline / Send Message
    iam717 keyframe
    sry i can't help it but why is his ass perfectly lit, lmfao amazing - just why, i needed that img ty... :'(=)B) gl with the issue i find continue debugging & testing to be the best, also writting down or screen recording the solution helps down the road, just making the post worth while after crying from laughter, ty made my day break(before the dawn) better.

    Edit: after reading below, i am not a furry, i enjoy opposite sex very much.  It was funny enough for me to mention.//
  • BTDarmstad
    Offline / Send Message
    BTDarmstad polycounter lvl 5
    iam717 said:
    sry i can't help it but why is his ass perfectly lit, lmfao amazing - just why, i needed that img ty... :'(=)B) gl with the issue i find continue debugging & testing to be the best, also writting down or screen recording the solution helps down the road, just making the post worth while after crying from laughter, ty made my day break(before the dawn) better.

    Well, I can't help but feel like that earned a dignified response. "Hey! Eyes up here!"  :#

    Happy accident, best way I can put it.

    And yes, you are correct about testing, debugging and documenting. I guess that's what I'm using this thread for at this time. I could always hope that this stuff helps someone else later when trying to solve similar issues.

    In other news, apparently there will be some updates to the groom interpolations in Unreal Engine 5.3, if I've understood the document correctly (just skimmed through it and looked for groom), so it's worth waiting for that. I wish I wasn't relying on the latest engine release in order to achieve what I want, though. I really can't justify this being a cutting edge project, you know  :p

    Someone on another forum asked to see the cheek fur artifact animated, so I guess I'm posting it here as well. On a related note, I occasionally get this bright square showing through the groom as well, which is a bit annoying, but negligible compared to that twisting cheek fur.

  • BTDarmstad
    Offline / Send Message
    BTDarmstad polycounter lvl 5

    I'm absolutely thrilled to share that the two issues I had when I started this thread have largely been solved. I've learned that grooms only work with stationary and movable lights, that areas that deform significantly should generally have shorter fur, and that you can apparently have lights following a character only light that character through channels, which may or may not be a proper solution to making the character stand out from the environment, but I'm sticking with it for now. Needless to say, I still have questions around optimizing the fur without compromising quality, because the frame rate does chug a bit. I wonder if it's possible to generate hair cards, or if I would have to do this manually in Xgen. Probably the latter.

    Here's the reason why the fur on his cheeks were twisting so badly... It's because I was being a dumbass and putting long hair guides right on top of a heavily deforming area. I have now moved that longer hair further back, and it was barely even a compromise. Actually, the smiles are more visible, so it was a win-win in my book.

    I hope this thread might help some other creators on their journey in the future  =)

    Now I need to write and share this character's personality and backstory, because this is really not an accurate representation at this point :p
Sign In or Register to comment.