Unity Shader Graph - Galaxy Shader Tutorial

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
what's up guys welcome back to the brillig abroad today we are going to see a simple shader that has very interesting outcome it's the galaxy shade and it looks pretty cool in a lot of objects and a companion with a few particle systems it can look pretty interesting and by the way I made all of these 13 galaxy effects variants that are only available at patreon page and a left link in description in case you're interested you help the shine on going forward and you get access to some pretty cool effects shaders and more that you can use in your game all right so we're that being said let's see how we can do this so here's the why but this character is from mix ammo by the way and I'm going to create a galaxy shader for this character with an unlit graph and I am in the universal render pipeline by the way you can start with other graphs if you want there shouldn't be a lot of difference and only it only means that it will not be affected by light by the way and once we created the shader we can double click it and basically the idea of the shader revolves mainly around one node the view direction in world space this basically gives access to vectors that goes from the vertex of the mesh in direction to the camera so let's first add a cube map property called galaxy and I'm gonna choose one of these galaxies don't worry I'm gonna show you how you can create your own galaxy text in just a few moments and we are also going to need a color for the galaxy color in HDR mode with full alpha and white as default I'm just going to push this up here and now we can drag-and-drop the cube map and we are going to sample the cube map with a sample note and now we can connect the view direction note to our sample cube map and we can already connect these to the color input of the leap master and if I go to unity and create a new material out of this shader if I assign it to my character we already get this basic F that looks pretty cool looks already pretty interesting but first you still need the galaxy text right so for this story on for academic purpose actually recommend going to google and simply search a galaxy text with at least this resolution because we really need to have a big texter for this to work out otherwise it may look a bit pixelated and you can choose any of these Texas but preferably one that only has galaxy and no landscape or something like that so anything with an irregular shape it's going to make that order to make it seamless you know and for this to become a seamless texture we can go to Photoshop for example and now in filter we can go down here to other and we can choose offset and the amount one offset depends on the resolution of your text okay so first I'm going to offset this horizontally then to fix this seem that we are right in the middle the idea is to try a few tools and see which one works well the first one I'm going to try is the Spot Healing Brush tool and with a big enough brush I'm going to pass right on that seam and it's actually not that bad for a start now I'm going to use another tool the Ealing brush tool with this tool I can select a spot as a reference with Alt + left click and then pass with this brush to extend some of the parts of the galaxy and to fix a few things that are not really right now I'm going to again go to filter other and offset this but this time vertically and I'm going to try out the Spot Healing Brush to see how it comes out and this time it actually doesn't come out that good so I'm going to do it all with the Ealing brush tool I'm going to cite a few spots and extend them throughout the scene and I repeat this process until I end up with a seamless texture at the end you can once again offset back to a melt you have offset it before once you import the text to unity make sure to change the text to shape from 2d to cube map change the mapping to auto and also turn on fix up edge seams and not forget to press apply then you are no need to assign the galaxy texture to the shader to the material more specifically and you will get something very similar to these at least but that's not exactly how we want this galaxy cube map to be map it because it isn't quite facing the camera back to Sheila graph what we can do is create a vector tree and connect it to the normal input of the sample cube map this allows to point which axis is facing the camera I'm going to set one in the Y which in other words it's also the blue Channel the shader we can see that the galaxy is starting to be correctly map it it is facing our Cameron and it seems like we when I get closer and closer and even try to get in it seems like a portal actually it could actually work well as a part two okay now let's add also some stars let's start by adding a star's color property also with white as default and then a star's cubemap texture which once again you can go to google and search for a star's texture with a good resolution and this will allow us to add more depth to the shader you could even add the third cube map to get even more depth and dynamic going on inside our shader but this is enough ok so let's add the star skew map like these and let's actually offset these stars to create the sensation of death we can add a vector to recall it Stars offset and this is going to be connected to like these then we can multiply the galaxy cubemap with the galaxy color and the stars cubemap with the starts color too and finally we only need to add them together and connect these to the color input of the unlit master don't forget to save the shader then back in unity we only need to assign a stars texture to the material and that's it oh I just don't forget to add a small value like 0.5 to the stars of set either in X either in Y tryouts try out some values and we can also change the call of the stars if you want or even the color of the galaxy it's really up to you and now we can even improve this by doing something simple which is adding a Fresnel effect and we can add a vector one to control the Fresnel power as well connect it like this great and and we are also going to need a color to control the Fresnel color right also in HDR mode and with white as default then we can multiply them together like this and finally we just need to add these to the rest of the notes and that's it we can see that we already have a Fresno by community we can now control the color of the Fresno and even the intensity as well I'm just gonna change the Stars texture with one that is black okay that looks nice quite cool we can also control the Fresnel power of course you can play with those values right and it looks awesome it's actually a very simple effect that is so cool and that can be used in so many things and we can even improve this for example by by adding a scrolling noise to the Fresno which is very simple we only need a time and then a vector2 for the Fresno speed multiply them together and then create a simple noise or a Voronoi noise or even a texture if you want and we are going to add the Fresno speed and the time to a UV node like these that we can connect to the simple noise and the simple noise can be multiply it with the Fresno like this and then you can connect these to the ads up here hundreds of it's messy but we are going to rearrange this and if you look closely you can see that the texture is crawling in the Fresno which is nice it's exactly what we wanted but we can improve this by simply adding a power note and then create a vector one to control this power and also create another vector one by the way to control the scale of the simple noise just like this and if we save this now in the inspector we can control the intensity first then play a little bit with Fresno speed and and that's it it looks awesome I'm even going to change this for a golden collar it's a pretty cool scheme you can do a lot of cool things with this shader now for the particles they are quite simple I'm using this shader by the way you can cop it it's a simple particle ad and for the sake of this tutorial we can add the default particle that comes with unity the texture and then we can create a new particle system for particles rotated minus 90 degrees in the X push it a little bit up in the Y and we can decrease the start size because they are going to be particles something between 0.01 and 0.5 which is too much and also gonna make the start speed random between 0.1 and 0.5 so they move slowly and start type times gonna be random between 2 & 8 the rate of a time can be around three the shape can be a cone year but with a small radius of around 0.5 and an angle of around 20 when the radius thickness should be more or less like 0.5 then we want to use something cool like velocity of a lifetime where we increase the Z value of the orbital X but we actually want to use between two curves and we want to end up with something like this range which is going to make some particles orbit faster than others all right so let's just fade in and fade out the particles with color of lifetime nothing special and let's also use the size of a lifetime with this curve so they shrink towards the end I'm just going to decrease the back start size actually to around 0.25 lastly let's add some nice and I'm going to use these values right here for the colors I'm also going to use these two colors to match the shader for the ribbons or the plexus effect it's really simple actually we can't duplicate these particles and name them ribbons and a few things change for example one is the lifetime which is going to be somewhere between four and six and then we could go down here to the redder and set the render mode to none because we are only going to use the trails so let's actually drag and drop the beam to the trail material and then all we gotta do is turn on trails and this is what we get out of the box but for the plexus effect we need to change the trail mode from particles to ribbons and here we go we have this cool effect going on now let's just change the wide / trail to this curve right here okay so that's it for the plexus effect and it adds a really nice touch actually and if you want you can even add some trails you can duplicate these ribbons again and rename it to trails but this time we are going to change the mode of the trails from ribbons to particles let's just update start speed to something more consistent between 0.4 and 0.6 and then turn off noise I think it looks better without it and then we can change the orbital X to a constant value in Z like two and maybe also decrease the rate you get the idea you can use both the plexus and the trails or only one at the same time it's just to complement the wall idea of a galaxy shader in a character for example maybe you can even replace the beam that we are using in the particles with a star text it will look better something like this anyway I hope you have enjoyed this video this entire project is a very my patreon page you will also have access to many other shaders and particle effects that you can use for your projects and you help the channel going forward links in description and I want to thank every single patron that supports me it helps a lot to keep these videos coming and a big thank you goes to the super mega patron stop tired patrons which are Alejandra Chris go forth Evo Gamescom Goblin black James Finley Graeme niala Ken Lee Oscar Simsek solo philosophy my Ally Steven Melton TK Vera mountain and Artem Jim thank you all for your sport it really means a lot so that's it guys thanks for watching and I hope to see you in the next video [Music]
Info
Channel: Gabriel Aguiar Prod.
Views: 57,471
Rating: undefined out of 5
Keywords: Unity tutorial, unity effects, unity special effects, game effects, unity particle tutorial, unity game effect, unity vfx, unity shader graph tutorial, unity shader graph, shader graph, shader graph tutorial, unity shader tutorial, unity shaders, galaxy, galaxy shader, unity galaxy, unity galaxy shader, shader graph galaxy, shader graph nodes, Galaxy Shader Tutorial, unity space shader, shader graph space, shader graph cosmos, unity, tutorial, shader, graph, unity particles
Id: jLUGRGdji2o
Channel Id: undefined
Length: 16min 0sec (960 seconds)
Published: Tue Mar 10 2020
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.