Announcement

Collapse
No announcement yet.

Blender 2.73 -> Xnormal -> UE4 : Normals and LightMap UV export work flow

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

    Blender 2.73 -> Xnormal -> UE4 : Normals and LightMap UV export work flow

    After spending a few days fiddling with the export pipeline from Blender to Xnormal to Unreal Engine 4.6.1., I've finally figured out how to get it to work properly!
    I haven't found other resources on these forums for this particular scenario so I figured I might as well share it!

    This method is intended for applying high-polygon sculpting details to a low-polygon mesh via a baked normal map.

    - Note that these steps are by no means the only way to proceed; this method worked for me every time I've tested it and is just quick n' dirty.

    - Note that I haven't tried it in combination with skeletal meshes, animations or LOD's.

    Chapter One : Blender

    The Low-Poly Mesh

    - Model your Low-Poly Mesh inside Blender, triangulate.
    - Assign as many Materials as you need to various parts of your mesh. Even if your materials aren't final quality, these will act as Material slots in your UE4 model. This must be done before Exporting.
    - Unwrap your mesh to a clean UV layout.
    - Create a blank/dummy texture for your first UV channel.
    - Under the Object Data tab of the Properties Panel, create a new UV Channel.
    - Create a blank/dummy texture for this UV channel. This will serve as the LightMap UV. Note that creating the UV channel without a dummy texture will NOT export the Lightmap channel at all.
    - By default, this UV layout will be the same as your base UV layout but feel free to modify it to better suit Lightmaps
    - Export to FBX with Smoothing set to Off and make sure that Tangent Space is Checked. Use the other export options as necessary for your model.

    The High-Poly Mesh

    - Duplicate your Mesh to another layer.
    - Set your new Mesh to Smooth (instead of the default, Flat)
    - Subdivide or Multi-res your new Mesh to your needs, Sculpt it, Add in the high-poly details.
    - If you notice that your High-poly mesh has some really extreme displacement, simply use a ShrinkWrap Modifier on your low-poly mesh, which will warp its vertices to better mimic the High-poly mesh's topology.
    - With your High-poly mesh selected, export to FBX making sure that Selected Only is checked.

    Chapter Two : Xnormal

    - Add your low-polygon FBX mesh to Xnormal's Low definition meshes section
    - Add your high-polygon FBX mesh to Xnormal's High definition meshes section
    - Under Baking Options, Choose a file name for your Baked Normals Image and set the image size to the same values which you've used for your dummy textures in Blender (default 1024x1024)
    - Select Normal Maps and click the Generate Maps button in the lower right corner.

    Chapter Three : Unreal Engine 4

    - Import your Normal Map, making sure that Flip Green Channel is checked and that the Compression Mode is set to TC_NormalMap. Make sure that sRGB is checked.
    - Create a new Material.
    - In your new Material, create a TextureSample Node which contains your Normal Map file, set its Sampler Type to Normal.
    - Create a ScalarParameter Node and set its value to 1.0.
    - Create a MultiplyNode. Connect the ScalarParameter and TextureSample to the Multiply Node's Input. Set the Multiply Node's output to the Normal Input of the Material.
    - This allows you to adjust the strength of your Normals quickly : 1.0 is "as imported", negative values will invert the normals.
    - Create a new Constant 3Vector Node and link it to the Base Color Input of the Material.
    - Import the Low-poly FBX file, making sure that Normal Import Method is set to Import Normals and Tangents
    - Set the newly imported mesh's Material to your new Material and Voila!

    Hope this helps out other Blender users in their UE4 adventures!

    #2
    Thanks for this!

    Do you have any more information where "FBX with Smoothing set to Off" is documented more? IE the Smoothing property of the exporter.
    Surfing on Sine waves.
    http://www.teotigraphix.com
    http://twitter.com/teotigraphix

    Comment


      #3
      @TeotiGraphix : I didn't make extensive tests with smoothing (either Edge or Faces) combined with Exporting Tangents. If Smoothing is set to anything but OFF, the Tangent Space option is disabled/greyed out. If anyone figures out the specifics of this, I'll gladly update this post!

      Comment


        #4
        For those interested, the entire process (using Blender and UE4 exclusively) has been V-logged by Kevin Vassey & friends at http://www.twitch.tv/unrealengine/b/623031933

        Comment


          #5
          @Simon Love
          Can you confirm that xnormal gives better results with regards to creating normals to what blender offers?

          Thank you.

          Comment


            #6
            @smallB : I haven't made side-by-side comparisons, basing myself on the UE4 documentation which states that Xnormal is the preferred way to create normal and AO maps.

            Comment


              #7
              @Simon Love
              Thanks
              Best regards

              Comment


                #8
                Hey Simon,

                I'm going to move this to the Community Tutorials section of the forums to help there as well. I'll leave a permanent re-direct here as well.
                Tim Hobson | Learning Resources | Epic Games
                UE4 Documentation

                Comment


                  #9
                  @Tim : Thanks!

                  Comment

                  Working...
                  X