Parallax & Bump Decals | 5-Minute Materials [UE5]

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
hello and welcome back to 5 minute materials today we're going to be talking about Parallax decals pom decals decals PM we're also going to be covering bump offset in decals because it's notoriously difficult so as you can see here our end result is a decal that has some beautiful Parallax effects uh you can imagine this is probably useful for like you know bullet impacts some like crazy effects where like the Earth is like caving in and it's like a portal to another dimension or some essentially just whatever you can do with a parallax occlusion mapped texture uh but in the form of a decal this is sort of a continuation from several other videos particularly the decals video and also the Parallax occlusion mapping video and also the bump offset video so if you're not super familiar with any of them then this video isn't really going to mean much to you so let's go over why this is sort of difficult you can see that I have a custom function called pris Parallax occlusion decal if we were to just use the regular occlusion mapping and we just you know copied all of the inputs into this one and then we got our Shadow and our parallx UVS and we hit save then you will notice that uh something weird is happening with our decals uh it's an absolute Nightmare on the top uh our decal isn't too bad it looks pretty much just standard as we would expect uh however when we start to rotate it in particular directions you can see that it's just not it's just not happy uh now the reason for this is that the standard Parallax occlusion material function operates in Tangent space uh however with a decal it's outputting its normal in World space to be read by you know the uh the material underneath it basically when it's rotated like this it just gets all messed up and the same goes for like being down here even if we rotated this in any direction I think it would just be completely messed up if you've tried doing Parallax decals this is probably where you've ended up uh if you've decided to watch this video and I'm going to teach you how to rectify it so the first thing that we want to do is find The Parallax occlusion mapping function we're going to hit browse where we're going to find it in the engine material functions we're also going to go to our second content browser if you don't have one you can go to window you can go to content browser and open up a second or third content browser and then just grab it by the tab and just Yeet it into here uh and then you can just have two of them open so what we're going to do is go to whatever folder you want to Chuck this in uh I'm going to go to my dump folder decal parallx video we're going to drag this into here we're going to copy it very important you copy it into here and then just rename this you know pom that doesn't suck and then we open it up and you can see we've got the standard old bloody you know absolute spaghetti monster that is the par cusion mapping function however we can make changes to this one that aren't going to like destroy everything so so what we need to do in our new parallx occlusion mapping that doesn't suck function is we need to essentially change what the camera Vector is uh and if you do want to use the you know the shadow uh rendering in the P then you'll also need to change what the light Vector is where are you hello here it is light Vector bam so the easiest way to do this is to get our camera Vector let's just copy paste it here then we're going to use a function called inverse transform Matrix the vector to transform is going to be the camera vector and then I'm just going to copy paste this from the other one but you can just you know look at it uh we're going to get our X Vector we're going to transform it from local to World space we're going to get our positive y Vector transform it from local to World space we're going to get our positive Z vector and transform it from local to World space uh now this bit's a bit confusing we're going to put our X Vector into the Z we're going to put our y Vector into the Y and we're going to put our Z Vector into the X then the transformed camera Vector we are going to save this as a named reroute node we're going to call this custom camera Vector then what we're going to do is we're just going to recall custom camera vector and any place that we find camera Vector we're just going to ye this into it so we're just going to copy paste that Chu that in there put this there we're going to copy paste it we're going to just uh I swear there's one over here somewhere camera Vector um also feel free to you know if there's like a bunch of outputs that you're not really using using you can just like get rid of them but let's just be pretty thorough pretty sure that's all of them oh nope hold on there we go all right and then if we did want to use the Shadows we would just do the same thing but we would be transforming I'm just going to copy paste this so it's easier we're just going to transform the incoming light vector and then just put that into I think it only appears in one place so just going to Chuck that in there um even if you copy paste this it's just going to optimize it all into one call so don't don't worry about having repeated nodes and stuff the compiler is quite smart so we just hit save we can go into our material we going to go to this and we should be able to just look up P that doesn't suck and the nodes should all line up because they yep by name then we're just going to hit save and bam it I didn't actually expect that to work first go but you can see that we now have our Parallax occlusion mapped decals and as the material function name would suggest it doesn't suck so as you can see we can rotate this around and The Parallax looks fantastic and you can see that these ones down here look great and if we got the shadow output and multiplied our resulting color by that shadow output then you would see that we need to invert our light Vector you could do this inside the material function but it can kind of get a little bit confusing so let's just ye that into there all right so now you can see aside from I've got different colors in here now um you can see that we have the the fake Shadows that we covered in the parall seclusion video uh this also is accurate when you know they are on the sides of things as for the actual sort of masking that I'm doing in this material I'll just run you through it real quick we're essentially just getting the resulting texture and we're doing a height lurp so if you don't know what a height lurp is check out my height lurp video we're chucking a bit of contrast on it and then we're putting that into the opacity of of the decal output uh and that's how it kind of you know looks like it starts over here a little bit and then it gets stronger and stronger into the middle another little trick I'm doing is getting a radial gradient so that's like a gradient from the center of the the decal to the outside um and I'm actually using that to change the reference plane of the decal what the reference plane is is just where the sort of midpoint of The Parallax effect should be so if it's zero then it will be only going up if it's one then it will only be going down and if it's 0.5 uh it's kind of a mixture of up and down so 0.5 is the default but what I'm doing is taking that 0.5 and then adding part of this radial gradient to it and so essentially what that's doing is it's just like bulging it downwards but only in the center not you know around the outside uh so that can just kind of make it look like it's really like a bowl so we've covered parallx seclusion mapped decals but what if we wanted to use BUMP offset for the decals what if we wanted just like a cheap but less sort of fidelitous result what we could do is we could use the bump offset Advanced node so regular bump offset is this bump offset Advanced is just it it's literally the same thing but it's just like manually done so if you wanted to know how bump offset Works under the hood this is it what we need to do is instead of just camera Vector being the default we just need to do that trick from before where we get our our vectors we we transform the camera vector by it and that goes into the camera Vector everything else can just be the default you know it's basically the same as the uh the bump offset stuff and we just get the UVS we can smack that into our texture sample and now you can see that we have our bump offset effect which again doesn't look as good as parallx occlusion it's best use subtly but it is better than nothing and again we would have run into issues with you know rotation and having things on the side of you know walls and and that kind of stuff uh we would have run into the same issues with bump offset as we did with parallx seclusion mapping from earlier so there you go that's how we can fix Parallax occlusion mapping and bump offset within decals keep in mind you can also combine this with the the debuffer decal for some very interesting effects I guess you can experiment and find out what works best for you uh for your given situation so I hope that you learned something I hope that this fixed a few little issues for you if you did enjoy it make sure that you are liked and subscribed how do I outro again if you do want to support the channel monetarily you can do so for as little as $1 per month in the patreon which is linked below or you can buy my Prisma Escape inter action GPU fluid Sim plug-in for $34.99 from the Epic Marketplace I'll check a link in the description and with that we say goodbye goodbye [Music]
Info
Channel: PrismaticaDev
Views: 4,044
Rating: undefined out of 5
Keywords: unreal engine, ue5, ue4, 5 minute materials, ue5 pom, ue5 pom decals, ue5 parallax, ue5 bumpoffset, ue5 parallax occlusion, ue5 tesselation, ue5 shaders, ue5 materials, ue5 pom material, ue5 pom shader, ue5 decals, decals, decal material, ue5 decal material, ue5 custom decal, ue5 decal actor, ue5 decal channels, ue5 decal tutorial, ue5 material tutorial, ue5 blood splatter, unreal engine decals, unreal engine parallax decals, ue5 bullet holes, ue5 damage decals
Id: NOifAPle9zo
Channel Id: undefined
Length: 12min 54sec (774 seconds)
Published: Thu Jun 27 2024
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.