Unity VR Optimization : Light Probes

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
if we want Dynamic Lighting in our VR games then we need to talk about light probes so what are light probes in unity they're a way for us to store information about how lighting behaves in a certain area and that can then be used to create Dynamic lighting effects on our Dynamic objects in the end this gives us a more immersive experience while also giving us Dynamic lighting and doesn't break the bank with performance before we hop into light probes I want to mention that watching my video on the urp and also my lighting video will help you a ton in understanding what's going on in this tutorial so if you haven't done that yet you should probably check that out now so let's go over what's going on in the scene starting off you can see I have a back wall here I have two different floors with two different colors and then I have a ball hanging out right in the center and then I also have these two little objects here which are just spotlights that I've put to shine onto the ground there so with the spotlight I want to point out this in indirect multiplier so when our light comes down and bounces off the surface it's going to hit other surfaces and it kind of transfer that color onto them and so I've increased this a little bit just to make it more noticeable for this tutorial so let's get our scene ready for baking starting off the baking it's always good to make sure the objects that aren't going to move are going to be set to static so I'm going to just select all the objects that I don't want to move as static right now and I'm going to come over here click this and yes and another thing I'm going to do is for my blue Spotlight over here I am actually going to set this to baked and then for my red Spotlight I'm going to set this to mixed and the big difference here is mixed is going to allow us to have Dynamic shadows and it's going to cost a little more in performance so if you want the most optimization you would just have your lights be baked but the drawback there is you can't have Dynamic Shadows but really ask yourself do you need that Dynamic Shadow answers probably no next just for this tutorial and to make things a little more more dramatic I'm going to turn off this directional light that I have I'm gonna go to window I'm gonna go to rendering and lighting and now we have our lighting window from the previous tutorial here again I'm just going to make a new settings and yeah our scene should be about ready but you know I want to make this a little more dramatic you don't have to do this this is just so we can really see what's going on I'm gonna click my sky box and change it to none so it's going to make the scene a little dark there now before I bake this scene I'm going to change this to a progressive GPU just so it renders a little quicker and hit generate lighting and see what we're working with and look at that you can already tell it is pretty dramatic we have this light bouncing off here and you can see there's some shading going on but let's see what's going on with this ball that I've left in the center that's still Dynamic now if I click on it and I come over to the one that's mixed you can see we have some lighting going on on the top of this and there is a shadow underneath but it's not getting the same you know colored bouncing off it and if we come over here to the fully baked well nothing's happening at all because well the light is fully baked and this is where the magic of light probes comes in light probes will actually give us the ability to kind of have this Dynamic lighting going on that's happening on this back wall so let's learn how to implement it and the first thing I'm gonna do is I'm gonna right click I'm going to go to lighting or lights and then light probe group and this is actually going to create a whole group for us to work with and you know I'm gonna zero this back out all right and I am going to drag this up an important thing I want to note here is you never want your light probes going into anything if you do that and we start to bake our Maps or our light Maps it's going to say well this light probe is dark it's just going to screw everything up so just make sure our light probes aren't in any objects and with that let's play around with this so what we want to do is we want to make sure every single light probe is placed where a significant change is happening with our lighting so a good example would be right here we have this light here and then we have this dark surface and so we'd want a light probe over here and a light probe over here another thing we'd want to do is we want to make sure when there would be changes of colors we want to have light probes on each side so a good example is here where it's split we'd want a light Probe on this side as well as on this side so that way this ball if it was in between them would have both red and blue on it so let's begin editing and we can begin editing by clicking this little edit button right right here and the quickest way I've found to fill out our light probes is by selecting a section of them so control you can click all these and we can move them over here and then I'm going to do the same for these guys as well all right and with that done now I'm going to click this group and I am just going to do Ctrl D to duplicate and then I'm going to drag out that duplicate there we go and I'm going to hit Ctrl D again and stretch it all the way over here and as you can see we kind of have a nice little meshing going on here but we need more detail so I am going to speed through this and then talk about it all right and as you can see things have gotten a little more complex I might have overdone it a little bit but as you can see here what we really want to be looking for is these big changes in between different colored lights or the intensity in lights and also the big changes between different bouncing lights so the bouncing light from here would be reflecting this way and the bouncing light from here would be reflecting this way so we have some light probes on each side of these two different colored materials so with that let's bake our scene and see what we're working with so I come over here lighting and generate lighting again been that one a little quicker and here we are if we zoom in you can see that we're already getting that Dynamic light we got a little blue over here we have a little red on the ball there on our Dynamic wall and if we move it through here we can actually see what light probes are affecting it and again we have the mixed light here so we have the shadow on the bottom and over here we have the baked light so no Shadow is going to show up but it's still giving us that Dynamic lighting with that little blue hue on it and if we wanted to see the full effect without the light probe showing up everywhere we could turn that off and we can move it around our scene and yeah that is a little more immersive that's a little more Dynamic and the cost isn't too high if we look down here our batches haven't shot up too much and let me put on the VR headset and see what it looks like in VR and yeah I have to say it looks substantially better and my performance isn't really affected although we are simulating dynamic Lighting on our Dynamic objects so there it is and you know one thing I'll mention is you know the first time they booted this up the light probes started to appear on my VR headset and I just kind of had to exit out of unity and boot it back up so let me know if you have any of those weird artifacts but besides that I hope you found this useful uh liking and subscribing is a really great way to support me at this moment and I'll see you in the next one bye-bye
Info
Channel: Fist Full of Shrimp
Views: 10,934
Rating: undefined out of 5
Keywords: unity urp, xr interaction toolkit, unity xr, unity vr urp, vr unity optimization, unity vr beginners quest 2, unity xr toolkit optimization, vr tutorial optimization, unity vr light mapping, optimization, oculus unity optimization, vive optimization, quest unity vr, vr optimization, unity xr optimization, unity optimization tips, unity baking lights, quest 2, oculus quest 2, Unity vr Light Probes, Unity Light Probes, unity optimization Light Probes, unity
Id: T13h3So6oFU
Channel Id: undefined
Length: 7min 26sec (446 seconds)
Published: Wed Jan 11 2023
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.