# Basic Optimization Basic optimizations that can be applied fairly easily to anything # Draw Calls (Materials and Meshes) Generally, you should keep your material count as low as possible, as every new mesh and material in a scene counts as a new draw call, a draw call is an instruction to the graphics card on what to draw and how to draw it, the more draw calls you have, the more instructions being sent to the graphics card, and therefore the slower it'll be as it's processing all those instructions. The exact numbers of how many draw calls is "too much" is difficult to gather, because it heavily depends on the computer hardware, however, the lower the better. While many modern computers could run scenes with over 1,000s of draw calls, *that doesn't mean it should*, you should always aim for the lowest amount of draw calls with your worlds and avatars to ensure performance takes little to no hit. So remember: 1 Mesh = 1 Draw Call, *and* 1 Material = 1 Draw Call So if we had an avatar with 16 skinned meshes and 32 materials, your avatar would be ***48** draw calls*, which is a bit ridiculous for a single person! If you had 10 people in that same avatar, it would end up being ***480*** *draw calls!* Which is typically the amount a rather medium-sized world would likely have! In general, draw calls add up, and the best way to reduce them is to reduce your materials and meshes, what are ways you can do that you may ask? ## Texture Atlasing Texture Atlasing should frankly always be done whenever possible. Texture Atlasing is a technique used widely in 3D modeling to optimize models for use in games. There are two ways you can go about this. ### CATS Method The CATS method is generally easy although not ideal, in the CATS menu, you can go to the optimization tab, click Atlas, and hit a button to save it. The atlas textures it generates are often too large and leave a lot of empty space, although it's better than no atlasing at all. [](https://vrclibrary.com/wiki/uploads/images/gallery/2023-02/b8nimage.png) ### Manual Method This one is a bit complicated to explain in text form, so I made this short video. ## Reduce Meshes If you have a mesh that doesn't need to be separated on your avatar, join them together. There's no need to have them separated unless you have an animation to toggle on and off a specific mesh, such as a jacket.
As of the 2022 Unity upgrade, meshes don't need to be split due to shapekeys as this issue was fixed in the Unity version being used. However if your mesh has a lot of shapekeys, you should split for mesh vram reasons, more preferably delete shapekeys you don't use and merge shapekeys that are used together for facial expressions and such.
# VRAM Usage A.K.A Stop Being Monsters With Your Textures With the most recent [Developer Update](https://ask.vrchat.com/t/developer-update-16-february-2023/16474) post at the time of writing this, we have learned that Avatar Texture VRAM will now be accounted in the performance ranking. Below is a table of what the VRAM limits will be according to the dev post.**Excellent** | **Good** | **Medium** | **Poor** | **Very Poor** | |
**PC** | **<40MB** | **<75MB** | **<110MB** | **<150MB** | **>=150MB** |
**Quest** | **<10MB** | **<17MB** | **<25MB** | **<40MB** | **>40MB** |
***Do NOT turn off Mipmaps! You may have heard this can reduce VRAM but it can cause performance and visual quality to take a hit! [Poiyomi's post here goes more in-depth with it.](https://www.poiyomi.com/blog/2022-10-17-texture-optimization#dont-disable-mipmaps)***
**Overall, I highly recommend reading *[Razgriz's Optimizing Texture Memory](https://www.poiyomi.com/blog/2022-10-17-texture-optimization)* post as well, it goes into much more depth about this topic than I have.**VRAM usage does ***NOT*** equal the file/download size of the texture! The VRAM use of a texture is in its uncompressed state**, meaning crunch compression will not affect VRAM usage, however, please still use crunch compression to reduce your avatar's download size.**
[](https://vrclibrary.com/wiki/uploads/images/gallery/2023-02/09Timage.png) As you can see, it's set to 4k, *but does it really need to be?* Frankly, no. Below is a gif showing the difference between 4096 and 2048 on my model. The only difference it particularly makes is on a very small part of my model that has a bit of detail on the horns, which is largely unnoticeable. [](https://vrclibrary.com/wiki/uploads/images/gallery/2023-02/textest.webp) *Do you know what is noticeable though?* The VRAM usage! Let's head back to Thry's VRAM Calculator. [](https://vrclibrary.com/wiki/uploads/images/gallery/2023-02/EAaimage.png) As you can see, the VRAM usage dropped significantly, from 21.33MB to 5.33MB, which is a ***16MB*** difference, for VERY little quality loss. Now my avatar only uses 29.76MB and fits snugly into *excellent*. However, we can take this a step further by doing it with the rest of the textures. I also went ahead to split the face of the mesh from the rest of the body and removed all the shapekeys on the body to lower the VRAM usage of the meshes. This doesn't do too much on low-poly models like mine, but can have a tremendous effect on high-poly models.**NOTE:** You do not have to change the source image's resolution, changing the resolution in Unity is enough. This allows you to avoid doing anything destructive to your textures! This is because Unity essentially recodes the entire file to be whatever specific size and other settings it's set to.