Dealing With Avatar Lighting in VRChat

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
in this video we're going to discuss avatar lighting the different kinds of lighting that you have in unity and vr chat how to deal with them and some tips and tricks for using poi only shaders to sort of mitigate problems that you might run into there are two distinctly different kinds of lighting that you're going to run into in vr chat there's bass pass lighting and there's add pass lighting base pass lighting is what you get from directional lights and baked lighting so as you can see here there's this directional light and it's affecting the shading on the sphere and if i turn the directional light off you'll see that the sphere becomes this bluish brown tint and that's coming from the sky box which is the baked lighting in this case or the indirect lighting if i turn the light back on and then i go into window rendering lighting settings we'll get this lighting menu and we can actually turn the indirect lighting intensity down or the skybox in this case and then we're going gonna see that this thing is sort of a yellowish tint and then black on the back that's because it's only being lit by the directional light and the indirect lighting coming from the sky is non-existent so the shadows are basically black it's important to distinguish between the direct lighting and the indirect lighting in plano shaders you have full control over both of these sides and we'll discuss that later in the video the second kind of lighting is additive lighting this comes from dynamic lights like point lights and spotlights when they are set to a real-time mode the reason you see an avatar gets super bright is generally because of these point lights even though you set up your base pass lighting to have mid and max values the add lights don't adhere to that and they can actually add to your avatar and make them brighter regardless of what you set that to there are ways to deal with this and we'll discuss that when we get to the poyomi part of the video one problem that stands out regardless of what shader you use is where your lighting is calculated from for your mesh if your avatar is composed of multiple meshes say your head is one mesh and your body is another the lighting for those two meshes can be completely different based on where they're calculating lighting from when the lighting in a map is baked it saves that data to light probes which are these yellow balls you see here these can be laid out in a map in any way the user sees fit they store the lighting data in that specific position so any object that moves near them will get the correct lighting the problem with this is if your head is one model and the rest of your body is another model your body could be receiving lightning data from this probe while your head is receiving lighting data from this probe which doesn't seem like an issue now but if i were to move this sphere inside that probe you can see that this probe would probably get really dark baked lighting because no light is going to be able to hit it so if your avatar moves near that its body is going to be very dark and its head is still going to be very bright to solve that we have to control where lighting is calculated from and make sure its the same for all meshes on your model luckily the process for doing that is really simple all you have to do is select all the meshes on your model head on over to probes and then anchor override and set the position to wherever you want to calculate lighting i generally recommend using the chest so i'm going to head on over to the armature i'm going to find the chest bone and i'm going to drag that into the anchor override and that's it now all lighting will be calculated from the same spot all right let's look at pointy specific things now so i'm going to select all the materials so i can edit them all at once if you didn't know you could do that it's really useful then we're going to head over to light data and this is where all the lighting colors are going to be calculated if i wanted my lighting to only ever be sort of dark and light with no color i could set grayscale lighting to 1 and it will always be in that gray scale if i wanted to receive full color i can set that to zero i'm gonna leave it at point four because that's how the author set this up the minimum brightness is how dark your model can get so generally you're within a range of zero to one i usually keep minimum brightness at zero because i feel like if the map wants me to be dark i should but a lot of people don't like their avatar to go full black they usually up that to a small value like .05 or 0.1 i'm going to set it to 0.5 right now just to show you what it does and then i'm going to lower the map lighting for both the directional and the indirect lighting now you see that the floor has gone black but my avatar stays at that minimum brightness and if i change that you can see the avatar gets darker or brighter based on what that minimum is i usually keep it so it goes black but that's up to you alright let's turn the lighting back on and let's discuss the direct and indirect settings so if i select all the materials again and i head on over to the shading section this is where you sort of apply that lighting that you calculated in light data i'm going to select multi-layer math this is going to have a lit side and a dark side based on these sliders that you select the lit side is your direct lighting and the dark side is your indirect lighting or your shadows your light side is basically just the color from the lights but the dark side or your shadows is what you really have a lot of control over if you want the lighting from the world to be mixed into your shadows you're going to want ignore indirect shadow color to be at zero if you want to stylize these shadows to look exactly how you want you're going to want to ignore the world's indirect lighting so that you can get the shadows looking any color you want no matter what world you're in no matter what color the lights are in you're going to tint properly to your color all right let's get into the additive lighting so i'm going to take my light and i'm just going to set its intensity to 10 so we get a really bright light and we can discuss how to fix that so i'm going to select all the materials again i'm going to go into light data and i could disable additive lighting entirely but that's going to make you look really bad in a lot of worlds and i would not do that what you want to do is go into the limit brightness section and then you want to limit that brightness to whatever you want it to be so if i wanted it to be 1.0 that light could only get as bright as one and then it would add one brightness to the model which doesn't look too bad but if i got multiple of these lights they're gonna start stacking even though they're all limited to one it still adds up to four when i have four lights if i wanted to resolve that i would select all my materials go down to rendering blending and then in the additive blending i would set rgb blend to max that's going to take that maximum lighting value and make sure that you cannot exceed that value without a dividing no matter what so no matter how many lights i make even though the ground is getting brighter my avatar stays the same you still want to add some light though because i find that if you have no point light affecting your avatar i would keep that max brightness above one just because if you're in a world where you're already one bright and then there's point lights there you're not going to be able to tell they're affecting you at all and that might make things a little bit weird so i would usually go up to like 1.3 1.25 that way you still get that subtle lighting from a point light but it's not going to blow your avatar out how the lighting shows up on your model is based on your material light data again is where you calculate the lighting and then shading is where you apply it so if i go into the add path shading section there's two modes realistic which is just going to be how standard shader or realistic lighting would use a point light it's going to be you know light where the light is and dark on the other side and then tune is a more controlled variant so with the tuned section you're going to choose where the light starts and where it stops so if i change the end position of the light you'll see that that gradient moves more towards the light and if i change the end to be further away we're going to get a soft gradient from the start to the end if i wanted there to be no gradient i would set the start and end to the same now if that light is near you you'll be lit and if it moves away you'll be dark you're not going to have the direction of the surface affecting that light at all so if i set the range of this light to 2 so it's pretty small and then i move it over the model it's going to light that model up when it's close like that but it's not going to have any shadows so for a lot of tune cases this is kind of what you want but for other cases you're still going to want to have those shadows so i would keep this at the default of 0 and 0.5 if you want sort of a smooth gradient let's make that light bigger again so if you want a softer gradient move it a little forward so if you want a soft gradient you can go from zero to point five and if you wanted a hard tune gradient you could go from point five to point 0.5 and that would give you those really hard tuned shadows that you can see there now you don't have to ever worry about the light blowing you out because we set the max up like we did before one last thing with additive lighting is if you go to a world that is only lit by additive lights which i highly recommend against you can have situations where one side of you is light and the other side of you is completely black to fix this you're going to want to change your lighting pass through which is found in the light data so there's point light pass-through right here we're gonna it's at zero by default but if you increase it to 0.5 for example the dark side of the model is going to be lit based on a percentage of the light side so if i increase this to one you'll see both sides are equally lit but if i put it down to zero it's completely dark on the other side if you want this to sort of look normal most of the time i would set it to 0.5 and then if you're in a world that only has point lights you're not going to be black on the other side at least but you will have that harsh shadow from the additive light there's not a lot you can do about it but it's better than nothing that should cover almost all of the problems you're going to have with lighting in vr chat if you're still having any trouble though feel free to join the discord there's a link in the description below and as always i hope you learned something and thanks for watching
Info
Channel: poiyomi
Views: 28,234
Rating: undefined out of 5
Keywords:
Id: T70JADdM9q4
Channel Id: undefined
Length: 10min 31sec (631 seconds)
Published: Fri Jul 01 2022
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.