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!
- Unreal 4
- Some knowledge of Unreal’s blueprint system
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.
Step 2: Deselect the Constant, and go to the Details tab of the material. Under Material, Change the blend mode to Translucent.
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:
Additional Resources For Making Crystal Material
If you are looking for a more complex material I recommend this crystal material tutorial from Blueprint Games.