HOW TO DO POST PROCESSING IN UNITY 🎮 | URP Unity Post Effects Tutorial | Learn Unity

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
today i'm going to show you how to set up post processing inside your game inside unity and i should mention from the beginning here that this is going to work whether or not this is a 2d or 3d game so just so you know this is going to be the exact same process whether or not it's 2d or 3d so you can follow this and set up post processing either way now the first thing i want to point out here which is very important to point out is that there's essentially two ways you can set up post processing inside your unity game and that has a lot to do with what kind of project you set up the first time when you actually created this project all the way back when you got started so just to show you if i were to go inside my unity hub here when you create a new project there's essentially two different types of projects you can create and create one of the base projects which is the 2d chord the 3d core but then you also have something down here called 2d urp or 3d urp and essentially the difference here is that the 2d and the 3d version is just a base template that has nothing really prepared for you whereas the 2d urp and the 3d urp are where units you already set up these post processing and lighting setups for you so you don't have to do all this stuff so it's just kind of like a better start to get started on your game so you know things are set up for you so you don't have to install packages and set up you know render pipelines and stuff like that and the reason i'm mentioning this is because the urp version of setting up post processing is a lot more simple and a lot more easy than setting it up using a regular 2d or regular 3d project so in this video here i'm going to show you how to do it using the universal render pipeline which is the the bottom versions down here if you're sitting there right now thinking well i do already have a project in front of me that i've been creating for a couple of months now and i did not use one of the universal render pipeline versions here when i started don't worry i do have a video that shows you how to convert a regular project to a universal render pipeline type project so we'll link that in the description if you need to check it out so you can just kind of watch that convert it and then return to this video here so inside unity you can see that i have something inside my scene already this is just so i have something to demonstrate on it doesn't really matter what you have inside your scene this is going to work either way so with that said uh if i were to actually go and show you what i have here just to show you what it looks like without post processing this is what it looks like i have a basic character that runs around he can jump and he can just kind of like get from a to b and he can die and he can do all sorts of things here uh but it doesn't really look impressive like it looks okay but it doesn't look impressive and that's really what post-processing is all about so what we can do here is the first thing i need to mention is that because this is a universal render pipeline project post processing is actually pre-configured into your project so you don't need to install anything to get this started so if i were to go inside package manager here and i would go down to post processing you can actually see oh it's actually saying i can install it well that's because we don't need to because we're using a pre-configured post-processing feature that is built into this version of unity so what i can do is i can just simply say well okay we have a little bit of things we need to do first we need to go inside our main camera so if we were to go ahead and open up my setup you can actually see i categorized everything inside my key just to make sure things are structured if i were to go inside my main camera you can see that if i were to scroll down we have something called rendering if you were to open that up you need to make sure that you have post processing actually activated otherwise post processing is not going to work on that camera that you're actually using so if you were to add any sort of cameras later on inside your scenes that need to do some sort of transitions or something make sure that if you want post processing to work on that camera that you need to make sure that you have post processing ticked on we do have another setting down here that is actually going to be working with our post processing inside the environment because you can see there's something here called volumes i'll go ahead and explain that a little bit later because it's not too relevant right now but later on when you actually want to have some more unique ways of adding post-processing for example if your player runs into a certain environment and then all of a sudden the environment need to change in mood or something then you can use this down here so with that what you can do is you can actually go inside your hierarchy you can right click and then you can say i want to add a volume which is the post-processing that we can add inside our inside our scene here and inside volume you can choose a couple of different types the one that we want to look for here is the one called global volume because that is the one that changes everything inside your scene so i want to pick this one and i can name it something like global post processing something like this just so we know what this is now this volume that we just created is essentially just a empty game object that has the volume component attached to it so you could also if you wanted to just go in and say create empty call it something and then add a component to it called a volume and then we have the exact same thing as what we just created here we just did it manually instead so i'm just going to delete what i just created and i'm going to drag my global post processing inside my setup up here just because it creates a nicer looking high key inside my scene here and what i'm going to do is i'm going to explain what exactly this volume can do now the first option inside the volume component is going to be whether or not you want this to be a global effect or a local effect now because we want everything inside the scene to change we're just going to keep this at global and i will get to show the local one a little bit later near the end of this video here so don't worry too much about it for now uh the second one down here is how much do you want this post-processing effect to affect your scene so you can actually dial it down to like 50 or maybe not have any effect at all so depending on how much you want to see this post processing inside your scene this is something you can tweak up and down the next option down here is going to be the priority and essentially this is just going to tell the game okay so which post-processing volume do you want to prioritize over other volumes in the game so let's for example say i have this global post processing that affects the entire game but when my player walks into a certain area inside the game i might have a little square that when my player walks into that square then i want another post processing to happen and and kind of like take over uh then we can do that by adding a priority to a particular post-processing volume the next one down here is going to be the profiles that you create so essentially you can create a profile that is going to have different post-processing happening depending on the profile so let's say i have a area inside my game where i want everything to turn black and white and then maybe have another area inside my game where i want everything to become like incredibly vibrant and saturated then i can create a separate profile for each one of these settings for the post processing and because i created those profiles i don't need to recreate them again in the future if i need to use the same profile so i can just kind of go in and say you know what i'm just going to pick one of the older profiles that i created already so you don't need to recreate post processing every single time you create something new inside your game now right now we don't actually have any profiles because we didn't create any for this project yet so what we can actually do is we can click new and then it's just automatically going to create a profile that is based on what we call the the game object up here so right now i call the global post processing so it's just gonna name it global post processing we can always if you want to you can change the name of it by just seeing where it's saved so you can see okay it's saved inside assets scenes sampled okay so we can find it here scenes sample scenes and it's right here so you can always just go in here and rename it if you want to do that so if you want this one to be called red room dangerous profile or something then you can just rename it to that if you want to i'm just going to keep it like it is for now and inside my inspector you can now see that we have a new option down here after we created the profile which is that we can add a override and this is actually what is going to be adding the post-processing effect inside our scene so with the profile creator we can actually start adding all these different post-processing effects to our game so we just go down and click on add override and then you can see you get this post-processing option you click it and then you have all these different post-processing effects that you can add inside your game now i'm just going to go ahead and add a couple of them and explain a little bit about some of the more typical ones you might want to add inside your game just you have an idea about what some of these do but i really just recommend that you go through these one by one and just mess around with them to see what they do inside your game what kind of effect they have just make sure you're inside the game mode so you can actually see what they're doing to your game once you're actually changing them so the first thing i want to show you here is that you can actually go ahead and add something called tone mapping now as you may notice whenever we add a override nothing is actually going to be activated inside the actual override so you want to make sure you actually take it on if you want to have the effect on of course and with this particular one tone mapping you can actually choose the one called asus this is a very popular option for just giving you a quick start to make things look a lot more cinematic you know to make it pop a little bit more inside your game so where to choose it you can actually see it oh okay things are changing inside my scene here we can add another override let's say we want to add something like let's go and pick chromatic aberration this is one that some people hate some people love it essentially if you were to go in and actually toggle it on you can see that the edges of my screen starts to split when it comes to the colors this is a very very popular post-processing effect to have whenever you want to create like a concussion effect on your character let's say he hits his head or something then all of a sudden things are gonna look you know because like he has a concussion so this one can be added to like kind of give those weird edges there where things start splitting apart we can also go and add some color adjustments if we want to change the coloring inside the scene so for example the exposure or maybe the contrast i can actually tone up a little bit just to give a little bit more of a vibrant you know contrasty feeling to it like every time i do anything inside photoshop i always use contrast to to make things look a lot better uh so you can just kind of like turn it up you can see we can make it very you know just kind of very bland all the colors just kind of like fade together and all the lights and stuff or we can turn it up a little bit just to give it a little bit more of a crisp neat look so i'm going to give it like 25 we can also go ahead and add exposure if we want to do that to make things a lot more um you know bright so it's not so dark in here because typically when you add contrast things are going to get a little bit darker as well so i just go ahead and set this one to 0.4 this is also where you can add saturation or desaturate if you want something that you know turns into black and white or gets really saturated you can do that in here or of course if you want to change the colors then you can do that we can also add depth of field this is also a very popular one so i can just go ahead and toggle this on and say i want to add it now of course i'm inside a 2d game right now so it's not really going to have a big effect but if you're inside a 3d game then that's the way you can do that but you also have a motion blur if you want to do that so right here we have motion blur but i do actually want to show something that i think is a very neat trick to just kind of know about which is if you want to add a filter on top of your game i can choose the one called bloom and you can actually see that if it were to toggle threshold and intensity then we can actually toggle some of the colors here you can see it's actually like getting a little bit more intense and then we just kind of like you know really make things pop out and typically it does require they have a little bit of a color adjustment set on to your uh to your post processing for this to actually have an effect maybe tone this down to just so it's not too overwhelming so maybe like something like 0.5 but what i wanted to show you is if you go down to lens dirt you can actually say i want to toggle on something called lens dirt which is essentially something that's on top of the the camera and then i can choose a texture now i do have a texture inside my assets here i just created a folder called filters and then i just got an image off of google i can actually take any kind of texture and just add it inside the linster so you know like if you have a black and white photo with some details on it then you can just take it and drag it in and then you'll notice that oh all of a sudden we get this old tv screen looking thing i did also add up the intensity here so you can just kind of adjust how much does it actually have an effect so let's say somewhere around 10. now the bloom is a little bit too vibrant here so i can actually go and tone it down just a little bit so it's it's not too much um another thing i want to show you is that we can actually add some lens distortion so if i were to go in and say you know what i'm going for this old tv screen kind of look here so that's actually going to distort the tv so it actually looks like one of those all round you know tv monitor screens there so i can actually go in and say you know what let's actually go and do that so oh things are going to warp a little bit here there we go let's say something like 0.45 and then we can also go ahead and maybe add something around the edges so i can go in and say let's add some vignettes which is also a very popular thing to use essentially this is just going to make sure that you have some darkened around the edges you can see the edges start turning dark just to get a little bit more of a focus here so it looks a bit more like a dunting crawler there's a lot of things in here you can mess around with like i said you can just kind of like pick a setting and just kind of toggle them on and off tweak them a little bit to just see how they look like but all of a sudden we have something that looks like this completely changes the vibe of the game that i'm playing right now and just to kind of show you how this all looks like when we actually have the effects on and off because we went from having this to having this like all of a sudden the whole game just changes completely in its vibe so this is how you can do that i did have something else i wanted to show you here because i can keep talking about these volumes in here but i really think this is just something you need to experiment with but something i want to show you is if my character walks into a certain area inside the game and then i want things to start changing then how am i going to do that now this is going to work for 3d as well as 2d but essentially you're going to go inside your scene or inside the high key it's actually make sure we have the scene selected so we can actually see something i'm going to right click then i'm going to go down to volume and instead of choosing global volume i'm actually going to make a local volume and this is actually the exact same thing as when went into the global post processing we had this global and local setting here this is basically what we're doing we're creating a local volume instead of a global one so would it go in here say volume and i'm just going to make a box volume just to have something inside the scene so now you can see we have this square here just going to reset it just so we have it you know somewhere decently reset inside the scene i'm just going to move it somewhere over between these two pillars here i'm going to edit the collider and just kind of drag it out it's very important to point out here that you do need to have this set as a trigger with the collider so essentially now whenever the player walks into this box here it's going to change things well actually right now it's not going to work but i just want to show you why something to point out here is that our global post processing right now has a priority set to zero and our box volume right now has a priority set to zero meaning that they're going to sort of like overlap each other we don't want to do that we actually want this particular post processing to take priority with the changes that happens inside of here so i actually want to set this one to one so it has one higher than my global post processing option up there we do also need to add a volume so for example here i could choose the one that we have already but that's not going to change anything inside the scenes because it's basically the same two post processing settings so instead i'm going to create a new one and i'm just going to go ahead and add an override i'm just going to add a color adjustment and just desaturate everything so everything becomes just completely you know no colors or anything i can actually go and play the game and show you why it's not working because you would think that now when i walk into this box which is right here things should change like nothing is black and white which it should be and that's because right now you need to go into the main camera because everything is based on the camera here whenever your camera moves into a post-processing volume things change inside your scene and because we're not inside a 3d game right now in in my example here if you're making a 3d game this would actually be enough to get it working because whenever the you know you have a first person shooter or something where you have the camera being the player's head whenever you walk into a volume you're automatically going to bring the camera into that box which means the things are going to change but because this is a 2d game that i'm sitting in right now it means that the camera is actually sitting out here the camera itself is not entering this box that i created here as you can see we have the box right here if it were to take the camera and actually move it inside that box there it would change but it's a 2d game so it's not going to so what we can do to get around this is we can simply go into the main camera go down to where it says environment and say okay volumes that's interesting because that's what we just created here we created a box volume and then i want to say what do i want to actually have this trigger because as a default this is set to the camera like i said the camera needs to be inside the box here so what i can do is i can take my player and drag that player character inside my volume trigger which means that now it's not listening for the camera to enter this box here but it's actually listening for the player to walk into the box if you were to play this again this again then you can see that now when i walk into the box oh everything becomes black and white and you can actually see things are slowly changing you know it's going from you know saturated to slowly turning black and white and when i exit the box again everything is normal again um you can also change that by the way so if i go inside the box volume you can see for example here the blend distance how far do you want this to happen it would have set this at zero instead what it's going to do is it's just instantaneously going to change into black and white there's not going to be this fade you can see it just changes from one to the other so the higher this number here is the slower the transition is when you walk into this box here so with that said this is how you can create post-processing inside your game when you have a universal render pipeline project setup both in 2d as well as in 3d really the only thing here that changes from 3d to 2d is the last step that i showed you here with the character itself walking into the box instead of the camera so with that said i hope you enjoyed and i'll see you guys in the next video [Music] [Music] you
Info
Channel: Dani Krossing
Views: 30,608
Rating: undefined out of 5
Keywords: post-processing in unity, post processing in unity, post processing in unity urp, post processing in unity 2d, post processing in unity 3d, post processing in unity 2022, how to do post processing in unity, unity post processing, unity post processing 2022, unity post effects, unity post processing effects, unity post effects tutorial, post processing tutorial unity
Id: yugZTujILB0
Channel Id: undefined
Length: 18min 36sec (1116 seconds)
Published: Mon Sep 19 2022
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.