Holograms in Unity Shader Graph

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
if you want to give your game a sci-fi feel a great way to do that is to add Holograms these light based imitations give any scene a futuristic feel and today we're going to use shader graph to turn any mesh into a hologram as always there's a github put it in the description Holograms have two main parts first a bright edge for this we can take advantage of Fornell lighting which illuminates parts of an objet viewed at a very shallow angle this means curved edges will show up very brightly second will draw some holographic scan lines moving down the object to make it look like it's being constantly drawn and redrawn I've opened a brand new project with the you RPG set so that the scene is appropriately set up I'll start off by creating a new graph by right-clicking and going to create shader PBR graph let's set the Finnell first unity has a built-in Finnell effect node add one to your graph and set the power to around 4 or 5 the edges are a bit thinner then add a new color property equal floral color set us mode to HDR so that we can artificially boost the luminance of the 4 now I set the default color to white with intensity 2 but we can tweak it later to whatever we want multiply the Finnell effects together with a final color that's all that needs to be done for the final calculation now we'll add another color property called main color make it HDR and also make it white by default but give it a lower intensity than the final color plug this into the albedo channel on the PBR master node while we're here also set the Alpha clip threshold to zero and use the COG drop-down menu to change the surface to transparent now we'll handle the scan lines we could generate these programmatically but instead I'll be using a texture I made beforehand which encodes the strength and position of the scan lines the darker the line is the less visible it will be you can choose to use a higher resolution texture if you want first add a texture 2d property called hologram scan lines and assign the texture we just mentioned as the default we'll start by using a sample texture 2d node to sample the texture but we won't be using the objects UVs to sample we want the scan lines to move downwards across the object along the global Y axis over time so we'll actually start with a position node with the space set to world to get the Y component use a split node and take the G output RGB a cross stakes where there W and then connect that to an add node because we're going to add the tine component to it we'll add another property this time a vector one called scroll speed with a default of noir point naught 5 we want to multiply this together with the regular time output of a time node which just counts upwards at a rate of one second per second then plug that into the other input to the add mode we created earlier next we need to create a vector2 and connects the result of the add to the ym / the X component value doesn't matter since the texture of wraps around in the X direction anyway we're almost there the only thing remaining is to make sure the scanline texture tiles appropriately we'll do this with a final Vettes - property called hologram tiling the default value will depend on the resolution of the scanline texture but I've set mine to 64 by 64 since the texture is 32 by 32 the vector 2 recreated earlier needs to be output into a tiling and offset node in its UV slot then we can drag hologram tiling into the tiling pin once that's done connect the output of that tiling and offset node into the UV channel of the sample texture node all that needs to be done now is to connect together the two halves of the shader add together the result of the multiply node from the Fernau and the sample texture node from the scan lines then use that as the input to both the emission and alpha nodes of ppl master with that the shader is complete if we create a few materials and attach them to some objects in the scene you'll see the hologram effects in action as you can see the effect looks best on objects with curved surfaces because of the way the fernell works it doesn't work quite as well on flat surfaces as always thanks to all my patrons who make this video as possible if you'd like to support me consider subscribing or maybe even throw me a few quid on Kofi of patron isn't your thing also let me know in the comments if there's an effect you'd like me to tackle I'm always open to ideas thanks for watching see you next time
Info
Channel: Daniel Ilett
Views: 32,503
Rating: undefined out of 5
Keywords: unity, urp, universal render pipeline, shaders, shader graph, hologram, holographic, universal rp, tutorial, fresnel, 3d hologram, holograms, unity3d, unity 3d, game development unity, unity shader graph, unity shader graph tutorial, shader graph tutorial, hologram shader, unity hologram, hologram effect, daniel ilett, daniel ilett shader, daniel ilett effect
Id: wtZ5WcrV-9A
Channel Id: undefined
Length: 4min 16sec (256 seconds)
Published: Mon Jul 13 2020
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.