Thursday, January 29, 2015

How to Use Emissive Materials to Light Up Your Levels in UE4 with Blender and Substance Designer

In Unreal Engine you can use emissive materials to help give your meshes some character and light up your game. Basically, if you want your material to give off some light without having to add a lamp to your scene you're going to be working with emissives. This is going to be a short and relatively simple tutorial on how to create meshes in Blender and texture them in Substance Designer so that they can light up in Unreal Engine 4 using emissive materials.

Once you create your mesh, assign a material to the portions of your mesh that you want to light up. Hit the plus sign on the materials tab to add a new material, here I named mine "Emissive." Click to highlight the portion that you want to assign the emissive material and then click "Assign."

If you're using Substance Designer, this process as simple as adding an output, assigning it as an "emissive" output to your graph, and connecting your colored node to the output. 

To do this, press the space bar to open up the add-node menu. Select the "output" option. This will create a new output node on your graph. Left-click to select this node, and in the right column, name your output "emissive." Under the "usage" heading, click the "add item" button and change the drop down box that reads "diffuse" to "emissive."

You aren't limited to grayscale on an emissive map, so feel free to use colors to mix things up. Also, your emissive color doesn't have to match the color in your diffuse map. 

In the example below, I used a blue diffuse/base color, and a green emissive. This gives a different effect depending on the amount of light hitting the emissive material. As you can see below, on the right where light is shining directly on the mesh, you see the diffuse blue, but in the shadowed areas on the left of the cube, the emissive looks more of a blue-green.

The same effect as pictured below in the Unreal Engine with the top portion of the material receiving direct light, and the lower portion cast in shadow.

Alternatively, if you want the mesh to consist of only one material, then you'll need to use your UV map to create a mask for your emissive map. This is fairly simple because all you have to do is black out the parts of the UV that don't need to light up, and then color the emissive portions; now you have an emissive map. In the emissive map below, only the four blue squares will emit light. 

Once you have successfully created your emissive map and imported your mesh and materials into UE4, the only extra step is to connect the emissive map node into the "Emissive" input in the material editor and your mesh should now be lighting up. To make the light brighter, add both a multiply and constant node to your graph and multiply the emissive texture by the constant. The higher you set the constant value, the brighter the emissive material will appear.

If you want these lights to actually help light up your environment, put your mesh into your scene and then left-click on the mesh. In the "Details" panel, navigate to the "Lighting" heading and check the box for "Use Emissive for Static Lighting." 

Note: you can only choose this option for static meshes (ones that don't move around in your scene).

And those are the basics for emissive materials in Unreal Engine. We're going to try to push out tutorials on a more consistent basis, so feel free to make requests in the comments.

No comments:

Post a Comment