Announcement

Collapse
No announcement yet.

Skeletal Mesh+Shadow Glitch in UE4

Collapse
X
  • Filter
  • Time
  • Show
Clear All
new posts

    Skeletal Mesh+Shadow Glitch in UE4

    Hi there,
    I've encountered some strange things with shape keys and skeletal meshes I can't explain.
    I'm using a Dual Quaternion Build of 4.21, but it's the same, although to a lesser degree in the official 4.22 version as well.

    1. Exported shape keys from blender (2.79) cause strange shadows in UE4, no matter the mesh resolution. At first I thought that my former mesh had a too low quality, but that was not the culprit.
    The shadow doesn't correspond to the mesh shape. It looks like there were holes in the arms, but there aren't any holes. It seems to be some kind of lighting problem. It's at the same location, where the Morph Target has been applied. (removal of armpit bulge)

    2. The arms of a posed character in blender look smoother than in UE4. In UE4 there is a strange distortion (red marking). I can't explain it, because I don't even use any modifiers in blender, which could have caused problems with UE4, only the Armature Modifier. It looks as if the bone weights in UE4 and blender differ.

    Click image for larger version  Name:	ue4_mesh.jpg Views:	1 Size:	181.3 KB ID:	1616077Click image for larger version  Name:	ue4_wireframe.jpg Views:	1 Size:	393.2 KB ID:	1616078
    Click image for larger version  Name:	mesh_in_blender.jpg Views:	1 Size:	294.8 KB ID:	1616079
    Last edited by Bronislaw666; 05-07-2019, 09:50 AM.

    #2
    A few questions...
    What bones are being translated and what are the translation settings in UE4?
    What morph targets are you applying?
    Are you using FBX to export from Daz, to Blender, then to UE4, or any other import/export methods?
    What models are you using Daz3d? Genesis 8? 3?

    Comment


      #3
      The problem is with the normals and morph targets combination. Enabling "recompute tangent" is supposed to fix it (but I don't think it works)
      https://issues.unrealengine.com/issue/UE-33456

      Also skin cache helps a little, but not completely.
      Snap Plugin for EditorSnap Plugin for GamesModular Japanese House

      TwitterBlogYoutubeitch.io

      Comment


        #4
        For your first issue, enabling "Force all skinned meshes to recompute tangents" in the project settings definitely works. No idea though whether this specific version with dual quaternion skinning will work with that setting.
        For your second issue, I would suspect that the dual quaternion implementation in Blender and your Unreal version could be different causing the distortion.
        Just to be sure you can in Blenders weight painting tools use: "Limit Total" with subset "deform pose bones" and a limit of 8 (8 is the max amount unreal can deal with), then "Normalize all" with "deform pose bones" uncheck "lock active" and last use "Quantize" with "deform pose bones" and 255 steps (vertex weights get stored as a byte value as far as I know.)
        Randomized tiling function to eliminate repeating patterns in textures.

        Comment


          #5
          I was successful in removing the glitchy shadows by enabling "recompute tangent+skin cache (with force all skinned meshes to recompute tangents checked)". Will do further tests, but it looks good so far with several test poses.
          Concerning the distortion issue of the arm I now think too, that it has nothing to do with blender, but with the Dual Quaternion Version of UE4, because there is no arm distortion in blender, even after having limited the weights, doing normalisation, quantisation etc.

          @Kednerpo: Do you want to know the bone names and what translation settings info do you need?
          The morph targets I'm using are made by me in blender, because I'm using MakeHuman. (a higher resolution mesh) The export from blender to UE4 is done in fbx file format. (armature+mesh export)

          Comment


            #6
            @Bronislaw666: Sorry I thought you were working with Daz3D characters. It looked like the same issue I was having with bones not rotating the same way in UE4 as they do in Daz3d Studio causing morph target to not work correctly either.

            Comment


              #7
              Originally posted by Bronislaw666 View Post
              I was successful in removing the glitchy shadows by enabling "recompute tangent+skin cache (with force all skinned meshes to recompute tangents checked)". Will do further tests, but it looks good so far with several test poses.
              I just tested your approach, for me it doesn't work. It reduces incorrect normals in the armpits but it creates incorrect normals somewhere else, on the uv shells border where the arm and the torso uv shells connect. No luck

              Snap Plugin for EditorSnap Plugin for GamesModular Japanese House

              TwitterBlogYoutubeitch.io

              Comment


                #8
                as far as the slight tweak goes, I think your weight painting is either too strong - or - you are accidentally translating those bones in the animation. You should only be affecting Rotations, not Translations as you animate.

                Comment


                  #9
                  I'm using just one 4k skin texture for the the whole body and the shadows look realistic.
                  But what causes problems, is a mesh distortion at the upper arms, when they are raised.

                  Comment


                    #10
                    Originally posted by Bronislaw666 View Post
                    mesh distortion at the upper arms, when they are raised.
                    Which might be caused by bone translation in the original animation.
                    Read as - It looks like you dislocated his shoulder bones, are you sure they are where they need to be?

                    Comment


                      #11
                      The animation is correct (have even reset the rotation of the bottom bone of the upper arm where the distortion is and in blender it looks smooth, but on import into UE there are distortions.
                      I've limited the bone influences to 8, set smoothing to face in blender and even without showing any warnings the mesh does look worse in UE than in blender.
                      Is it possible that UE is truncating some bone influences on import in the background without even giving a warning about it or is it some rounding issue? I've got a high resolution mesh and need precise bone weight values for most realistic look of my character.
                      And if it is a problem with some shader calculations / rounding of values, where in the source code can I find that part and hopefully correct it?

                      Comment


                        #12
                        I think the issue might be just the retargeting again (it's fairly common).
                        are you leaving the skeleton empty when importing? Give that a try...

                        Comment


                          #13
                          It still doesn't change a thing. It seems as if blender takes smaller weights into consideration than UE4 (even without any warning about this in UE), esp. where the bones meet.
                          You can follow the discussion here for more background infos: https://www.daz3d.com/forums/discuss...ages-inside/p5

                          Comment


                            #14
                            What happens if you pose the mesh in blender and export only the mesh?

                            Also, I have literally rewritten half the FBX exporter. The issue is not on the blender end or the import to unreal end.
                            The armatures and meshes behave like expected (comparable to maya and 3dsmax, which is exactly as drawn.

                            The things that affect a character animation import are the retargeting and improper setup of bone rotations as well as bad export settings.

                            Maybe you could film your import/export process so we can review it and try to catch the issue.

                            Another thing you may want to check is that your shoulder bones aren't rotating 360 deg around in this animation compared to where they are suppose to be.
                            reset the pose with alt g, alt s, alt r, and move the hands up again to see if you notice any changes.

                            Yuo could even just animate the arms going all the way up to spot when (at what rotation angle approximately) the issue starts to occurs.

                            Also, remember your kinetic chain. When you lift arms up the shoulder and clavicle adjust with it. If they don't you end up stretching and deforming the mesh rather then having a natural look. This may be part of your proble too. (The adjustment on the clavicle is very slight usually, so maybe there's even more to the issue).
                            Last edited by MostHost LA; 07-20-2019, 11:18 AM.

                            Comment


                              #15
                              If I export only the posed mesh without armature, it looks smoother (as expected) than the posed mesh with armature.

                              I can describe what I'm doing exactly to reproduce the problem.

                              I've got a skeletal mesh, which has been exported / imported with the following settings:


                              Click image for larger version  Name:	blender-export-and-ue-import.jpg Views:	1 Size:	247.1 KB ID:	1644573

                              Skeletal Mesh in Blender and UE4:


                              Click image for larger version  Name:	mesh-distortions.jpg Views:	1 Size:	206.3 KB ID:	1644574

                              This is with the UE 4.22.3 Version. In the Dual Quaternion Version from the DAZ site (link given above) the distortion is even more pronounced / worse.
                              As for the rotation angles ue should deliver the same results as blender no matter how extreme the bone rotations may be.
                              Normally I'm using the Dual Quaternion Version + Corrective Shape keys for the armpits, so some poses may look wrong without preserve volume checked, but look good with preserve volume + shape key.
                              Last edited by Bronislaw666; 07-20-2019, 04:03 PM.

                              Comment

                              Working...
                              X