UE4 - Tutorial - Pulsing Emissive Material

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
I know guys and girls welcome to another tutorial yes I'm doing two in one day just because I haven't done anything for a while and I've got a few requests to catch up on here's the second one haha right so in this tutorial we're going to be covering pulsing I pull seeing kind of glow material I'm making congestion with my hand here which is like clenching her fists and then opening again totally you know I'm aware that my camera's turned off because I don't want you guys to see that I'm sat here in a really fuzzy onesie because it's cold but I'm making hand gestures I always forget that you guys can't see any of that stuff maybe one day I'll start using it no there's no need to not with a tutorial who needs to see my face during a tutorial nobody all right so let's make a material we're gonna call this pulse I'm just going in we're gonna open this guy up and now the way we're gonna make this pulse is using something called a sine wave so if you don't know what a sine is sine wave is a mathematical equation it starts at 1 or negative 1 and then it will push the value towards the opposite so 1 towards negative 1 negative 1 towards 1 and it will do so in a wave pattern so a nice steady wave from 1 to 0 1 cutting through 0 obviously and then going into the negatives and once it hits negative 1 goes back up to 1 once it hits 1 it goes back down to the negative 1 you can change the frequency of a sine wave so that you can occur the sine wave more often or you can make it occur less often but the wave is still gonna be the same consists in wave right so what we need obviously is a sine wave through search for sine now this needs a value for timing right now on its own it's not going to do anything if we preview it we're just going to get an error it's because it doesn't have any sort of time input or value input so what we're going to do is search for time and if we put time into the sine wave now you'll be able to see when it catches up just this little really harsh kind of pulsing black to white black to white blacks away okay but we don't quite one that we want to be able to change this in real time should we need to that's what we're gonna do is hold s and left-click for a scalar parameter we're gonna call this one what are we calling this one we're calling this one frequency somehow managed to click off of it frequency we're gonna start this set value of one hold em and multiply well hold them and click from all the ledgers don't hold em and then multiply because that's like anyway plug those into each other and then into the sign if we preview the sign again you'll see that we get exactly the same thing as before but if I increase the frequency you can see that it's actually going to occur more often tada and then let's just get that down again don't want to cause any issues if you are gonna start you know making pulsing or flashing things please be careful about sharing them online because of epilepsy you don't want to cause anybody any harm so I'm not gonna push that any further than that speed because even that could hurt someone anyway Oh next thing we're gonna do is we're gonna hold em and left-click for another multiply put the sign into a B hold 3 and left-click for a for a 3 vector put that into the a and this 3 vector is going to be a color we're gonna right-click it and convert this parameter call it color I'll give it a nice default red value of 1 and a forward to preview this you'll be able to see that we get this pulsing in red instead of your white okay I'll stop previewing that now what we're gonna do is we're gonna multiply it again hold it s and left click for another scalar plug that in and we're going to call this in density we'll plug this into the emissive we'll put the intensity to a value of 1 and we will apply now what we've done is we've created a pulsing red material here you can see it's pointing to it why am i pointing to you can see that it's it's going to this nice deep red and it fades back out to black a nice deep red face back out to black now if we were to put this on a cube you'll be able to see that working and if we right click this and we create a material instance and put this onto the second cube we'll be able to see why we've made it as customers we did I say as custom it's not very custom but you know you get the drift so bear with me fill my throat going rub it there Oh No if we would turn on the caller parameters and the frequency and intensity parameters here we can choose color and we could give it a different color so blue you can see we've got a blue glow on the second Q frequency let's decrease it 0.5 I want it to be half as quick or twice as slow and if the intensity may be I'm going to bump this up to five you can see we get this nice blue maybe there we go nice hmm yeah we'll put the oh there we are yeah so you can see we give this nice glowy effect to this and it's still pulsing which is exactly what we want now you can change these to be as quick or slow as intense or as less intense as you want any color that you can think of you can do the same thing with a mask so instead of just using a straight color you could multiply a mask into the color as well so that you could make specific parts of this glow I'm not going to show you how to do that has been covered in other tutorials that I've done but what we are going to do is we're going to see a different way to use this pulse now to make a flashing material so we're going to right click the pulse material duplicate it and then just quickly rename it to a flash - go ahead it's name is Barry Allen and it's not the fastest man alive despite how many times he decides to tell us that at the start of episodes every episode there's somebody faster oh my god Barry is not fast enough but he isn't either fastest man alive nope right hold alt and left click on the be multiplied for the color to break the link with the sign little bit of a rant near about no programs what we're gonna do now is we're going to check the value of sign so we're going to right click and search for it if and then what we're going to do is hold one and left click for a constant we're just gonna leave this is zero and plug it into a and then we're gonna pick up a sign into B so now the a is greater than B or a is less than B is gonna check against sign and what we're gonna do is we're gonna say well well we'll seal what we'll floor first floor sign and that's going into a is greater than B there are so anyway you what a floor does is it takes any value up to 0.5 and rents it down to the nearest integer and it's similarly seal does the opposite it takes anything from 0.5 and rounds it up to the nearest integer so what we're doing here is we're basically checking if sign is between 0 and 0.5 then we're going to knock the value down to zero and if the sign is below is between 0.5 and 1 then we're going to round it up to 1 so now you can see we don't have any sort of pulse we're just getting a flashing okay on or off on or off we can apply that in fact I'm going to default the color of this one to green just so that we can see them all working next to each other ok we'll place the flash material on to a cube all right click the flash material create material instance open them up place the instance onto a new cube and then what we're gonna do is we will maybe change this one to you an orange color give it an intensity of 20 let's really make that bad boy glow and a freakin sweet 4 - so he flashes twice as quick so that you can see how with just two materials we've created both a pulse and a flash both using sine and we can change these you can change these values inside of blueprints by creating instances and then changing the scaler parameters on the fly so deciding perhaps when you walk up the stairs you want this yellow one to actually flash purple you could do so all right hopefully that explains both sign and how we can create pulse and flashing really easily I will see you guys next time thanks watching
Info
Channel: Dean Ashford
Views: 77,794
Rating: undefined out of 5
Keywords: UE4, Unreal Engine, Tutorial, Flash, Pulse, Pulsing, Flashing, Material, Glow, Emissive, Game, Dev, Indie
Id: kxHLw8r-4gE
Channel Id: undefined
Length: 9min 24sec (564 seconds)
Published: Thu Nov 09 2017
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.