HOW TO CREATE A GHOST in Unity - Shader Graph Tutorial

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
now i know it's not halloween but here's a tutorial about how to create a ghost in unity and there is many forms and shapes of ghosts in games some are like this a little bit more realistic with the clothes some only use one cloth and others have this kind of shape that always brings back to memory the 1995 casper movie so i'm going to use that as a reference as well as the game luigi's mansion 3 so after gathering some reference i made these ghosts with the help of blender and unity shader graph these are some harmless ghosts don't fear them and they are all over my patreon page where you can get these and many more assets for your games links in the description so with that being said let's jump right into it and let's see how to create some cute spooky ghosts so this effect is composed of two parts the first part is a 3d model of a ghost i have created one in blender and i'm going to show you how to create a very simple one in blender 2 and then there's the second part which is the material the shader basically and for that i use a shader graph and i am using unity2020.1.14 and i'm gonna proceed with the universal random pipeline and in here in the package manager i have installed shader graph now here's the little fellow i've created in blender very simple very basic i can quickly show you how to create one too so in a new blender file delete everything and with shifter you can add a uv sphere and down here in the left panel you can control the amount of segments and rings if you want less or more i'm going to leave it at 32 by 16 rings and then still with the sphere selected i'm going to press spacebar and search for shade smooth with tab i'm going to enter in edit mode and select everything with a press 1 in numpad to have the front orthographic view and select only this vertice on top with b and then i'm going to press alt turn on proportional editing and as you can see i'm gonna push them up like this you can control the radius by scrolling up and down with the mouse wheel and i'm gonna select this button vertice and shrink them down with s and then unselect the ring and shrink them down a little bit more and now i'm going to press g to push them down more or less around here and now you can press 3 in the numpad so it switches to the right orthographic view and we are going to do the same and select move with g rotate with r and scale down with s and you'll get to a shape similar to this one and we can add another ring of vertices with ctrl r like this if you want for example now what really matters is that we select more or less around here this vertice and this one as well only these two vertices and then we can press shift s and select cursor to select it and now if you press tab you go to object mode and with shift a we can add another sphere for the eyes but this time i'm going to decrease the segments to 16 apply again the shade smooth and now with s shrink this down more or less to around this size and with s again i'm gonna scale up this only in the z axis and that's it we got an eye now if you want to compress seven on numpad to go to the top orthographic view and enter in edit mode with tab and select these vertices around here and delete them and basically now i'm going to rotate and scale the eye until it fits on the surface of the ghost once you fix the eye is looking good you can go to the modifiers this panel right here and add the mirror and for the mirror object we can select our little ghost right here and voila we have two highs and now you can tweak them however you want and for the final step i'm going to rename these objects to their respective name ghost and eyes with this little file being done now we can save the blend file directly to unity and once we go back to unity we can simply drag and drop it to the hierarchy to the scene and that's it we have our little ghost inside unity now for the second part the shader we can right click here and create the shader an unlit graph or a pbr graph the difference is that pbr graph will be influenced by the lights of your scene while unlit graph won't if you go with pbr graph you can connect everything to the emission i'm going to select unlit graph rename the shader and create a material out of the shader and assign that material to the ghost object and now we can double click on the shader so we can start preparing the ghost material i'm gonna dock this around here make some room and the first step is to set the surface to transparent and the blend to additive and that's it you can save this asset and you will notice that it has become transparent a little bit transparent and that's exactly what we want to start with and as some of you already are suspecting we are going to use the fresnel node we also have this little power input that is going to be super useful so let's create a vector 1 in the panel properties and call it the fresnel power or the fresnel power with default value of 1 and we can connect it right here and now we want to multiply this with some color so once again in the panel's property let's add a color property set to white and alpha to 100 and the mode to hdr we can connect it right here and then connect to the color input of the elite master press save asset button and here's the changes the fresnel really gives a nice touch and in this spectrum now we can control the fresno power and the color as well and you can increase the intensity of the color for some extra brightness let's add something inside our ghost like a second color but before that we can also duplicate the material we are using in the ghost rename it to eyes and drag and drop it to the ghost eyes down here you can decrease the fresnel power so they become brighter and you can even choose a white color if you want to create this this bright eyes and by the way i have created a volume with bloom and other post processing effects so we are going to use a little trick in here where we use the view direction of the object subtracted with the position vector of the object and if we connect this to a distance node leave the b option as zero it will give us a float that we can use to control the spread of the glow inside the ghost by subtracting with a vector1 name it glow spread which i'm gonna rename to interior spread in a moment default value of one and drag and connect to the subtract and then we need to clamp this so we make sure that the values are always between zero and one and finally we can create the color i'm going to name it to interior color like i said i'm going to change the glow spread to interior spread push the color up here select the white color increase the alpha and set the mode to hdr and then drag it to around here so we can multiply it with the clamp and all of this i'm gonna push it right back here and add it to the fresnel effect and once we save it as you can see we will have a white spot right in the middle of our ghost that now we can control in the inspector we can increase the interior spread as you can see and change the interior color to to anything we want like another blue for example go with some teal or red red looks cool actually yeah that's pretty nice one last property that we can use is actually a vector tree that we can aim to interior position if we connect this to the b option of the distance and save this asset now we will be able to inspector to control the center of the interior glow as you can see we can adjust it to whatever position we want and that's a really nice touch actually and if you want to add this jiggle if you want to play with vertex animation i got a great tutorial about it that i left in the description it's this one where we make this fish wobble so yeah that's basically it for this tutorial i hope you have enjoyed please subscribe if you enjoy for more of this content if you want to get your hands on all of these ghosts and much much much more effects everything is available patreon page and a special thank you goes to each patron thanks to you this channel keeps on growing and a big big thank you goes to super mega patrons the top tire patrons which are alack frost alejandro hernandez ck vfx david crew denis the geek goblin plaque in mariah's pc hostile mars game john nix josh mccormick jules klein novo archaivey oitsk and vincent maverick i hope you have all enjoyed this video thank you very much for watching and i really hope to see you in the next one [Music] you
Info
Channel: Gabriel Aguiar Prod.
Views: 40,429
Rating: undefined out of 5
Keywords: Unity tutorial, unity effects, game effect tutorial, unity magic effects, unity particle effects, unity particle tutorial, unity game effect, unity vfx, vfx, tutorial, graph, unity, particles, unity graph, shader graph, unity shader, shader, unity shader graph, unity fresnel, ghost, unity ghost, how to create a ghost, shader graph fresnel, shader graph ghost, ghost shader, fantasm, ghost tutorial, blender ghost, shader graph tutorial, fresnel tutorial, ghost effect, halloween
Id: KFMOD9jLCUg
Channel Id: undefined
Length: 11min 10sec (670 seconds)
Published: Tue Jan 12 2021
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.