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

I’m going to show you how you can speed up things when working with Blender and UE4.

I faced some problems while making this tutor 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 need.

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 what i recommend for the best workflow:

  1. Create project with UE4 – 1 Minute
  2. Build mesh with Blender – All the time you need
  3. Add Material – 10 Second
  4. Add Uv Map for textures – 10 sec – several hours
  5. Add Uv Map for lights – ^
  6. Export in FBX – 10 Seconds
  7. Import mesh into UE4, which it does automatically after first import
  8. Setup Basic Material, just white. – 10 Seconds
  9. Drag & Drop mesh into Level – 2 Seconds
  10. Build Lightning – 2+ Minutes
  11. Check and fix errors – Minutes… Hours…
  12. And you are ready to paint textures

Trust me you could do much worse without the auto import in Unreal Engine 4, 90% of the people who work with these two applications don’t even know about it this. And always test the mesh or whole scene in the game engine before you start texturing.

There’s addon for Blender which does all this work, Google for “blender ue4 tools”. Tho i’m not sure if it works cause it was made like 2 years ago and import settings seem to have changed a lot on unreal since that.

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.


Phpvirtualbox for Ubuntu 16.04 Server – Install Tutorial 2016

Install VirtualBox

Login as Root and install virtualbox

sudo su

apt install virtualbox

Lamp Server

We need to install apache and php7, you can remove mysql-server from the list if you don’t want to add it right now.

apt install apache2

apt install mysql-server php7.0 libapache2-mod-php7.0 php-xml php-soap

Make a new directory and modify apache DocumentRoot

user = your login name

mkdir /home/user/public_html

chmod 777 /home/user/public_html

nano /etc/apache2/sites-available/000-default.conf

change DocumentRoot to this:

DocumentRoot /home/user/public_html

and add this, just like in image:

<Directory "/home/user/public_html">
Require all granted


Add json and soap extensions to php config file

nano /etc/php/7.0/apache2/php.ini

scroll down till you see extension list and add these, and then just restart apache:


/etc/init.d/apache2 restart


Now we need to download phpvirtualbox

wget http://downloads.sourceforge.net/project/phpvirtualbox/phpvirtualbox-5.0-5.zip

And get it out of zip file, so install unzip

apt install unzip

unzip phpvirtualbox-5.0-5.zip

If the link is not working you can get it from here: https://sourceforge.net/projects/phpvirtualbox/ 
You need to click Download and copy Direct link

Modify phpvirtualbox example config file

Change if you need: vbox = username for your virtualbox config

cd phpvirtualbox-5.0-5

nano config.php-example

var $username = 'vbox';
var $password = 'mypassword';

var $location = 'http://localhost:18083/';

scroll to the bottom of file and add this: ?> if it doesn’t exist already

then save it as ”config.php

Move phpvirtualbox dir to your apache directory

cd ../
mv phpvirtualbox-5.0-5 public_html/phpvirtualbox
cd public_html

chmod 755 phpvirtualbox

chown vbox:vboxusers phpvirtualbox

Make a new user and usergroup

useradd -m vbox -G vboxusers

Edit virtualbox config file

nano /etc/default/virtualbox

This goes at the end of file:



If you can’t login through phpvirtualbox webapp, then you can try to add this:


It should point out you in the right way finding out the problem.

One more thing, we need to add vboxwebsrv app in the boot process. Edit custom boot list:

nano /etc/rc.local

Write this: sudo -u vbox vboxwebsrv. Make sure that the file ends with: exit 0

Then reboot your system if you don’t want to start it with screen command

And its working! Or not?


16.10 Users

Login on phpvirtualbox website with admin:admin -> File -> Change password.




Type your system login names in config.php file:

var $username = 'user';
var $password = 'password';

Or create another account with different name, set password with passwd user. “Vbox” is not allowed in config.php file.

Type top in shell to see if “vboxwebsrv” is running. If not, you need to play with “/etc/default/virtualbox” file or just start it manually. There’s a service script which should start it at boot but it never works, especially if you have Samba on your system.

Config.php user settings and with what account vboxwebsrv is launched needs to be same.

How to fix vboxweb service file and add it in boot process (tested in 16.10):

vboxweb service file location: /lib/systemd/system/vboxweb.service

Edit permissions:

chmod 755 /lib/systemd/system/vboxweb.service

and check if it’s just not empty file:

nano /lib/systemd/system/vboxweb.service

Incase it’s empty, add this:

Description=VirtualBox Web Service

ExecStart=/usr/bin/vboxwebsrv --pidfile /run/vboxweb.pid --background


Now Enable it:

systemctl enable vboxweb.service

now reboot and see if you can login on phpvirtualbox website without starting vboxwebsrv manually

If it didn’t work you might wan’t to edit:

nano /etc/systemd/system/multi-user.target.wants/vboxweb.service

or use Webmin:


And add User and usergroup right here:

ExecStart=/usr/bin/vboxwebsrv --pidfile /run/vboxweb.pid --background
User=(username you use in /etc/default/virtualbox file, make sure it got password)
Group=(usergroup ^)

Some people say it might ruin virtual disk file with root user, when you resize it. So check it out before you do anything important.