Adding Outline Material Colors with Unreal Engine 5

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
all everyone if you continued on from the uh outline material I'm just going to cover a few points that people have bought up in the comments and they have been looking to do one was add colors different colors to uh different selections or outline sorry and the other one was adding the outline to transparent objects I'm just going to cover them both quickly if you continued on from the previous tutorial you have something that looks like this this is the the full material here and and you can follow that in the outline tutorial fully I'll include a link in the description now to add the colors we just want to add in all the colors that we want to use so I'm just going to save on time I'm just going to copy in some colors here so I'm making them float three and I'm just putting them to a named variable if you don't know how to do a named variable just drag off and type name and it's this add reroute declaration node so that's basically just saying that I can use this somewhere else so I can what I call that name so I can go name and you see these named reroutes and I've got the color 0 1 2 and three and there's name so I can put this somewhere else in my project without having lines going all over the place not really required for this there's not going to be that many lines but good practice keeps it neat so we've got our colors there and we're going to want to for our po postprocess here we want to bring that down to a float 3 as well so we're just going to mask that get component mask and set that to all three not the alpha just move this up bit and this is going to go into where it's going there into the top of the L sorry about the error for now uh we can get rid of this CU this is not our color anymore and the the other node that we want to add is called a custom stencil you go to your scene texture you can see it's coming up by default as a seeing texture if you come over to the drop down you should be able to find the custom stencil change it to that what we want to do is mask this out again so component mask we just want the r channel channel and then we're going to divide this by 255 so that's the the number of channels that you can have so the number of colors and then we're going to put this into a bit Mark so just search for bit Mark and we need a constant here so this will be the channel that you use to set the color and this will go into the bit mark value sorry the bit value and then the bit mask will be what comes out of here just straighten all that up and then for however many channels you're going to have so we're going to have we're we got three colors here well white is going to be our default but the um we're essentially going to have three colors so we're going to need two of these and then we just need to lert the colors into these channels now so I'm going to get those named reroute noes so color zero and color one they're going to be the first bit Channel just duplicate this and the output of that one will be the input of the next one and then we'll put our color two that that will be the alpha and then we just need to lurp it with our result so if you're going to have more colors you just need to continue to L to lur the color into the correct uh channel that you're masking all right that's that so now if we come into I'm just going to enable on all three of these the the render custom depth whether you're doing that with C++ this is just for an example I'm just going to enable it on these and that gives me my white outline which is the default and then if I come to here and I search for stencil oops I'm selected on the landscape so so you can see the custom stencil very here so I'm going to put one on this top one two on the next one on this one so you can see it's not working occasionally get an outline so it's sort of got some reddish in it let's just stuff it up so what we need to do is come to our project settings search for stencil and it's got custom death stencil pass enabled it needs to be enabled with stencil and there we go so the first one is red left one was blue and this one's defaulting I think I had it to three which is we didn't set so it's just going back to White so now to get the outlines working with a transparent or any object with transparency there's a couple things you'll to change so what I'm going to do is I'm just going to get this material that's on this and convert it to to a transparent one so I'm just applying a transparent material to my object so I'm just going to hook up the alpha channel to the opacity here this is just so I can make it partially transparent you'll see this has probably broken the outlines here so if I come back into the material that I'm using we need to change so this opacity Mass clip value here is is set to 33% that's the default limit of opacity that you can use but if you change there's a VAR called allow custom death rights we enable that come back you can then adjust this value to whatever you need can set that so I can have it fully transparent and it will still work so now if I come over to the instance that's actually on the objects change the transparency you can see I get the outlines working now and it will work all the way to zero like so hope that helped some people out please don't forget to like if you found this tutorial helpful and subscribe so you don't miss out on future tutorials you can join me on Discord or sign up to my patreon where you can get access to all my tutorials early and the project files as well as gain access to behind the scenes on my current game development if you have any questions leave them in the comments thank you for watching see you next time
Info
Channel: Rogue Entity
Views: 960
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, Outline, Highlight, Border, Select, Material, Color, Colors, Opacity, RTS
Id: plMGQI5N1Co
Channel Id: undefined
Length: 7min 40sec (460 seconds)
Published: Wed Dec 06 2023
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.