Creating an Outline Material in Unreal Engine 5

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
in this tutorial we're going to be covering how to make this highlight material take no credit for this one this is totally from online there's a number of videos online to do it but I want to use it in one of my videos I thought I'd make a video here on how to do it let's get started I'm gonna create a new material we're going to call it outline for the material we're going to set it to a post process material and opaque default lit is fine start with a highlight color parameter hold three and click go at the parameter like this the highlight color I'm going to make a float four out of this dragon from the red four and it's going to connect those up and I'm going to add a glow intensity parameter so it's just the scalar holding us I'll call it just glow intensity foreign multiply our color by that just set this to by default we're going to need a post process input so this is a seam texture and this will if you have any other post process inputs and this will differ but if you're just starting out like where I am now it's going to be zero and we're actually going to alert that without color and that will be our emissive so now that we've got the color going in we need to sort out this Alpha yeah and this is quite a bit to do this so we're just going to start with the same texture here this is sort of the midpoint of what we need to do but this will be an easier way to do it so they're actually looking for seam texture and we need to set this to custom depth so this first one I'm just going to stick up here because it's different and then we gonna have another four and now we need to subtract each of these from that top one so let's start up here first one from the second one and then we're going to need another three subtractions here so let's just put them in and they're all going to be subtracted from that top of them so this one is going to be this second one here at the bottom third one and the fourth one like so now I need to add these back together so gonna be an ad it's going to be an ad for the bottom two and then two back together add those two at the top two and then add these now I need another parameter here for our fall off call this edge angle all off and we're going to divide that by you know what we've got coming out of here and I'll set this to a negative 100. and we're going to subtract one and clamp it and that goes into our Alpha you're not going to say much yet because we're not we haven't done the UVS yet so for the UVS we're going to start with the view size we're going to need a parameter for the line width so let's go line width I'm going to set that to one and we're going to be multiplying that I'm going to sealing the the V size clamp it to two one to two oops not 10. 2 I'm gonna duplicate that and we're going to get our scene textual size pixel multiply that in and now we've got to split the red and the green channels so we're going to do a component mask make this one red this one green and now we just want to put the other value in that mask to zero so we're going to do append uh pin vector and we need just want this to be zero so I'm just going to put a value in here the same down here this will go into the the B and the a will be zero and now we're going to need to get our screen position get the red and green channel of that so component mask again and now we want to add these to our outputs here so we're going to need several ads here so we're going to need four and this is these will be the inputs to our UVS here so I want to actually bring this down so this will be top one second one third one fourth one and then the top one will be just be straight red channel the second one will be straight green Channel oh sorry B yep sorry the a has to be all these positions so now for these bottom two ads we need to invert our outputs here so we're going to multiply negative one good so we want to change our highlight color to the white otherwise pretty hard to see or whatever color let's save and apply so now let's create an instance of that save it and to apply this we need to have a post-processing volume in the world so if you've already got one you can use that otherwise add a new one now in here we need to at our material so if you search for material get the post-processing materials and we can add our material here we also need to set the bounds to infinite otherwise or otherwise resize the box to wherever you want it to affect once we have that the we can run that second pass on everything that we want to highlight now so we'll outline I should say so let's just demonstrate that on this box here if we search for the app which is on the rendering and we can just enable this to highlight anything freaking out all right that flickering if we can fix that I think that's it comes into your outline just just click on the actual result node and you can change the order of the pass it's called blend location blendable location so if we change this after translucency should get a better result there we go nice nice Edge now we can play with our values so now we can turn off and on highlighting to anything we want and I'll show you how to do that in C plus plus in my selection tutorial thanks for watching see you later [Music]
Info
Channel: Rogue Entity
Views: 14,510
Rating: undefined out of 5
Keywords: UE4, UE5, UE5.1, Tutorial, Programming, C++, Game, Gaming, Game Design, Game Programming, Game Audio, Game Art, Game Testing Game Engine, Game Production, Game Industry, Unreal Engine, Game Development, Material, RTS, Highlight, Outline, Border, Selected
Id: INiUXnNlB1I
Channel Id: undefined
Length: 9min 38sec (578 seconds)
Published: Thu Feb 23 2023
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.