Unity Shader Graph - Glowing Crystals Tutorial

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
so what is going on guys today i'm gonna show you how to create some glowing crystals from scratch it's a simple but super cool exercise and in the end you can create a lot of variations with the techniques i'm gonna show you i actually went an extra mile and added a few more elements like electricity smoke and particles which really adds a nice touch to the crystals if you have a few more hours and those versions are exclusive to my patrons and i left a link in the description in case you are dressed to have access to this project and many more effects for your games so without further ado let's jump right into it and let's see some crystals in the making we are going to need a 3d model of the crystals and then the crystal shader and i'm using unity 2020.3.11 with the universal render pipeline and in the package manager i have shadowgraph installed and here on my scene i have these crystals which are very simple to do you just need a few minutes and i'm going to quickly show you how i made them in blender so once you have blender opened up we want to select everything with a and we can press delete so we get a clean scene now let's press shift a so we can add a uv sphere and on this bottom left corner we can say it's 12 segments and 8 rings which is more than enough for what we need then you can press s and z to scale this up just a little bit and the idea now is to enter an edit mode with tab and if you select everything with a you can press space bar i'm going to search for bisect which you can find up here in mesh as you can see bisect and the idea is to click more or less around here then we can cut this however we want from the point we click it make sure down here in the panel you turn on clear inner and you turn on fill as you can see it fills i'm gonna do the same but for the opposite side as you can see but this time it cuts everything out that's because we need to unselect clear inner and turn on clear outer and that's basically all you need to know to cut the sphere into a crystal i'm gonna fast forward a little bit because we repeat this process a few times until we get to something that we like just wanna mention that for the bottom part i cut this from the left as you can see and then from the right or you can simply cut it horizontally that's fine and then i kept on cutting this just make sure that the top part is a little bit more pointy if you want you can basically cut it however you want i just made it a little bit pointy in the end and once you have a shape that you enjoy you can press s in my case i'm gonna scale it a little bit up like this in z only and that's pretty much it now in the end we just need to create some proper uvs i'm going to press 1 in the numpad so it goes into front orthographic view it's very important and i'm gonna drag a new window from this bottom left corner and up here i'm going to select uv editor make sure you are in front orthographic view the idea is that we enter in edit mode select everything with a as you can see the uvs rms and we want to press u and then select project from view bounds it will fill the wall uv area from this view now once again we are going to do a very repetitive process where we basically duplicate this several times we rotate it we scale it down we stretch it a little bit to the sides basically we try to create a cluster of crystals that we like we make a nice arrangement once you have a few crystals put together like these make sure you select everything with a and then press ctrl a and select all transforms so it applies correctly the scale rotation and location now we can simply save this blender file directly to the unity project unity will import this automatically as an fbx and now in unity all we got to do is drag this to the scene and that's it i'm just going to delete the other one that i made previously and now let's focus on creating the shader we want to make it glow and look shiny and we can do it by pressing with right click go to shader and select blank shader graph we can emit crystal shader and double click to open it up first in the graph inspector let's add universal as the target the material could lead to workflow metallic and the surface of back we don't need to change anything else what we need is to create two floats one for the metallic and the other for the smoothness and then turn them into a slider between 0 and 1 and connect them respectively down here to the fragment function of the shader and then we are going to need a color a base color for the crystals you can push it up here make sure it's in hdr and white with alpha at 100 and then you can connect it to the base color okay so that's the very basic setup that we got here now the trick to make this shiny and look beautiful is to use the fresnel effect with this node right here we can connect it to the emission as you have seen previously i have three colors on the crystals we got the base color and now we need another one for the top color and another one for the bottom color make sure both are in hdr mode with white as the default color we are going to start with the top color we can multiply it with fresno effect so we can basically add color to this fresnel effect and then connect to the emission let's save this and let's test this out by creating a material out of this shader with right click now i'm going to select all of the objects that make up this crystal and then drag and drop the material to the mesh renderer and let's see what we can do with this basic setup that we have created well first you can play with the metallic and smoothness properties it will make it shinier or not so shiny what i want to show you is that if we select the base color for example a blue and you start increasing intensity i get this awesome glow right this fantastic claw only happens because in the scene i have this global volume which has a profile with a bloom effect you can create one with right click if you go to volume you can select global volume and then create a new profile and then add bloom and whatever you want that's why it looks so glowy right another thing that i want to show you is that if we select the top color now this one controls the fresnel color and as you can see we have a second color we have the blue and red for example and it looks fantastic already with just this basic setup you increase the intensity and you get a red glow with hints of blue and that's so cool now what if we wanted two colors one from the top and another from the bottom well for that what we need is start with a gradient something that makes the uvs glow in the top part and in the bottom part so with the uv node if we split this the g channel if we multiply it as you can see in the bottom it's dark and in top it's white with this we can make a shine at the top and dark at the bottom but that's not what we want we want this to be used with a smooth step as you can see we can have access only to the bottom part the smooth step is a threshold basically and if we drag another line and connect it to a y minus node we get the opposite and if we connect it to a smooth step and increase a little bit the in value we get right at the top as you can see we have now separated the gradient which means we can control two colors with this so how do we do it well first we need to create a float to control the top line i'm going to push it up here and another float to control the bottom line i'm going to turn them into a slider between 0 and 1. bottom line can have a default value of 0.35 and top line can have a default value of 0.65 top line is this one and bottom line is for this smooth step now to add color to this we already have the fresno we just need to push this multiply to around here and the top color as well and multiply these two together the smooth step and the top color and then we can do the same for the bottom color you can multiply it with a fret note and then multiply it with the smooth step and then we simply need to add these two together and as you can imagine with this we can control the top and the bottom colors if you have done the uvs correctly like i've showed you previously correct this to the emission save this and if we go now to our shader in the bottom color you can select the dark blue for example if you increase the tct as you can see it's really at the bottom which means we can increase the line as you can see the bottom line now that color will influence a little bit more of the crystals you can make it shinier at the bottom or another color completely different as you can see and there's a very nice thing if you decrease the base color to dark we are left only with the top color and the bottom color as you can see now it's kind of pink at the top you can control the influence of this top color we can make it shinier at the bottom you can select another color for the top basically with this setup you can have three different colors and create some very cool and simple crystals it's simple the process of creating these crystals and you can get a very interesting outcome so yeah i played with this and made quite a few variations as you can see i then added some electric particles i'm gonna link a tutorial for that by the way if you want i also added some smoke i'm gonna link another tutorial for that and you can pimp this out so i hope you have truly enjoyed please consider subscribing and leaving a like if you want to get access to this project and many other projects that you can use in your games i left the link in description it's available my patreon page talking about patreon i want to say big thank you to each patron that supports me it really means a lot and as usual a special quick shout out to the top tire patrons which are elac frost alex burke jones irie koftikin bradford airman kathleen aladan cristobal velazquez vaults david cruz david mydliers donald thompson dewey trump goblin black gilliam c holo hostile mars game john denis polo jonathan paris josh mccormick jules clayne lyannos matthew chatter motor monster nat sims oitsk avi sands radioactive bullfrog riccard cruz tyler fritz and non-enigma verisuta and ingudah a big big thank you goes to each one of you you guys are awesome and your sport is super appreciated to everyone watch this thanks a lot for watching i hope you have enjoyed and i really hope to see you in the next [Music] video you
Info
Channel: Gabriel Aguiar Prod.
Views: 49,548
Rating: undefined out of 5
Keywords: Unity tutorial, unity effects, game effect tutorial, unity magic effects, unity game effect, unity vfx, vfx, tutorial, unity particles, unity, unity graph, shader graph, unity shader, shader, unity shader graph, shader graph tutorial, crystal, jewelry, glow, glowing shader, unity glow, unity crystal, unity jewelry, unity glowing, glowing crystal, shader graph crystal, crystal shader, jewelry shader, shader graph glow, unity bloom, blender crystal, blender, shader tutorial, graph
Id: 1GPvI-5bOSk
Channel Id: undefined
Length: 13min 14sec (794 seconds)
Published: Tue Jun 29 2021
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.