How To Make a Simple Crystal Material In Unreal 4

By Zac Jackson

 

While working on the materials for some of the crystal formations in Origin Story, I was having a difficult time narrowing down simple crystal material. I found plenty of complex and complicated material tutorials that would work great for crystals, but we wanted something more simplistic. So I figured, why not write a tutorial on it? This one will be quick and easy!

Requirements:

  • Unreal 4
  • Some knowledge of Unreal’s blueprint system

Tutorial:

Step 1: Open up your project and create a new material by right-clicking in the content browser and selecting “Material”. In the example below, I named it “M_crystal”. Double click on the material, this will open up the material blueprint window.

 

 

 

Step 2: Once we are in the material blueprint window, we will first need to choose the color of our crystal. To do this, we will need to make a constant. Right click anywhere on the blueprint and type “constant” without quotes, into the search field. After you’ve found it, click on Constant3Vector.

 

 

Step 3: Now that we have our Constant3Vector we need to assign the color of our crystal to it. In the details pane of the material, there is a section called the “Material Expression Constant 3Vector” If you click on the solid black line it will open up a color selection window. I chose a light blue for this tutorial, but really you can choose whatever you’d like.

 

 

Next, we need to connect the Constant3Vector to the base color. click and hold the small white dot in the top right of the Constant and drag it to the base color.

 

 

Step 4: Right-click anywhere on the blueprint and add another constant. This time though, we only need a single Constant and not a Constant3Vector. Connect the Constant to Metallic and also to Roughness.

 

 

Step 5: We need to add light refraction. To do this, create another Constant and connecting it to Refraction. Change the value of the Constant to 2.42 as that is the actual index of refraction for real crystals.

NOTE: Refraction won’t work unless you make your material translucent. I didn’t plan on making my material translucent, but if you want to achieve a slightly different effect, do so and read “Another Option: Make it Translucent” below.

 

 

Step 6: Hit the “Apply” button in the top left of the screen and then close the M_Crystal material blueprint window.

Step 7: Time to test it out! Drag a cube on to the level from the Modes menu, under basic. Then drag your material from the content browser on top of the cube to apply it.

 

 

A cube doesn’t look much like a crystal, so I recommend using a model of one to really see what this material looks like.

 

 

There are some additional options here that we can do to our material if we’d like more variety.

Another Option: Make Glowing Crystals!

Say we want our crystals to be in a cave, and because of that, we want them to glow to add to the atmosphere of the game.

Step 1: Add another Constant3Vector to your material blueprint. Also, add a regular Constant and a “Multiply” node.

 

 

Step 2: Once you have them in, we need to connect the Constant3Vector to the “A” of the Multiply node. Then connect the Constant to the “B” of the Multiply node. After, connect the Multiply node to the “Emissive Color”.

 

 

Step 3: Now you can mess with the Constant3Vector to change the color of the glow, and the Regular constant is the intensity of the glow. So that we do not confuse this later, you can highlight the constant by clicking on it, and then clicking the “c” button on your keyboard to leave a comment. For this example, I’m going to set the glow to a deep purple, and the intensity to 10.

 

 

As you can see in the preview window, my material now how a purple glow it to it.

Step 4: Hit the apply window and you are done!

 

 

This is how mine turned out. I had to cover the opening up on the template level to block out the sun and set the intensity of the light source to be much lower to really get the full effect of a cave here, but that’s because of the way I was rendering the lighting. I would recommend rendering the lighting after you’ve done this to see the full effect. You can also add a light object to the crystal to really make it glow!

 

Another Option: Make it Translucent!

You can achieve a different look by changing the material to be translucent and adding a little bit of opacity.

NOTE: You can either leave the emissive glow that we previously made or disconnect it for a completely different look. For the sake of this tutorial, I removed it from my material.

Step 1: Add another constant to your material, and set the Material expressions constant in the details window to 0.7. After that, connect it to the “Opacity” node.

 

crystal tut 2

 

Step 2: Deselect the Constant, and go to the Details tab of the material. Under Material, Change the blend mode to Translucent.

 

crystal tut 3

 

You’ll notice now that The Refraction node now lights up, as well as the Opacity node. Your Material should now look something like this when applied to a mesh:

 

crystal tut 1

Additional Resources For Making Crystal Material

If you are looking for a more complex material I recommend this crystal material tutorial from Blueprint Games.

Don’t have a crystal to test your new material on and want to make your own? You can use Blender and follow this simple crystal modelling tutorial from Michael Novelo.

How to Make Animated Lava in Unreal 4

By Zac Jackson

So you’re working on recreating the fiery pits of hell but you are not sure how to make the basic component of hell, lava. Not to worry! We have a tutorial on how to make your own lava in Unreal 4! Creating lava is a fairly easy and straightforward process. We can use this same process to create flowing rivers, waterfalls and more! Let’s get started.

 

Step 1: Create a new 3rd person project, make sure that use the starter content.

 

Step 2: Right click in the content browser (bottom of the screen). Click “material”, name it whatever you like. Once created, double-click on your newly made material and open it.

 

 

Step 3: Now you should be in the material editor. Right-click anywhere and type in “Texture Sample”, and then choose your lava texture. Alternatively, you can drag and drop the texture you want to use from the content browser.

 

 

Step 4: Click on the newly created texture sample and look to the left side of the screen. Under Material Expression Texture Base, there is an option to choose a texture, click on this and choose your lava texture. Alternatively the starter content we opted in for that the beginning has a lava texture named “T_Fire_Tiled_D”.

 

 

Step 5: Next, right-click anywhere in the material editor again, and type in “Panner” and add it to our material. Next to the word “Coordinate” on the panner, is a little hole with a white ring around it. Click on that hole, and then click on the “UVs” hole on the texture sample, this will connect them together.

 

 

Step 6: Add another node by right-clicking again, this time add “TextureCoordinate”. Connect this node, to the panner node, specifically the hole next to “Coordinate”.

 

 

Step 7: Drag and select all nodes at once, then hit CTRL + W on your keyboard. This will make a copy of these nodes.

 

 

Step 8: Click on the texture sample you just created, and change the texture to “Basalt_N” under its Material Expression Texture Base.

 

 

Step 9: Right click to the right of your textures and add an “Add” node. Connect the lava texture to the “B” of the add node, make sure you connect it from the bottom white whole on the texture. Then, do the same for the Basalt_NM” texture, except connect its red hole, to the “A” of the add node.

 

 

Step 10: Right click to the right of the add node, then search and create a “Multiply” node. Connect the Add node to the Multiply node. Next, connect the Lava texture to B on the multiply node. Connect the Multiply node to the “Emissive Color”, Connect the Basalt_N texture to Normal as well.

 

 

Step 11: Now we need to set the values of the panners we added earlier, this is going to make our lava move! Click on the first panner, and under “Material Expression Panner” on the left, change the speed of X to 0.01. Do the same thing, for the second panner.

 

 

Step 12: Now, right click to the left of the base of our material, and add two “constant” nodes. Connect one constant to Metallic, and the other to Roughness. Change the Material Expression Constant Value of the constant connected to the metallic to 0.3. Change the value for the second constant connected to the Roughness to 0.2.

 

 

Hit “Apply at the top of the material screen and save.

 

 

Step 13: Now, in the content browser window, add a floor static mesh to our scene. You can search for this in the content browser. Once that’s been added with can drag and drop our material from the content browser to the floor static mesh.

Before:

 

 

After:

 

 

You should now see a square with lava flowing over it! Congrats! You’ve created lava. You can move this around and put it in pockets you’ve dug into your landscape in order to make it look more realistic. you could take this same material, copy it, and change the texture from lava to water to create flowing water. Change the Panner parameters to make it flow faster / slower. If you need help with this tutorial feel free to comment below!