From Blender to UE4 – Material and Texture

To end the struggle of Googling this subject and watching pointless videos which may help in last decade but not today. We are going to look how  you can import your mesh you build in Blender to Unreal Engine 4 with materials and UV maps.

Newer version here: https://levelparadox.com/2020/10/04/from-blender-to-ue4-mesh-and-material/

Blender

Switch to Cycles render.

Screenshot_1

Select Edit mode (Tab) and open UV editor.

Screenshot_8

Screenshot_3

Make sure all vertices are selected and then press U over your cube. Then hit Smart UV Project.

Screenshot_4

Change Island Margin to 0.03 (by clicking the right arrow once)

Screenshot_5

By doing this we can save us from a lot of trouble in Unreal Engine. And it’s easier to photoshop/paint UV maps when everything is not glued together.

Check out UE4 Lighting Trouble Shoot Guide:

Make sure that your UV islands have at least a 2 pixel spacing between them to prevent light bleed. Account for this based on the target resolution of your lightmap.

Result:

Screenshot_6

Switch back to Default view.

Screenshot_7

Go to material editor on the right and press Use Nodes.

Screenshot_9

Press the button pointed out in picture below and select Image Texture.

Screenshot_10

Then just leave it like this:

Screenshot_11

It won’t import pictures with FBX so you need to import them manually in UE4. Another thing you should know is that you need to UV map all your materials/vertices, if you have multiple materials and not just one area  to paint, if you don’t then result might look stretched in UE4 and it can even give you lighting problems.

Now you are pretty much done in Blender so export your mesh into FBX file.

Screenshot_12

Name it whatever you like and press Export FBX. Then you can save/close Blender.

Unreal Engine 4

New Project -> First Person

Press Import in Content Browser and locate your FBX file.

Screenshot_13

Uncheck Auto Generate Collision, click that small arrow pointing down:

Screenshot_14

Uncheck Combine Meshes. Make sure Import Materials is selected and then you can click Import.

Screenshot_15

Drag and drop your Blender cube from Content Browser to viewport.

Screenshot_16

Import the picture you want to add on your cube, im using some wooden floor texture found from google. Double click the material you made in Blender, it should be in Content Browser or if not then you can just click Add New -> Material  and when you are done with material you can just drag it straight to your cube in viewport.

Screenshot_17

In material node editor, move Material little bit right so you can see the color box (it’s called Vector Parameter) under it and then select color box and delete. Drag the picture from Content browser to material node editor.

Screenshot_18

Drag the line from Texture Sample to Base Color just like in picture below:

Screenshot_19

Press Apply and close material node editor. Now you should see it building the shaders for about 5 seconds or more.

Screenshot_20

And final result:

Screenshot_21

Extras

To make your material look much better you need to make Normal map and AmbientOcc map from your texture, you can use online generator for that: http://cpetry.github.io/NormalMap-Online/

When you’ve downloaded and imported both pics, drop them in material node editor and from Normal map: “top white -> Normal” and Ambient map: “red -> Roughness and Green -> Ambient Occlusion”

Check out the video for a lot more (1:05:03):

Check out my another tutorial: From Blender to Unreal Engine 4 – Workflow and Project Set up (2017)

2 thoughts on “From Blender to UE4 – Material and Texture

Leave a comment