UE4 Reflection Captures - How-to Use

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
in today's video we're going to cover the basics of reflection captures in particular how to use them when to place them and what it is they can do for your scene so let's go ahead and jump in if you want to follow along with this video um go ahead and head on over to the unreal marketplace now you can do this through your launcher um and one of the things included with the permanently free collection is this city subway train modular so you can easily just search for it or if you go under free permanently free collection you should be able to find it so with this go ahead and just create a project and open it now the only thing that i have done differently in this video that might look a little bit off from what your scene looks like is i've gone ahead and just gone into the scene into the map of the subway and i've just removed all cameras and reflection captures just to start us from our base but outside of that everything is exactly the same all right so now before we dive in and actually start explaining and dissecting the different reflection capture types that we have i want to make sure you understand when and where and why you would want to use reflection captures in your scene all right so the first question is what are reflection captures well um unreal does have the ability to do screen space reflections now this is non-ray tracing explain here in a second caveat with this but with non-ray tracing scenes you're going to use screen space reflections however they can get expensive extremely quick and tank your performance almost to where your scene is unusable so what we do is we kind of augment our scenes with reflection captures to be able to provide more localized reflections in areas where we need that the easiest way to think about a reflection capture is kind of like a miniature hdri so a high dynamic range image captured from your scene that's reprojected into it more explicitly though your reflection captures are more designed for the reflections as opposed to hdrs hdri is where they kind of project light back into it so the reflection captures kind of like an hdri but more specific for our reflections all right now when do we want to use them as i said before whenever you're not using ray tracing with ray tracing uh because we're using accurate per pixel reflections you really don't need to have any of your reflection capture so the assumption here is if you're watching this video you're probably not running real-time ray tracing and you're going to be using anything else outside of that additionally the best thing to keep in mind too is when do you want to use reflection captures whenever you have shiny surfaces so with that being said hopefully that makes sense on the the theory behind when we want to use it and there's one more thing that i want to show that we're going to do inside of here um well actually i'm going to save it because we can see it in real time we don't have to restart the editor but that has to do with our base reflection capture resolution size that we'll want to set so typically do that on your project but i'll show you guys why you wouldn't want to do that all right with that being said let's go ahead and jump into kind of our first type of reflection capture that we'll do which is planar so inside of my place actors i'll go ahead and clear my filter here under search capture uh search classes all you gotta type is just reflect and that will just pop up the three different types now we do have three available types for us we've got planar which we'll cover first we've got box and we have sphere now something to note is that planar is kind of the oddball here that's why i'm going to show it first typically speaking you only want to use this whenever you have like a flat surface such as like a pool of water or a body of water in which you need just kind of that flat reflected plane typically speaking you're only going to use these in rare circumstances this is probably the least common one that you'll use so i'll go ahead and just drop in our planar reflection and bring it up and see if i go into game mode you'll see kind of what i mean by that reflective surface so again the only time you would really use this is when you have a body of water like a flat puddle a pool or something like that but be mindful this is the most expensive type so use with caution all right so it covers planar reflections um let's keep moving on so the two that next two that we have are box and sphere now something to note here with both box and sphere reflection captures are is that they are very cheap in fact you can populate your scene with a lot of them now i'll show you later why you don't want to do that you want to be specific about it but just know that they're very cheap in terms of their performance costs so you can populate them as much as you need to to get the accuracy of the reflections that you need all right now with that being said what i want to show first is our box reflection capture so i'm going to go ahead and drag this into our scene and if you notice here so i'm going to take a look at kind of this little side window since it's fairly reflective now we do have some dirt but that's fine it gets the point across and then i've got two panels over here which is just going to help me position it all right now principle number one that i want to cover in terms of placing your reflection captures is be mindful that if i kind of fly up here and we can see the little icon here so i'll press escape so this is our indicator for reflection capture that is the capture point at which the information is going to take so what i mean by that it's very critical that whenever you're placing your reflection captures be mindful that it will be reprojecting that information back into your scene and typically speaking the best rule of thumb is place those reflection captures at the height of your viewers so if you've got like a gaming experience place it around you know six feet tall two meters wherever the player will be running now if for some reason you're using you know very short characters or something like that you may want to place them lower just be mindful again though that that reflection capture the information it reprojects back into your scene will be at the height and the position of where that is placed so i'm going to go ahead and just move this up and kind of position it somewhat center of our train totally fine and if you notice that i kind of have reflection information but i don't yet because i've got this warning reflection captures need to be rebuilt this process is extremely quick in fact if you have a whole scene populated and you have hundreds of reflection captures generally speak it's only going to take a couple seconds to recompile so to do that underneath build i'm going to click this little triangle drop down and i've got reflections build reflection capture so as soon as i do that you'll notice now that my reflections are a little bit more accurate all right so i'm going to press g to go into game mode so we can kind of see what's happening here all right so this is that box capture in action if you notice there's a slight bit of um kind of off kiltered here a little bit the reason for that is our box cap box captures are really best suited whenever you have like a boxed environment so think about just you know a room inside of a house or a building something that has fairly straight walls up and down that's typically when you'll want to use a box reflection capture um so with that being said that's kind of the first one now that should cover box reflection captures but what i want to show you here too is something again that i recommend doing at the start of your project settings but you can do it on the fly and that has to do with the capture resolution so if you notice over on our box reflection capture i'll go ahead and roll this up i don't really have even if i expand this out here i don't really have the ability to change the captured resolution in fact that's set globally in our project so i'm going to go up to edit project settings and i'll go ahead and move this up and in here all i'm going to do is you can click all settings or just type i'm going to type in reflect and what i'm looking for here is this reflection capture resolution all right now i'm going to move this off now i believe by default it's 128. um that's pretty low um and if you're working on something like a mobile title or vr title um you may want to have it lower because you just that's a lot more texture information to process on the gpu or lack of gpu if you don't have one but in this situation i actually want to bump it up so assuming we're going more towards like arc fizz or you know very realistic you absolutely can bump this reflection capture resolution up to maybe 1k 2k so 1024 2048. be very careful those you start getting to 4k so 4096 or above that can get very expensive so in this case i'm going to change it to 10 24. now before i press tab or enter what i want you to pay attention to is the reflection here in particular the two doors that we have so i'm going to go ahead and press enter and you'll notice now that i start to get a little bit more information in that reflection capture so again going back to the principle that our reflection captures are like miniature hdris reprojecting back into our world the higher our reflection capture resolution the more information it can capture and then reproject so again if i change this to maybe like 2048 you notice that i don't get a ton more information but it is a little bit longer to process so again i'm going to keep ours at 10 24 press enter and we should be good to go and again as you saw you can change this on the fly uh but usually it's better to start at the beginning of your project kind of pick you know what it could be and go from there all right perfect all right so now what i'm going to do i'm going to just delete our box capture so now we don't have our reflection captures and the next one we're going to go on to is our sphere reflection capture now the sphere reflection capture is going to be the most common type in fact that's probably the most widely used reflection capture that you will use and so for that one i'm going to kind of drive home a lot more principles here but these absolutely can be applied towards your box reflection capture plan reflection not so much all right so i'm going to go ahead and keep this one kind of focused on this window and i'll kind of use this secondary viewport that i have here to drop our reflection captures in so i believe that should be yep so this is that window that we're looking at all right so the the first thing that i want to cover with the sphere reflection capture is important to kind of take a note um in terms of that you know you can place a lot of these all around your world so the question becomes how do i place them when do i place them so let's answer the first question which is how do you place them so i'm going to go ahead and just drag a sphere reflection capture into our world you can see i'm going to kind of line it up next to the seat here somewhat center and then kind of push it up maybe to the height of our player all right so we have our reflection captures need to be rebuilt we'll go up and quickly build it and now we have the information projected back into our world so there we go so let's just take a look here first at what just placing these reflection captures give us all right so there we're starting to see the effect again why we'd want to use this right we're not using real-time ray tracing in our scene but we need that reflection information so there is that first reflection capture working in place it's at the height of our player so if you know if i'm walking past here generally speaking that doesn't look too bad now we can just we can kind of start to see that parallax shifting here on our first seat and here is why so this is going to take me to the first principle about getting you to think about in terms of where you place these so if you notice as i look in this window we kind of have you know what is this seat here and the windows etc well if i kind of move down to the other end of this this train you'll notice i have the exact same reflection capture and that is because if i go back to gamemode here we only have this one reflection capture in our scene which takes me to the first point which is to understand one of the rules with reflection captures is smaller reflection captures always override larger reflection captures so inevitably what i would always start with in any of my scenes is go ahead and just place a reflection capture in your scene we'll place it somewhere in the middle and take your influence radius all the way up now i have let's go ahead and just build reflection captures see what we get and there we go so we now have some reflection information in our scene which is step number one just to make sure that we have something all right so with that being said there's really three ways that i typically try to approach our reflection capture so again going back to smaller reflection captures will always override larger ones well now we have our first one which i'm just going to call our broad sweeping reflection capture in our scene right this is just to make sure if we have any reflection reflective surfaces it's captured they have some reflective information totally fine okay so that one we're gonna set again our influence radius at the very highest that we can go to 16 384 which is the maximum technically allowed so with that being said we now have our global one but now we want to start fine-tuning this to where i'm gonna go to what i'm gonna call more of our scene reflection captures and so those are gonna typically fall around your two to three thousand uh unit influence radius range so i'll go ahead and go back to game mode by pressing g here and what i'm going to do is go ahead and just drag one of these into our scene all right so i'll position it relatively about the same height as our other one and what i'm going to do is i'm going to zoom out just so you can see all right so this uh this orange um kind of orangish yellow line this is that influence radius affected range of our sweet sphere reflection capture so if i go back in here in fact what i'll show you is we're going to take this down now we are working with a small scene so it's very important all right so right now we have the reflection capture of our main one we've added our second one i'm going to go into build reflection captures and now you notice that the reflection of this window updated and that's because it's contained within the radius of this reflection capture now again as i as i mentioned we've got our broad reflection captured and we have our scene one so this is that smaller version and typically around two to three thousand unreal units is fine so if i take this down to say 2000 not 200 we'll go 2 000 there we go you can still see if i zoom out that it pretty much encapsulates our entire our entire trade now if we were working on a much larger scene much larger building uh 2000 to 3000 would be totally fine too what i'm going to do is i'm going to go ahead and break that rule just slightly and take this down to a thousand all right so now you can see that as a thousand if i kind of zoom out here that we're kind of only taking over half of the train so that's perfect so i'm going to position one at the end here and what i can do is i can hold down alt and drag which will duplicate this so you can see i still have this one down here and then i've got another one down at the other end of the tray let's go back up here roll this up so we can see and then i'm going to go ahead and just build our reflection captures all right so hopefully this is making sense but let me just recap here real fast so our sphere reflection capture one let me go ahead and just change this to broad just so we know what's happening here so this is our broad and then we have our medium so i'll just type these into medium we'll go here medium as well and there we go so i'll kind of zoom in here so now that we have these three reflection captures our broad and two mediums what is happening here is if i kind of zoom into this window you see that i'm starting to get more of the reflection of the actual um i actually had this guy it's not a camera um but we'll notice that we're starting to get a little bit more accurate reflections locally now if i zoom down to the window you'll see that it still kind of shows it a little bit um and then at the end here as well i've got it so what's happening here let me kind of zoom out a little bit so our broad one is now encapsulating everything in the scene our two medium ones they have a small degree of overlap but let's say for example i had like a trash can outside of this sphere's influence radius this larger one would pick up the reflections whereas these two medium they would cover everything that's contained in it all right hopefully this is making sense now before we get down to the very kind of minut ones or what i'm going to call more or less our targeted sphere reflection captures um it's important to note that all of our reflection captures if we actually expand this out i believe all of them have kind of a a blending of sorts that happens with them so again if we kind of take a look at our broad one and zoom out here you can see that's absolutely massive um that there will be a slight overlap and transition between this so it's not a hard kind of angle so very important to kind of take note of that all right so let's go ahead and zoom back in here and we'll kind of go back into this guy and let's say for example and i'm just kind of making up the story as we go here we have our broad we have our medium our kind of our scene ones now what i want to do is let's say for example that going back to our window here right let's say that we have a character here and we're going to do like a cinematic shot or something and we want to make sure that the reflections here look accurate that's where we're going to go down to these very targeted reflection captures so to do that what i'm going to do is go ahead and just drag in another sphere reflection capture i'm going to set this guy super low which i think in this case about 200 should be fine all right so again i'm gonna move this into place again where it will be from like our players perspective now what i'm gonna do i'm gonna press g go into game mode zoom in on this window so we can see it i'm to use our secondary perspective here to kind of move this into place so as i move this this is where you start to notice that blending so as you can see there's that sphere reflection capture which again if i zoom out here we're no longer affecting this window because of the influence radius so that's where our other sphere reflection captures are taken over so all right so i'm going to move this in maybe 200 is too low let's take it to 300 all right perfect something to note here too if you notice kind of the the optical distortion happening here that has to do with the size and the radius of a reflection capture if i take this up to about 600 you'll notice that it starts to flatten out and that's because the full influence radius of the sphere reflection capture you're kind of spreading out that capture point that hdri for lack of better terms so in this case let's go and take it down to about 350. that might be fine move it into place kind of where i wanted and we'll go build build reflection captures and it should update this and there we go all right so as you can see we get a little bit of distortion but we get a much more accurate reflection inside of this little area here in fact if i zoom down you'll see this is where we have that other reflection capture i go back over to here you'll see that i have now a more localized so hopefully this is making sense so again let's kind of just jump back here on principle and explain what's happening so we want to have our broad sphere reflection capture or our broad reflection capture in our scene just to project some kind of reflection information back in from there we'll start to create our smaller ones and these what i'm going to call kind of our medium ones or you know more kind of an isolated area in your scene and with these we'll set their influence radius smaller than our broad one and that's going to help just to make the reflections look a little bit bigger in fact we saw that with our small reflection capture to where if they start to get too small you start to get kind of this optical distortion that happens with it because we're capturing you know a smaller point and trying to project it much more a lot more times around the scene which will get that distortion and then lastly what we're going to do is we're going to place these smaller reflection captures in our scene where we need it more isolated and targeted so again hopefully that makes sense at any point what's nice about this workflow is that if any point i'm like hey this free reflection capture isn't working and i delete it i still have that kind of mid-level coverage from my medium-sized reflection captures so again hopefully that makes sense um on you know how to place your reflection captures um really the only other component i'll go ahead and undo this so we get our reflection capture back really the only other thing to take note of with the reflection capture minus where you position it height wise is your influence radius and your brightness are about the only two things that you have to really be concerned about in terms of it um influencing back into your scene in fact if we take this up you see if i take my brightness up you'll see that it does affect it does look like the scene is getting brighter but really it's just affecting the information in the reflection so uh typically speaking leaving it at one is absolutely fine in fact you can see if i um if i hide this well actually won't do anything go back to game mode uh well so if we hide it you'll see that it's not really adding a ton more lighting information so generally speaking keep it at one and you're totally fine the other thing here to take note of is that you can have a an actual hdri in your scene which there are situations where you may want that to give an example of kind of contextually let's say for example that um in here you've got the scene capture cube i won't go into detail in fact i cover this in a totally separate video but one of the things that you can do with this scene capture cube is actually create your own hdris from your scene so there may be situations where you want to use that specific hdri you can capture those in your scenes and then using your sphere reflection captures effect let me go up to here you can change this from capture scene to specific cube map and then you can drop that texture in now it's a different it's not the virtual texture it's the actual hdri so you may find situations where that is applicable but again if you understand anything about your skylights and using hdris the same principles apply all right and finally the last thing that could be useful let's say for example that you know you weren't the one that was setting up the the uh the sphere reflection captures and whoever it was decided that oh they thought it was supposed to be ground level um and you're like well i don't want to move everything up that might be a pain of course you could uh what you can do is actually this capture offset so if i take a look here i'm going to middle mouse drag and take a look here so i probably want to have this up 120 units that's what that was showing so you can keep your reflection capture in it's in its area so in fact if i go over here to this window let's go to build reflection captures you can see that clearly it's you know being captured from down on the ground but i can select this and i can go z offset let's say 120 and i should take it up 120 units build my reflection capture it might be the other way around and now you can see that it has actually moved it back up so that is one way that again if you don't want to move the reflection capture for some reason you can do this capture offset um so hopefully that helps that should explain kind of the the basic and the generics of using sphere reflection captures truth be told uh they're very simple to use there's really not a lot of complexity to them so again hope that helps again this is not using real time right tracing with real-time ray tracing you pretty much don't have to worry about this workflow and that should be fine so hope that helps we'll catch you in the next video
Info
Channel: Ryan Manning
Views: 9,212
Rating: undefined out of 5
Keywords: UE4, Training, Game Dev, Tutorial, Unreal Engine, reflection captures, reflections, captures, reflective, metal, box reflection capture, sphere reflection capture, planar reflection
Id: KEwZD3hgX2o
Channel Id: undefined
Length: 22min 40sec (1360 seconds)
Published: Mon May 24 2021
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.