[UE4] Modular Building – Lightmap guide

Dreaming of modular building? Big cities or just some interiors? But not sure how it would work with Unreal Engine 4?

If you ever been playing with Bethesda Creation Kit you know how those worlds are build, they are build from reusable assets or kits. Star Citizen is another example. So why can’t we do something like this with Unreal. Well Unreal uses lightmaps. CryEngine doesn’t use lightmaps, even Unity can get away without them. There is one problem and it’s with lightmaps…

Explained here:  Shadow Seams/Shading Differences with Indirect Lighting

What’s happening here is that each of these static meshes are sent to the CPU to be processed in the order they are received and on different CPU threads. This simply means that while each one has their lighting built by lightmass the others don’t know what the shading for the one before it would look like to reference the edges to make sure they match up. This leads to slight shading differences between each planar surface.

Creation Kit Fallout 4:

Problems with modular building in UE4:

  • The lightmap color continuity breaks if you try to achieve large wall from tiny objects.
  • Sometimes Diffuse changes color on object.
  • Instead of getting beautifully shaded wall you’ll get something that looks like from minecraft.

Typical (easy) solutions are:

  • Replace tiny objects with one large object.
  • Scale up the lightmap resolution till you achieve bluescreen.
  • Tinker around with light settings.
  • Watch more YouTube videos.
  • End your hobby/career.

It’s a challenge in Unreal Engine 4, took me 2 days to figure this out, so enjoy.

Assets from StarterContent:





Small corner made from 6 assets.


Lightmass settings. This will increase your lightning build time but it’s okay, we’ll survive. All in name for science!

Indirect Lighting Quality and Indirect Lighting Smoothness are most important. Static Lightning Level Scale makes lights more precise and increases building time, with Preview lights this has to be 0.1 to see any difference, with Production lights you’ll start seeing results from 0.5, going lower numbers like 0.05 doesn’t do anything. Num Indirect Lighting Bounces had no effect so whatsoever but Num Sky Lighting Bounces made some shadow errors in Plane Example, giving it more then 3 fixed it. Indirect Lightning Smoothness either fixes or breaks everything, 0.3 value or lower crashes Unreal Editor.

Preferred settings for modular building:


So i build some walls on other side and roof cause i wanted “interior lightning”.


How its build.


This is the final result i had. Smooth lightmap transition from edge of assets, some weird waves near top of door frames though. Art looks like all those thousands of early access Unity games in Steam. We can make money with this! As long as the player runs through this section 😀


Planes example:



Simple wall:


You want it to be smooth.


UV Matching

The lightning information needs to match from asset to asset so it’s important that uv’s are set up correctly. To see this layer click on Lit on viewport (top left) and find Lightmap Density.

Example of bad UV. Uv doesn’t match on floor. Problems on walls. Alignment problems on top left and right.

bad uv

Almost correct. UV matching on floor and on asset edges. Door frame is more complicated but as long as it doesn’t cause problems leave it like that.

correct uv

Where the assets are.

correct uv lines


To match the lightmap UV’s across the assets you need to use the Grid in Maya UV tools.

View -> Grid -> Click cube.


Set it like this:


Now you can hold X to snap on Grid.

If you have something complicate you can use layout:


Set it like this and hit Apply:


One cube is 1 pixel so we have 2 pixel padding here.


Set all your tiling asset lightmaps like this (match it to grid). Make sure that texel density matches up too. You should start UV mapping from the largest asset you have in your kit.

You can also do it like this:

Padding is not necessary…


with one island. but if you have more:


The result above was achieved with Match Grid.




So i exported this asset from may to blender and:

This is how it matches up with Blender’s Uv Grid (64×64).

One cube is 2 pixels here.

matching up in blender big

Zoomed in. Big cubes are 0.5 pixel and tiny cubes are 0.125 pixel.

matching up in blender


Something you should know is.

Here i have perfectly tiled wall. Right after re-import it looks like this.


But after lightning building it doesn’t match up anymore.


But it still looks good with Production lightning. It’s probably caused from how lightmaps are packed.



Problems, problems, problems…

Not really. It is it’s own artform and most people rather build house from one object and call it a day.

If Lightning quality is Preview you won’t see what you’re trying to achieve so you have to keep it on Production whole time which multiples building time or just trust your assets and settings.

Light building times for this scene was:

  • Preview: 10 seconds
  • Production: 1 minute 30 seconds

Good luck!



Unreal Forum – Lets make Lightmass EPIC (and understandable)

Unreal Forum – Modular Asset Lighting Problem

UE4 Answerhub – [bug] Lightmap color continuity issue

UE4 Answerhub – Lighting problem on Modular floor tiles.

UDK: 18 Important Principles for Creating/Using Lightmaps (Lightmapping Basics)

Docs UE4 – Lightmass Global Illumination


Blender – Worn edges (Photoshop)


UV Map

Creating Maps and Baking





Painting in Blender

Grayscale/Roughness (Map)


Photoshop Problems


Files and Q&A (Comments)

Workflow introduction

If you google “worn edges” or “destroyed edges 3d modelling” it just throws you bunch of addons which is frustrating. If you don’t wan’t to use addons and go through the process of installing and figuring out how the whole thing even works, we can create really good looking edges with Photoshop. And if you wan’t to go beyond that I’ve added lots of extra content on this article. You should get really good picture of whole work.

This tutorial is for beginners (or more advanced) so we’ll go through every step of Baking and working with Photoshop.

Uv Map


The most important part, oh yes! Uv map! What will ya do without it? Nothing.

The mesh:


Terrible result you’ll get with 3 seconds work:


15 minutes of work:


It would take me 32 images to explain how i did it. But small summary of it would be, mark seams and select one area you’d like to be an uv island and select Unwrap. Use Average island scale and finally Pack islands. It will get little messy but Pack islands does it work.

By the way: this is really good uv mapping practice, if your skills lack.


Creating Maps and Baking

You’ll need 2 maps. Ambient Occlusion and Diffuse.

New image settings (png):


If you haven’t switched to Cycles this is the point.

Create Material for your mesh and go to node editor and add:

  • Uv map
  • Image texture (Ambient Occlusion)

Pro tip: only add Uv Map node if you have multiple uv maps. With one uv map you don’t actually need it.


Baking settings:


And result:


Lets add 2 more materials in our mesh:

  • Make them red and black.

Assign EDGES to black material.


Assign WORN to red material.



Left Red color values.

Right Black color values.

Now we need to add baking targets in black and red materials.

  • Back to node editor.
  • Change image to Diffuse map you created.
  • Copy uv map and image.
  • Go to red material and paste.
  • Do same with black material.
  • Remove “WornEdges_M” material

Now we can bake Diffuse:





Create new photoshop document (2048×2048).

Select File -> Place embedded and add both your baked images (AO & Diffuse).


  • Create 3 Directories and name them like in picture.
  • Drag pictures in their directories and dublicate AO.

Right click on AO and select Blending Options.

  • Select Stroke.
  • Size to 10.
  • Color to light gray.


Right click it again and Rasterize Layer Style.

Go to Filter -> Filter Gallery.


  • Select Spatter.
  • Spray Radius to 9 and same with Smoothness.


  • And go back to Layer Style and in Blending Options:
  • Use the sliders till you get rid of white and black.
  • Only the Stroke color should be left.


This is how it should look like now:



Lets admire it in shitty lightning for a second:





It’s little bit combination of uv map and ambient occlusion. You can always make AO stronger in Photoshop though and get more edges out of it.

Best part is that you have really good control of edge width and how destroyed the edges are. Even if you do it thousand times you’ll always get the same result. Without Stroke effect result was really weak.

If one color don’t satisfy you, you can easily mask a grunge map on top of it and make it more interesting.

For Gimp users: you can archive stroke effect by holding alt and left click on preview picture (layer list). Select -> Border. And use effect like Shift on both axis.



Painting in Blender

We can fix it in Blender, it’s really easy…

Lets go to texture paint:


Umm… you need to select the material you want to paint on.


Color and brush settings.

Hide the ugly middle thingy:




Add where there is none:


Different brush color:






Remember to save your work.


Some things are in too hard places so lets paint straight on the image:










After few minutes you’ll realize “This is lot of work!” and never use this again.


Grayscale/Roughness (Map)

To make it react with light and act like a real world thing we need Roughness map.

I found it really robust thing to do with Gimp.

Just adjust brightness and contrast till edges are black and surfaces are white.


Maybe add little bit of Gaussian blur:


Doing it with sliders and curves in Photoshop:


Not as good as Gimp gave me:



Quick way adding rust.

Add Black layer.


  • Hold CTRL and left click on AO preview picture (layer list)
  • Select -> Border: 8 pixels (or just paint inner area with white and use Stroke)
  • Brown color
  • Paint Bucket
  • Filter Gallery
  • Spatter
  • Little bit different settings this time
  • Spray Radius 15
  • Smoothness 6


Back to Layer style and get rid of everything but brown color.


Photoshop Problems

Sometimes photoshop crops the image by itself when you export it and it looks like this:


So add white or black layer on the background and you’re good!



So how do i render it?

Whole material setup:

In Blender 2.78 theres Principled Shader. All you got to do is drag diffuse to base color and roughness to roughness and you’re done. If you want metallic map invert the result you got with Gimp, so black parts are non metallic and white parts are metallic. Plus you can only use 2 color values in metallic, black as 0 and white as 1, not anything in middle like 0.853.

Click here for better quality


Also i added two small balls. Other is glossy and other is matte. So i know better how things should look like.


Ball materials:


Green ball:


Files and Q&A

Article picture: https://www.blendswap.com/blends/view/74098

Mesh: https://www.dropbox.com/s/s0f4c2gcf5a0zes/edgeworn.fbx?dl=0

Unreal Engine 4 and Blender – Skybox

So basically, how to create or how to bake skymap in Blender and use it in Unreal Engine 4. We are focusing more of unreal part in this tutorial. Plus we are going to use Photoshop but you can do it with Gimp too, you just need to get gimp cubemap plugin.

Project files:

Blender File 2.78 (11 Mb) – GoogleDrive

Backup – Dropbox

Blender file is setup with world material nodes, cube, materials and uv’s. You don’t really need it if you have decent amount of experience with Blender. It’s more for beginners to study.

You need Nvidia texture tools for Photoshop to able to save as cubemap.


This is how we have set up baking cube in Blender.


Plane number 1 is pointing towards front ortho in Blender. If you rotate viewport counter clock wise around cube, we’re going through 2, 3, 4. Top is 5 and bottom is 6.

Note: number 2 should actually be front but we won’t get so good quality with that plan.


We have 6 Materials they each control one texture, UV map is overlapped (all with same rotation).

To pack it as cubemap texture we need to import all images in Photoshop and match it like this:


Baking box/cube is in layer 1 and visualization planes are on layer 2. We only need the cube to do the baking job.

Blend file is packed so first you need to unpack it. Uncheck “automatically pack into .blend” and “unpack all into files”. We are using 2048 x 2048 texture resolution.

You might like to change render device to GPU, goes like 8-12 times faster.


Select your cube and set bake type to Enviroment and hit Bake.


Go to uv edit and save all images.

Putting it together with Photoshop

Create a new document. Width needs to be Resolution x 6.


File -> Place Embedded


You can rotate texture number one from the settings on top and get it in right place by changing X to 1024.


You can also use Move tool. Don’t leave any empty space, make sure you use every pixel.


All in place:


When you’re done save it as DDS file.



Make sure you got Cube Map. After saving don’t close Photoshop yet.


Unreal Engine 4 -> blank project -> remove sky sphere from world outliner.

Import it in Unreal Engine 4. This might take a while. 2k textures should finish in 20 minutes, 4k textures takes 50 minutes or even more. You can actually cheat it if you first import with 512 px and re import with 4k textures. Re import always takes about 3 or 6 minutes no matter of resolution.

Update: seems like it works faster with 4.15.


Texture Settings and Material

Double click cubemap texture in content browser. Change mip map gen setting: nomipmaps and texture group: skybox.


Now we need to create skybox material so add a new Material.


Open it and change couple things like shading mode, two sided.


Drag cubemap texture in your material and set up it like in picture:

Constant value is 8 if picture is unclear for you.


Skybox Blueprint

It’s much easier if we just add empty blueprint rather then edit the one located in engine content.

Add blueprint class -> actor.



Open it. Add Static Mesh and name it something like skydome.


Go to Construction Script. Add Set Material and Set Static Mesh and make it look like in picture below.

Promote public variables to “New Mesh” and “Material” (right click).


Note the eye in Variables list.


Now you can add your own Sky Material and Sky Sphere (from engine content).



Change settings in skydome mesh.




Make sure you use right compression settings. Or you might get something ugly.


So much better.

Why i added that arrow there… (haha).



We can actually add stars inside our material in unreal. But first we need to get rid of stars we have in Blender.


Bake it again and save all images.

Lets go back to Photoshop.

Right click layer and click Replace Contents.


Match the number and hit Place. Go through all layers. Export as cubemap again and reimport in ue4 (right click on cubemap in content browser).


Go back to sky material.

Add Texture Sample and change texture to T_Sky_Stars (engine content).


Add few more things like texturecoord, scalarparameter, multiply and lerp.

TexCoord settings are:

  • Coordinate index: 1
  • Utiling: 12
  • Vtiling: 12

ScalarParameter value is 0.1

And connect it all like in below.


Looking good but stars should be behind moon. You can probably figure it out though *wink*.


If your scene is on planet this workflow doesn’t work well. Usually people wan’t more dynamic sky maps. But if your scene is in space then this is very good way to do it. But now you know how to work with sky maps in ue4 and that was the whole point of this tutorial.

Noise texture node in Blender made that white spot in textures. It helps you to see if bottom texture is correctly set though.

Thanks for reading!

Ubuntu Server – LVM with LUKS Encryption made easy 2017

How it works?

When you boot your server it asks for password (not your system user password) for getting the access to data on hard drive(s). You only need to enter decryption password for once in boot process.
LVM is made of logical volumes, volume group and physical volumes

  • Logical volume is place where the actual data is located.
  • Volume group is name for your group.
  • Physical volume is your hard drive.

Logical volume is the part where encryption and decryption happens

We can manage whole LVM setup with Webmin.


1 server, monitor + keyboard
Desktop pc or Laptop with Ssh like Putty
usb stick (2gb) or empty dvd


some files might take more then 10 minutes to download so consider starting the downloads right now.

Ubuntu server iso
Ubuntu desktop iso /kali linux (for verifying your data is safe)




Installing Ubuntu server with live cd/usb


Make your language selections.




Select No and select it manually from the list.







Select No.


Choose guided use entire disk and set up encrypted lvm.


Choose the disk where you wan’t to install the main system. Ignore all other disks for now.



Create another password for encryption.



You can manage empty space later on if you don’t like to use 100% of your disk.








At least select openssh.


If it shows you list of disks just select the one where you are installing right now.


Now it’s time to reboot.


And this is the part where you type encryption password.


And after boot.


Installing Webmin

Up to date installing instructions are located at:
Go for the option:
”Using the Webmin APT repository”

Adding a hard drive in LVM

Login to Webmin. Look for Dasboard and expand Hardware and go to Logical Volume Management.


Volume Groups
You don’t need to do anything here if you already have a volume group like in picture below.


Physical Volume
Click: Add a physical volume to ubuntu-gv


Select hard drive you wan’t to add, from list. If you can’t guess it from the list. Type in shell fdisk -l and type device name in the box located next to list. Device name like: /dev/sdc.


Logical Volume
Click: Create a logical volume in ubuntu-vg.


Add name in Volume name… extend_1 …extend_2

Click Create.


Click Logical Volume you just created.


Now you need to format it, so select ext4 from the list and click Create Filesystem of Type:


Continue by clicking Create.


If everything worked out:


How to format with shell command:

Use fdisk -l and when you find it do: mkfs -t ext4 /dev/mapper/ubuntu–vg-extend_2 (replace /dev/mapper/xxxxx with your version of course). Even tho it shows /dev/ubuntu-vg/extend_2 .. in the picture just use the version fdisk gives you.

Go back to your Logical Volume details and mount it. Example:


Make sure you have it right in LVM logical volume and click Create.


That’s the basics how you can manage it. If you wan’t to add more hard drives just shutdown your server and plug in a new hdd. You might even able to add it without shutdown if your motherboard allows it, just make sure you test that in the beginning when you drives are still empty. Now you can share it easily with Samba using the mount location: /home/xxxxxx.

Remember if you wan’t to remove hard drives and add them back later on, make sure you add comment mark # in /etc/fstab file.


Blender – Shortcuts, Buttons and Tricks in one place

Most of the shortcuts for Object, Edit, Uv mode. This is more like to-get-things-done list and doesn’t represent everything. Took me about 10 months to learn all this, through hundreds of youtube videos and blender docs. So i hope you save some time.


Mouse Left Set 3D Cursor location
Mouse Right Select
Mousewheel hold Rotate viewport
-Hold Shift to move.
Tab Switch between object and edit mode.
G Move selection
  -Move in one axis, Y, X, Z.
  -Multiple axis, Axis → Shift + Axis (works with Scale and Rotato too)
S Y, X, Z
  -Level/Flatten Selection, Axis → 0
  -Flip, Axis → Minus Button → 1
R Rotate
  -Y, X, Z.
Alt + S Shrink/Fatten
  -S or Alt For even thickness.
Z Wireframe
A Select/Deselect All
L Select Islands
C Select with circle
  -Scale with mouse wheel.
E Extrude
Ctrl + B  Bevel
Shift + Tab Snapping
Shift + D Dublicate
Alt + D Linked Dublicate
H Hide
Alt + H Unhide

Menus (Edit Mode)

X Delete
  -Del works too but X is closer.


W Specials
  -Your favorite.


Ctrl + Alt + Shift + C Set Origin/Pivot


Ctrl + F Faces


Ctrl + V Vertices


Ctrl + H Hooks


U Unwrap
-Start unwrapping so you can paint textures.


Screen Layout


T Left Panel
-If you wanna find a solution with your eyes


N Right panel
-Object scales, viewport settings.l


Shift + A Add meshes


P Separate
-Separates selection into another object.


Render, render layers, scene, world, object data, constraints, modifiers, mesh data, material, texture, particles and physics.


If you don’t remember just click the Mesh text, you can see in the pic below:


Menus (Object Mode)

Ctrl + A Reset, Location, Scale

Camera/viewport (num pad)

, (comma) Focus on selection
0 Swith between viewport and camera (if it’s added)
5 Perspective/Ortho
7 Top Ortho, Z axis
3 Right Ortho, X axis
1 Front Ortho, Y Axis
9 Bottom Ortho
4 Rotate Left
6 Rotate Right
8 Rotate Up
2 Rotate Down
Shift + C Reset distance and 3D Cursor location (only in object mode)


Ctrl + R Loop subdivide
  -You can’t live without this.
  -How pros use it: https://youtu.be/xFZazwvYc5o?t=25m23s
K Knife Tool
  -Add edges wherever you like.
Menu → Mesh → Bisect  
  -Cutting tool.
Recalculate Faces Ctrl + N
  -Flips drawing surface(s) in correct direction. Won’t always do perfect job though.
Triangulate Faces Ctrl + N
  -For Cleaning n-gons.
Faces menu Tris to Quads
  -Quads are always better then tris.
Smart Uv Project U
  -When you don’t have time for manual unwrapping.
  -Always uncheck ”Stretch to uv bounds”, it will ruin it. Rather use pack islands.
Pack Islands Ctrl + P (uv edit mode)
  -Margin settings goes to mesh edit window (left panel) for some reason but you can get the settings panel out it with F6 on uv editing window.
Get Rid of Gridfloor N → Display → Grid Floor
Better start up setup Start up fresh new Blender window. Delete camera and cube, then just go to: File → Save Startupfile.
Bridge Edge loops Specials menu
  -Best way to fill empty space between edges. F should be like the last option.
Smoothing Specials menu
  -If it’s a ball, add. If it’s a cube, don’t.
Slide Ctrl + V -> Slide
  -When you wan’t to move something along angled path.

Modifiers you should know about

Boolean – make holes, combine or just interact with another object.
Remesh – Rebuilds your whole mesh with quads.
Decimate – Less faces/vertices.
Array – Dublicates your object in desired axis.
Mirror – If you need to build something like human face, so you only need to model half of the face.
Subdivision Surface & Multiresolution – Adds more geometry/faces to your mesh and so makes it look more detailed. It’s pretty quad based.

Clean up Procedure, before you unwrap

1. Remove Doubles ( W )
2. Reset Rotation & Scale (Ctrl + A)
3. Fix Faces Direction (Ctrl + N)
4. Fix Pivot Location (Ctrl + Alt + Shift + C):

For rendering in Blender do origin to geometry.
Exporting for game engines, substance softwares other rendering platforms do: Origin to 3D cursor → Geometry to origin. Ctrl + C for resetting the 3D cursor if it’s not in zero place.

If you are doing something messy, better do this before “Remove Doubles” option: Mesh → Clean Up → Fill Holes.

Fbx export options you can find on my other tutorials.

Blender and Unreal Engine 4 – Going Commercial

If you are interested in working with Blender like building Levels, Props or anything, and make it work in Unreal Engine 4, plus sell it. There are some things you need to know, before you can sell it to the World. Your mesh may look just awesome in Cycles but when you import it in Unreal Engine 4, that’s the point where your life comes crashing down. Though you can’t really compare Cycles and UE4, picture render and game engine cause it literally is day and night.

Get rid of N-Gons


Plugin that will show you n-gons

Uv Mapping


Before you Export


Checklist – Before you sell


  • No n-gons. Only Quads and tris, more quads more better.
  • Perfect light maps.
  • PBR (Requires Substance Painter).
  • Smoothing everywhere (no hard edges).
  • Real World Scales.
  • Clean names.
  • Mesh can take Subsurface Modifier and keep its geometry, Suzanne is a good example.
  • Vert count as low as possible (low poly).

Have some LODs. If your object is designed to be used only once, in one level and it has less then 5000 verts then you don’t really need LODs.

200k vertices in one level is good, 1mill vertices is bad. But it all matters how much your graphic card is currently handling.

What i get with gtx 660: 100k = 120fps, 500k = 60-90fps, 1mill = 30fps.

Sometimes mipmaps can give you these white or black edges. It gets worse with large textures and there’s always some with 8192 and 4096 textures.

If you paint with Substance Painter it usually deals great with them and you don’t need to worry about it.

If you paint with photoshop or gimp always expand/grow base colors over uv island.


How much you should expand:

8k textures = 16 pixels

4k texture = 8 pixels

And so on…


Pivot Location

Keep pivot in 3D cursor spot and mesh located close to it (shift+c -> ctrl+alt+shift+c -> Origin to 3D Cursors).


Almost same thing with multiple objects but you need to be able to scale whole packet together, so set pivot according to that.


Let’s say if you have a car. Body has its own object and wheels + suspensions are another object and pivot for both objects are in same spot it will scale fine. But if pivot is located center of geometry for both objects, they will scale wrong.

Pivot in same spot:


Pivot in different places:


I cheated there little bit cause Blender doesn’t care much about pivot, it will scale it correct anyway, but the picture shows you the result you get in UE4.

If mesh is far away from zero spot it will import, but you may never find the mesh in ue4 after you drag it in level.


List is very big, but give it couple months and it will be drilled down into your brain.

You should also check out UE4 Marketplace Guidelines.

If you are planning to build a game then this is perfect thing for you, you will avoid several problems.

Believe it or not but you are now ready to make saleable-games, assets and so on.

Please check out: Texel Density tutor on Artstation by this awesome Ubisoft guy.




  • LOD = Level of Detail
  • Vert = Vertice
  • UE4 = Unreal Engine 4
  • PBR = Physically based rendering
  • Smoothing = Smooth Shading
  • Mesh = Static mesh / Object
  • Suzanne = Monkey from add object list (shift+a)
  • Zero Spot = Location 0,0,0

From Blender to Unreal Engine 4 – Workflow and Project Set up

Lets see how you can speed up things when working with Blender and UE4.

I faced some problems while making this tutorial and i didn’t go back and redo it, cause it was important to show you how to fix them. Someday you’re going to face same problems too.

Let’s start with Creating New Project in UE4. Create new project -> first person.

Softwares used in this tutorial

Substance Painter 2.4.1

Unreal Engine 4.14.3

Blender 2.78

Blender setup

Now while UE4 is loading in background you can start Blender and make some shortcuts. Plan is that you can export with just a couple buttons instantly, you are going to use export fbx option so many times.

Select: File -> Export -> FBX (right mouse) and Add Shortcut.


Go into Export -> FBX and do the same with “Export FBX” button located in right top corner.


If you have a gaming mouse it usually got some extra buttons so what i did, i set up couple buttons from my mouse to these export choices.

Make sure you have Units set up as Metric.


First i added Cube.


Then i went into Edit mode and Selected all -> Mark Seam.


U -> Unwrap


Uv Edit mode -> Select all -> UVs -> Pack Islands


Change island margin to 0.03


Object mode -> Add Subdivision Surface modifier


Set view up to 4 and Apply.


And this is how it looks like in Uv mode now.


Add Material. When working with UE4 you should use form like this when naming your materials: “M_NAME” so just add M_ at the start. Name your static meshes like this SM_MyMesh.

With personal projects i only add _M end of the material name and leave meshes without SM_, like this:




This is how you should save Blender file.

Documents -> Unreal Projects -> MyProject:


And add Folder “Meshes” right here

Documents -> Unreal Projects -> MyProject -> Content:


Save your Blender File:

In Blender Folder.


Export Settings in Blender:



Export it in “Meshes” Folder you created like 5 seconds ago.

Now when you hit “Export FBX”, jump to UE4 and you should see this:

Check “don’t ask again” and press import.


Import settings. Uncheck some things like Auto generate collision and Generate Lightmap UVs, Combine meshes.


Unreal Engine 4

And it should look like this:


One thing i forgot to add was…


Shade Smooth but that is like 3 second job


Now Export it with your shortcut buttons, for me it was just two clicks with my mouse.

It gives you message when it reimports it automatically, all you need to do is just export it in Blender.


Looking really good.



So since we didn’t generate uv map for lights (that button you unchecked in ue4 import settings), we need to make it in Blender.

Select your mesh and go to mesh settings. There you’ll find UV Maps and just press plus button to add a new one.


In Uv edit mode you can take a look at it (follow red arrows):


And how you find it in UE4 (double click the mesh in content browser):


Change “Light map coordinate index” to match channel number:

Note: if you import with 2 uv maps it selects “Channel 1” automatically. In this tutorial we imported with 1 uv map so it selected “Channel 0”.



Q: Why should i build lightmap myself and not use “generate lightmap option”?

A: It’s a very unprofessional way. After all it’s almost as much work as turning that option on in import settings. Once you start knowing how lightmaps work in unreal engine with different shapes, you can find the max quality of your work easily and avoid the error of clusterf*cks coming on your way.

Q: If i edit my mesh in Blender, do i need to re-unwrap lightmap as well as texture uv map?

A: Yes you do.

Lightmap Problem

It may look fine but when you build lighting then you usually see some problems:


So first what i did. I increased Pack Islands margin:


Looks fine after Reimport.


But when i build lightning. It comes back again.


So i ended up doing this:

  • First i cleared old Seam
  • And made seam in middle
  • Unwrapped
  • Manually moved them in nice places




After lightning build, it was perfect.



So i opened Substance Painter and made something like this with it:

  • Fill Layer
  • Material -> Painted Steel


Export Settings:


If you’ve been using Import button before, you know exactly how awesome feature this is:


Material node setups.


Where i saved the file.


Well it didn’t do perfect job, some seams are visible.


It was looking fine in this picture though.


That could be fixed by doing the same thing like with lightmap uv. But it’s just extremely hard to paint with any tool, cause of stretching. Changing the UV Projection to Tri-planar in Substance Painter fixes it too.

So here’s the workflow:


You can also import multiple objects in one FBX file, but sometimes when you reimport it duplicates everything and you end up with 2 assets in one object so it’s just much more clean workflow with one object per FBX file.

There’s addon for Blender which does all this work, Google for “blender ue4 tools”.


Check out my another tutorial: [UE4] Modular Building – Lightmap guide (2018)

Blender – How to texture rocks, round objects

I’m sure you’ve seen some youtube videos with pretty dumb workflows and result is terrible, sphere projection -> minimize stretch… nope.gif

This is not what you want:


Well answer is pretty simple, instead of working hours with complicated UV Map and trying to get the map fit over one cubic image and do that without any stretching, just like some kinda Master Wizard of 3D world with super magical wand. We can simply just use smart uv mapping and paint your object with single texture or multiple textures (in 3d viewport), all that just with the tools inside Blender. This way you can create whatever shape you want and let the computer be the wizard for once.

This workflow works with all kinds of round objects, rocks, trees, cliffs and everything where uv map is just a total mess. You could probably paint your object in Photoshop too if you  import your mesh in 3d mode and know how to use brushes in there, but whole job is so effortless in Blender once you just figure it out.

Sculpting a Rock

Remember to turn Cycles Render on

Add Ico Sphere

If you are a beginner with sculpting then you should always start with ico sphere, if you want some cliffs then start with cube.


Switch to Sculpt Mode


Enable Dyntopo

Turn Mirroring off


Go all around the object with it, just one round. Till it looks like this:


Next step imagine that you are trying to make it look like a cube. Look it from this angle:


Just go one round around it.

Don’t go here (upside):


And just make those corners come out little bit.

After that switch brush, select F Crease:


You need to change some settings

  • Dyntopo Detail 5px
  • Subtract on
  • Auto smooth around 0.5
  • Brush strength 0.25
  • Brush size 35px


Stay on same distance and just go one round again, all around object, till it’s something like this:


Now you can use Flatten Brush


Just go in random places, wherever you like and add small flat areas:


And that’s it!

  • Switch back to Object mode ->
  • press tab (edit mode) ->
  • press W, make sure everything is selected ->
  • select Shade Smooth:


UV Map

Switch to UV Editing


Make sure you are in editing mode on right viewport and you have everything selected:


Press U (on right viewport), select Smart UV Project:


Island Margin 0.03 and OK:


Result (left viewport):


Now we need to check stretching, press N to open Display Settings and select Stretch:


Click UVs, and Minimize Stretch (picture below). Blue means it’s not stretched, every other color means stretching and how much. It might go worse or better, you just have to decide yourself but if you have red or yellow parts and they disappear with this option then you should use it but blue to yellow is ok, yellow to red is bad. Hit Enter to stop Minimize stretch. Go back with ctrl + z and select minimize stretch again and look all around the map, you might need to do it for few times till you see everything.

I only used minimize stretch for once, Smart uv project does its job very well.


Texture and Painting Setups

Object Mode

Lets add Material to our object.


Click plus on right first and then New:



Now it might be a good time to Save your project cause it might crash or just lag for too long.

Go to texture, pointed out with arrow. Make sure you have Brush:


Add New texture and Open:


Now it’s time to choose texture you want to use on your rock object. You can go hunt your own or use this:


Before you can start painting go back to uv editing and add New Image:


Set your material, Color -> image texture


Vector -> UV


And select image you created:




Now you should be ready to Rock (literally):


Just in case.


  • Material
  • Uv map
  • Image
  • Brush texture
  • Paint Mode
  • Project saved
  • Coffee (or your choice) 😀
  • Artistic Imagination

Let’s go over some settings:

Brush strength should be full for first round, after that reduce it to 0.8. Keep Blend mode on Mix whole time.

Set Size, x and y to 0.1


Keep viewport distance same whole time. Now just paint it for first round.

If you see some stretching:


Aim your viewport at it and wipe it with brush:


Look for more stretching:


If you want some parts to look different:


Just move your viewport little bit and paint the area again:


Check out the result on uv edit:


Now that is pretty awesome compared to result of shitty youtube videos, right? 😀

You can add more textures:




And Paint with it:



Have Fun! Thanks for reading the whole tutorial. And hope you learned something new today.

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.


Switch to Cycles render.


Select Edit mode (Tab) and open UV editor.



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


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


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 Lightning 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.



Switch back to Default view.


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


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


Then just leave it like this:


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 lightning problems.

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


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.


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


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


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


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.


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.


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


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


And final result:



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)

Unity 5 2D Animation Tutorial

A game without animations would be really dull thing to play and probably wouldn’t be popular, who would want to watch sprites flying all over the screen?
Lets learn (in 5 minutes) how to make animation in Unity 5, so you don’t need to watch those 1 hour tutorials which are pure torture 😉

First you need sprites, lots of sprites in one image so i made this animation with gimp, you can probably look for something better but lets use this for now.

(right click -> save…)



Start by opening Unity, choose 2D and hit Create project.


Now you need to import our png image. Select Assets -> Import New Asset. And choose the png image.


Now you need to select our image in Assets and then you should see Inspector. In inspector select Sprite Mode -> Multiple and Apply. Now hit the Sprite Editor.


In Sprite Editor select Slice and Slice once again. That should make boxes around our images. And then press Apply and you can close Sprite Editor.


Now  you need to press small arrow in Assets where our cropped sprites are. Arrow opens up bigger preview of them and then select them all (ctrl + mouse left) and drag them into Scene, it should automatically ask you to save it.


Now go to Window -> Animation.


Just select our spaceman in Scene and then press Create button in Animation window.


Now you should have your animation ready, if you press play button in Animation window you should see our spaceman walking super fast. If you double click one of the blue cubes you can adjust the timing or change Samples to 30 to make it walk slower.