How to Optimize VRChat Avatars Using Only Unity

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
hi I'm Aki and welcome to my avatar optimization tutorial avatars have become more unoptimized as time has gone on and creators are expecting you to optimize their models yourself this tutorial will show you how I've learned to optimize models and more specifically.use models this is not a perfect tutorial there'll be many ways to do this better I learned how to do this all through basic trial and error and looking at other avatars and how they're set up it usually takes me many hours of sitting at Unity to optimize an avatar and the slower PC you have the longer it can take be sure to remember to save your project frequently as crashes can and will occur and don't be afraid to experiment and try new things just always remember to create a backup beforehand all right so let's get started I will start by opening up the VR chat Creator companion and creating a new project it's always worth creating a new project when you're starting a new Avatar we'll call this Dottie Piggy and we'll make it an avatar project and create the project now from here if you're using the Creator companion I would advise that you turn on gesture manager we're going to use that you can also add custom repos into here but we'll download them and add them ourselves manually all right now that we've got our Unity project loaded we're going to start adding in our packages before we add the model I've got a list of all the packages in the description and downloads for them we're going to start with VRC Fury VLC Fury will always take a little bit of time as the message says next I'll add docs Avatar optimizer I would add the gesture manager but we already added that through the VR chat and pinion I'm going to add pumpkin's Avatar tools I'm going to add thrives VR chat Performance Tools and now we'll start adding the things we actually need for the Avatar so any extra packages required by the Avatar we'll add now so Dotty models use polymy Pro so I'm going to add the latest version of poemi Pro into the project I would always recommend using the latest version of poyumi Pro as it does unlock and lock shaders instantly there's no wait time I'm going to add DPS and if you're using a model that uses DPS and poyomi don't forget to go into relu's Dynamic penetration system here into plugins and also open this Unity package here all right now that we've got all of our packages in the project I'm going to go ahead and actually open up the Avatar now this is going to take some time now that the Avatar is fully loaded we're going to go ahead and open up the Avatar scene with Dottie avatars it's this one called open me and the first thing I like to do is adjust the height on the Avatar or avatars I'm going to work with today I like using pumpkin's tools for this because it'll automatically adjust the Viewpoint for me I'm going to go ahead and select the model I'm going to upload the pumpkin Avatar tools drag in that model edit the scale and change it to the heights I like and press apply now we're going to upload a full version of the Avatar first this is what you can use when you're on a one-on-one situation or with a few friends when optimization isn't a worry it will also help us figure out what toggles and options we want to keep on the optimized version I'm going to go ahead and upload that now all right so once we have the Avatar fully uploaded uh come into VR chat and find all the toggles you want to have or the ones you want to keep and the ones you won't need I usually pull out a notepad and write this down so I don't forget try your best to think about what outfits and toggles your will or won't need in an environment with a lot of people we are trying to optimize for big lobbies after all now you probably don't need multiple outfits or multiple hair colors for example get the Avatar set up how you like so you can refer back to it in unity I've got my avatar set up how I want it to look like in unity and I've written down in a notepad what toggles I won't need anymore and get back to Unity so we're going to start by duplicating a version of the Avatar that we want to optimize for Dotty models I would suggest one of the non-dps versions I'm just gonna control D to duplicate we're going to turn off all of the unused models so we're going to click in all of these in the hierarchy and just untick them just to clean everything up and now we've just got one model to work with um I did notice that with this particular Dotty model it has scaling built in so I didn't actually need to adjust the height of that other model so I'm not going to worry about this one either and we're going to right click this model in the hierarchy and unpack the prefab completely that's going to allow us to delete things and edit things on the avatar and now what we want to do is just adjust the Avatar to look how we want it to look in game place the specific materials we want on the Avi as you want it to look like and start deleting outfit toggles and options you won't need so I'm going to refer back to my little notepad I've got here and start removing things that I don't need and set up the Avatar looking how I want it to I'm going to place the specific materials I want on the avatar I'm going to change the hair color now I'm going to go into the main Avatar asset folder which in this case is pig materials I'm going to go to here and I'm going to place the hair material that I used in game onto the avatar I actually use a blonde color and I actually change the color of that material through your shift that's how I get my hair color now I've turned everything off that I want to delete and I've got my avatar looking the way I want it to look in game so I'm going to actually start deleting some of these things now one thing I want to clarify is not to delete anything from your project folder down below here you may think that just deleting the extra hair materials here or textures will remove them from the avatar but it doesn't actually remove them from the Avatar slots that's because of the FX layer that's still there which loading which is loading in an animation for these material swaps The Next Step that we're going to do is going to be removing these animation swaps once all the extra fluff has been removed some things may look a little broken maybe your legs or arms look a little skinny like if I turn this off things might be colliding and that is due to blend shapes uh things aren't fitting properly or things aren't clipping um we can go into the Avatar's body or particular object open up the blend shapes and adjust them to make the avatar look normal again I can see here that my hair is clipping through this hat here So this hat probably has a blend shape to adjust that or the hair I'm going to click on the hair and go to blend shapes over here on the right and yes there's a blend shape here to have that fit underneath the hat I'm just gonna have a little look around here make sure everything fits probably all right now that we have the Avatar set up how we want we can now start adjusting the FX layer and the animations I will start by navigating to the effects layer I'm going to click on the model in the hierarchy over here and come over to the descriptor on the right and scroll down until I find FX I'm going to click on that which will navigate me straight to the effects in the project I'm going to click on the FX um we want to First duplicate this messing around with FX is a easy way to break an avatar and if you don't have a backup to go back to it can be quite hard to fix things I'm going to press Ctrl D to back that up press f2 and rename that back up and now I'm going to start editing the base effects so I click on the FX and go to the animator and this shows me all the FX layers on this Avatar this is basically the driver that's adjusting all of the changes on the model all the toggles hair swaps material swaps all that kind of stuff we're now just going to start deleting layers it's mostly intuitive and what you should and shouldn't delete based on the name of these layers assuming they're named correctly if you're unsure what a layer is doing you can actually click on the layer and click on what's going on here click in the animation that's up here that'll take you to what the actual animation is I can click on this animation now and go to the animation tab down here and it tells me exactly what's happening all this animation does is Turn The Fishnet bottoms on and off so if I wasn't using the fishnet in my avatar I would just straight up delete that but I am so I want to keep that toggle I would advise against removing whole drivers some avatars use these drivers to do multiple changes in one effects layer for this particular model it has a bunch of different hair options and we only want to keep one so what I'm gonna do is I know that the one I want to keep is short here so I'm just going to delete all of the other options short hair becomes the default option I'm going to come down and do the same to the other one I'm going to keep the reset and I will actually make this Shorthair the default you can see this orange means default I'm going to right click this and set the layer default state that means that now short hair will automatically load I'm now just going to go through and delete all of the toggles that I don't need referring back to my notepad that I have of all the things I no longer need on my avatar now what we're going to do is do a little test to see if we break anything uh we're going to switch back to the scene rather than the animator I'm going to actually go into tools up here and add the gesture manager emulator and I'm going to go into play mode so I'm going to press play play at the top switch back to my scene instead of game and click on the gesture manager this will show us the Avatar as it is in game you can now actually go in and check toggles make sure things work as they should I can see that everything looks good from all of the effects I deleted it doesn't look like anything broke only the things I wanted to break so when I press tasks no tasks show up because I deleted that if you remove something you didn't mean to just go back to that duplicate FX that you had that backup that you made and just drag that back up onto your FX layer over here and then I'll set it back to default and then just start editing the backup make sure to make a new backup when you start editing again now we need to remove the fizzbone scripts that are no longer in use and also optimize the first bone checks that are still existing a lot of these Dotty models have a lot of fierce bone checks that aren't necessarily needed so we're going to go back to the hierarchy over here and open up the Armature and we're just going to go hunting for anything that's a Fizz bone um this might be like the jiggle over here and basically the the main bad things or anything that's jiggly if there's anything hanging off the arms or dangling around really long strands of hair Tails those are things we're looking to optimize I'm clicking on the tail doesn't take me to the first bone script I've got to actually find it in the Armature what I recommend doing is actually turning on your gizmos at the top here if it's not already on and this will show you a lot of the stuff we're looking for here so in this example I've gone into the Hair Group here and I've found a bone you can see this white part here that's the bone um and the green pots are all the collisions that that bone can collide with for the Collision checks this particular bone has 21 Collision checks even though the bone only goes down to just just above the hip it still has the possibility to collide with the legs and the knees just a lot of extra Collision checks that aren't necessarily needed so this is where you would come into these collisions here and remove some of the Collision checks uh in this particular case we can actually see that this bone is for a piece of hair that we're no longer using I'm actually going to disable this script and just disable the hole the whole game object on the side here I would advise against just straight up pressing delete on this I've had a lot of issues of just pressing delete on here eventually it will be deleted in a further step um but I'm not going to do it here so I'm just going to go through all of these and I'll probably notice that most of these bones I don't actually need because they're part of the longer hair that I've turned off and this is a very tedious process of just going through removing the bones that are no longer in use in the scripts that are no longer in use and then any bones that are still in use just making sure that the Collision checks that are being used by them makes sense you know if that's a bunch of bones that are at the top of the head it probably doesn't need to worry about colliding with your legs for example what you can always do to test uh whether turning off particular bones is breaking your avatar or not is again just pressing the play mode in unity going back into the scene clicking on the model in the hierarchy I'll turn off gizmos so I can see everything just moving it around make sure all the hair is moving depending on the amount of Fizz Bones on the Avatar this can be a very tedious process luckily for me this particular Avatar doesn't have that many fist bones too check and remove now that we've removed all the excess it's time to optimize what we have left and remove some of that vram usage what we're going to do is we're going to open up the vram calculator so we're going to go to thrive at the top here down to Avatar and into vram we're going to drag our Avatar into the input over here and it's going to spit out some numbers at us basically what we're trying to do is reduce our texture memory here right now this model has 120 megabytes of texture memory it's not that bad but we can definitely do a lot better if we drop down the textures here we can actually see exactly what textures are on here how many megabytes or kilobytes they're taking up in space and we can kind of fix them from there you know if I go to pig face for example I know that's the face so you click on it it takes you to place in the project where that is and then you click on that texture on the right here is where you make your texture changes I would always advise against using crunch compression as far as I know crunch is really bad and all it does is reduce download size it does not reduce vram size at all and it adds lag when your avatar is loaded in so for all these I'm going to go in and actually turn off crunch compression and basically adjust the size of the texture in here what I like to do is just try and get a front-on look of the avatar reduce the size press apply and see if I notice a difference in the texture I'm just staring at the face right now and I'll just see if there's a difference once it's complete you don't want to be super close when you're making these changes because in reality this is an optimized model no one should be really close to you in the sort of environment that you would use an optimized model you can keep the high quality textures for your other version that you've got uploaded so I didn't notice a difference in that face texture so I'm going to keep that as is and it's just a matter of going through these slowly one by one and adjusting them this is adjusting the bra so I'm just going to take the top off and see if I notice the difference I don't probably keep lowering it I did notice a little change there you can either go through the materials just straight in the list here but you can just go through the textures one by one all in these folders here but if you do it that way there might be a couple of textures so you have adjusted that you didn't really need to because you removed them earlier my best advice for editing textures it's honestly just trial and error let's go into these these textures change your texture lower it until you can notice the difference just see how low you can get with it it's gonna be a slow process it's going to be a tedious process but it makes a big difference in the end the other thing you may notice when you're going through these as you might notice there's some textures that shouldn't be in there so say for example there's two Pig faces here there's a light skin and a dark skin one but we removed the skin Hue change in the FX animations so why is it still loading and that's because it's still loading on the material itself so if we click on the body and go into the body material here I'm going to unlock this material if we go into the decals here this is where Dottie does her skin color changes we'll notice there's still decals here that are loading just turning off the decal does not actually remove it from the material or the model the texture actually still loads what you have to do is click the little circle next to the picture type in none and change it to none that way it's not loaded in anywhere and then I'm going to turn off those decals as well now if I press refresh in the Avatar vrm calculator we'll notice that there should only be one pig face loaded now so if you're scrolling through here and you find things find textures that shouldn't be loaded maybe just have a little check of the respective material check the decals and see if you can turn it off not just turn it off but actually remove the texture all right I've now gone through the tedious process of going through all the textures and just checking each one one by one to see what I can get away with lowering the quality and what I cut and I've gotten my model down to 38 megabytes of texture memory that's pretty good um pretty much we're right at the end now we're ready to start uploading the model um you could if you want to at this point clean up the menu toggles um you will notice if I go into play mode and I go into the gesture manager it's going to be a lot of toggles that I've removed that do nothing now I removed the bag on the back when I press Pig bag nothing happens you can clean that up if that stuff annoys you that's a matter of finding your menus going into each menu and just deleting the things that you don't need anymore coming into each menu and just pressing delete on the things that you don't need but it doesn't really bother me whether those are still left over personally so I'm going to go ahead and upload this now I'm going to click on the Avatar in the hierarchy come down to the bottom of the descriptor on the right here and I'm going to add a components and I'm going to add dark's Avatar optimizer d4rk Avatar optimizer that's going to add a component down the bottom here and this this script is very powerful we can actually see exactly here what it's going to change so for this particular model it's going to change the skin to meshes from 18 to 2. materials from 33 to 23. lens shapes cut down all just with a click of a button but there are a few things that we want to do before we click this bigger create optimized copy now the first thing I always do is turn off right properties as static values I just noticed that breaks shaders very often so I'm just going to turn that off I'm also going to scroll down until I find debug info at the bottom open that up and just make sure there's no um unlocked or sorry locked in materials it says here it's very important that all your materials are actually unlocked before you create the optimized copy uh the easiest way to make sure they're unlocked is either come in here in one by one click on the material and unlock it or I can just right click the Avatar in the hierarchy here go to thrive materials and unlock all might look funny for a bit but it'll fix itself slowly that's one of the things you want to make sure that you do before you create the optimized copy is that all the materials are unlocked now the other thing I'm going to do is convert all the normal maps to bc5 it literally says right here a bc5 compressed normal maps are the highest quality for the same vram sizes other compression options but it's a no-brainer I'm just going to click that and it's going to automatically change the way that those normal maps are being compressed and just make them a little bit higher quality okay now that that's done I'm just gonna save and click create optimized copy it's actually going to turn off our copy of this Avatar in the hierarchy and create another one in its place so it's not actually destructively removing anything from our Avatar it's creating a new copy with all the changes now that we've got our optimized copy as sometimes this can break your avatar if this comes out a little broken and it's just a matter of trial and error this tool is very powerful but it doesn't get things right perfectly oh we can see the hair blend shape didn't come through properly so I might just have to fix that manually now the other thing we want to check before we go further is just to make sure everything works there we go into play mode again just to simulate as if I'm in VR chat go to the gesture manager and make sure logos work the final step now is adding VRC Fury to this optimized copy say in the optimized copy of the Avatar we're going to go down and add another component VRC Fury this is another really powerful script that can fix a lot of things on average and optimize things I use it for a couple of basic things I'm going to press Plus I'm going to add the blend shape optimizer the bounding box fix right defaults and that's about it there's a lot more that this can do but I haven't delved much into it yet to be honest and now this Avatar is ready for upload we've got this Avatar down to 180 000 polygons 500 Collision checks 20 odd materials it's a vast difference from what it originally was all we've got to do now is publish windows and we're all good to go thank you for watching my tutorial I hope it was helpful reach out to me with any questions if you need any help it's a lot of trial and error and this will be going to be a lot of things that don't seem to work along the way and sometimes you might just need a little bit of help with it
Info
Channel: akiwoo
Views: 20,672
Rating: undefined out of 5
Keywords: VRChat, VRC, VR, Unity, Blender, Chat, Optimise, Optimize, Avatar, Avi, Avatars, Dotty, DottyVR, Gumroad, How, Tutorial, How To, Guide, Avatar Optimization, Avatar Optimisation, Unity Tutorial, VRChat Avatars, Performance Optimization, Performance Optimisation, Performance, Virtual Reality, YouTube Tutorial, Optimizing Avatars, Optimising Avatars, Optimising, Optimizing, Game Development
Id: 7yZG1hxoHUE
Channel Id: undefined
Length: 31min 52sec (1912 seconds)
Published: Wed Apr 19 2023
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.