Unity Shader Graph - Ice Tutorial

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
what's up guys welcome back to guerilla gab brought today we are going to see how to create an ice shader and there are several types of ice it's not done in the same way across games as you can see but they all share two things in common which is the color light blue and white and refraction which is the way it influences the light so with that in mind I jump to unity and created this ice shader and I think the end result is pretty neat since it only takes a few minutes to achieve a decent ice material this is Oliver on my patreon page in case you're interested I left a link in the description all right so let's see how we can create this one but first this video is sponsored by Skillshare Skillshare is an awesome online community with an enormous amount of classes that goes from game development illustration animation and so much more once you are a member you get access to thousands of classes which means you can explore any classes you want about any topic personally what I love is the variety of topics for example in this class unity basics taught by David MacDonald I can create a monetizing game for Android and iOS in four hours plus you can ask questions directly to the teacher in case you have any doubts and you can join Skillshare by clicking the link in description the first 1000 users will get a two month of premium membership for free so you can explore your creativity at your own pace alright so I'm using URT in 2000 19.4 and before we start don't forget to go to package manager any style shadowgraph once that is done we want to create a new PVR graph and PVR because we need metallic smoothness and normals properties so the ice can interact with the light properly so let's open it up with double click I'm gonna dock it here and I'm also going to create a sphere and then create the material out of this trailer already and assign it to the sphere and I could be using main preview but we won't see the sphere interact with the scene next we need a few vector one properties the first one is going to be for the metallic property then we need another one for this business and one for the normals all of them are going to be sliders and the normals can have a minimum and a maximum of minus three and three smoothness is going to have a default value of 0.5 so let's drag it and connect it right here the normals we will use it in a moment right so now we need a color property for the ice collar we can use it in the HDR mode and then a texture 2d property for the eyes text and you can find this texture in a link that I left in the description by the way and once we have those properties what we really need now is the seen color note if we connect this to the albedo and save it you may get a few artifacts and that's appening mostly because you need to make sure that you go to your project settings in graphics select your Universal render pipeline asset and then turn on death texture and OPAC text and thus in color represents what the camera is seeing by feeding an input UV which is expected to be the screen position so once we do that it should work fine but it doesn't only because the surface of this shader is set to a back instead of transparent once we set it transplant we have a nice looking glass once we have glass we can distort it so it starts looking like ice the way we distort it is by using this ice texture let's sample it and if we multiply these with the screen position and feed it to the same color nothing much happens because in the material of our sphere we need to assign the texture again and now as you can see we have an absurd amount of distortion the way we control that distortion also known as eNOS of refraction is by using alert nodes the B option is going to be for the UVs completely distorted and a option is going to be for the UVs without Distortion the tea option is going to be a vector one call it the refraction amount with a slider between minus 1 and 1 I'm going to push it up here connected to the tea option now in the inspector once we start playing with this refraction amount we get a nice distortion but it's not quite properly distorted we need to after we multiply it we need to add it once again to the screed position without distortion like this and then replace the connection to the B option let's save this and now it looks a little bit better all right so we have a nice-looking distortion sphere remember what we also need is to distort the light so we need to generate normals from the texture from these texture right here and we can connect the normals vector one to the strength which is zero for now and then connect this to the normals input of the PBR master and now in the inspector once we start increasing the normals value we start seeing some distortion of the light we can also play with the smoothness and with metallic property the metallic property is going to be low but this moon is can go to around 0.8 I think it looks nice something more or less like this all right looking good now on top of what we have let's also add our eyes text alright that looks a little bit better we are just missing the color of the ice so let's add that we already have the property here we just need to multiply it like this and now in these able to select a color if you want you can also play with the intensity more or less like this should be fine once again this is up to your taste of course if you look back to the reference you will notice that we have this white most of the times a round off our eyes and the easiest way to add that is with a Fresnel effect which we can already go ahead and create a vector one for the Fresnel power with a default value of one and connect it right here what we can also do is I the caller property for the Fresnel collar change it to HDR mode and multiply it with the Fresnel effect without being done we can add these to our main pipeline and replaced the connection to the albedo and once we save this we have these nice whites all around we can adjust the radius of the Fresno the power of the Fresno and play with the color of the Fresno and with the ice one of the last things we need is a way to control the scale of the ice texture and that is easily done with a tiling and offset note connected to the UV of the ice texture and then we need a vector to call it the ice styling with a default value of 1 in the X and in the Y and connected right here to the tie link this will allow you to control the scale of the ice texture which is nice can be useful all right so instead of using a sphere let's imagine that we are using some crystals and I got these crystals from the asset store by the way from here so let's drag and drop our ice material just like this and unfortunately we get some strange artifacts and since it is transparent this happens fortunately we can easily fix this by increasing the size of the materials of the crystals to two or the second material we can create a new material that we can set two unlit which is lighter and if you assign that unlit material to the second slot we get these nice-looking ice crystals which I think they are beautiful and they are really nice you can also use delete version the difference is noticeable it's really up to your taste and if you are allowed to use a little bit more of performance and after playing around with the properties of the ice shell I end up with these values and I think it truly looks awesome in these crystals and it's an easy way to create ice inside unity which share the graph so that's basically it guys as usual this is a veil my patron page and when I say a big fan key to my patrons all of you your sport has been amazing and a special shout out goes to the super mega patrons which are Adam Bradley angel our dev dawdle Eric C goblin black hero syndrome in the game Himura SPC John Nicks Josh McCormack ramen yalla Kenley Luo Chun Qiang PS Regan aid Sylvia fumet Steven Melton TK czar and Zeiger you guys are awesome you guys Rock so that's it guys thanks for watching I hope you have enjoyed and I hope to see you in the next one [Music]
Info
Channel: Gabriel Aguiar Prod.
Views: 36,270
Rating: undefined out of 5
Keywords: Unity tutorial, unity effects, game effect tutorial, unity particle effects, unity particle tutorial, unity game effect, unity vfx, tutorial, unity particles, graph, unity, shader graph, unity black hole, unity shader, shader, unity shader graph, unity distortion, unity ice, unity ice shader, shader graph ice, shader graph distortion, ice, distortion, shader graph tutorial, snow, frozen, ice shader, material, ice material, frost, frozen material, ice tutorial, glass, glass material
Id: Gym5JWHgjkk
Channel Id: undefined
Length: 11min 1sec (661 seconds)
Published: Tue Jul 14 2020
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.