Glassix 2 v0.7 still in the works

Hi everybody,
I'll have to apologize for the lack of news this past month. I've been quite swamped with work on Glassix 2 with a huge unplanned texture and shader update since the game was reaching some critical bottleneck on the GPU side.
I'm about to get into some boring tech details here so you can skip to the end of the block if you're not that interested and I'll give a short TLDR.
<Details ON>
Glassix 2 is using Daz models for characters, outfits and hair with their 4k textures. In High Quality settings, those textures stay in 4k, halved to 2K in Medium Quality and quartered to 1K in Low Quality.
Textures are images, either JPG and PNG, which are compressed data, with JPG usually smaller than PNG but with quality loss. When those images go into GPU they are uncompressed and roughly take the same space whatever their compressed sized was. A 4K texture takes a bit more than 20Mo in GPU when you add mipmaps (Mipmaps are simply the same texture scaled down and used when zoomed out. There can be several levels 4K => 2K => 1K => 512... And so further the camera is, the lower the quality of the texture is used to reduce GPU usage since the texture won't need that much details from a distance). 
That's for the texture side. Now for Glassix 2 feature side, since I wanted to make the game as easily moddable as possible, I created a shader where you could stack texture on top of each other to add details, tattoos, holes and so on, up to 4 additional layers of such textures. If you make the basic math, when you are using 5 4K textures for one material (the "skin" of the model), that's already more than 100Mo used. For one material... Note that 5 layers used won't happen that often but it's a possibility. And anyway, one model can be composed of several materials (For example for outfits, you could have one material for the chest part and one material for the sleeves, allowing you to color them differently or have different transparency/metallic/shininess... And on top of that, you have to consider the use of normal maps, which are special images giving depth to the base texture. Each material would require such a normal map if you don't want the texture to be flat in game. You can see where I'm going here and why Glassix 2 is so GPU hungry so far.
One Glassix 2 character is currently made of 6 main parts having their own material: Torso, Arms, Legs, Genitalia, Face, Mouth. That's one base texture + one normal map for each, at 4K, so 2*6*20Mo = 240Mo in GPU per naked character. Add hair which usually have 3 materials: 2*3*20 = 120Mo. Then add an outfit composed of a shirt, pants and shoes with on 1 material each (rounded down): 2*3*20 = 120Mo. So one character is currently more than 480Mo in GPU. On the plus side, textures only need to be loaded once and can then be shared across multiple characters. But this means the more hair and outfits I'd add in the game, the heavier the load would be on the GPU.
I never really bothered with this math or the details so far thinking it wasn't that big of a deal with the Quality settings allowing you to lower the textures anyway but after learning about it and reflecting on it, Glassix 2 is simply not a project which can work in 4K, there is simply too much to load and it'll only keep on increasing even more if I don't work on it right away.
So the easiest solution was obviously to lower the maximum texture size to 2K instead of 4K which reduces the size by 4 (since you reduce BOTH width and height), down to ~5Mo rounded down. And the difference in quality is barely visible, only by zooming to the max would it be noticeable so the gain overweight the loss quite nicely. But I wouldn't have be delayed that much if I had stopped to this optimization. Instead, I decided to push it further since I really wanted to the game to have as minimal loading times as possible while keeping quality. 
So the other famous technique to optimize texture is called channel packing. An image is simply the layering of 3 different grayscale channels: red, green, blue (and possible 4th alpha channel in PNG for transparency, JPG don't have). This means that as long as you have grayscale data, you can pack this data into 1 channel and stack up to 4 different data in each channel. Since my hair and outfit textures are actually grayscale which I color directly in game, it means I could put 4 different hair or outfit textures into 1 texture, potentially reducing the number of required texture by 4. However, I also need to pack the normal maps with their respective grayscale texture. Normal maps images are simply 3 layers of data to indicate the (x,y,z) component of the normal (which is basically used to tell the game how the light will bounce on the pixel of the texture to give it more depth). Those 3 layers are stored in the red/green/blue channels and there is a simple formula which actually allows to get the z component of the normal based on the x and y, meaning you can actually lose the blue layer of the map.
So in the end, I went ahead and packed the grayscale + normal x + normal y + potential alpha into one texture which roughly divides the number of required texture by 2 in Glassix 2. Sometimes, the models used the same grayscale and normal for several materials with just a different alpha textures. When that happened, I could pack 4 different alphas into one texture too reducing the count by 4.
Quite a complex optimization and the complexity does not stop here... Because there is a property about images I was not aware of which is the colorspace and is crucial in Unity. To get to the point, In Unity, the base color textures are actually using sRGB colorspace (called gamma colorspace in Unity) while normal maps use RGB colorspace (called linear colorspace in Unity) and when I merged my textures together, I ended up mixing colorspaces which gave horrible results and it took even more time to understand and adapt the shader to handle the packed textures.
Anyway, the shader still needs optimization but it should be ready enough for v0.7 and I'll try to improve it at a later date. The most urgent goal was mainly to reduce GPU usage which has been achieved with adequate results. And while I was at it, I also improved the hair shader to get more details in hair and handle transparency. There's still some issue handling transparency but overall, it should be a step in the right direction.
<Details OFF>
--- TLDR ---
Problem:
Glassix 2 GPU usage is too high due to high number and high size textures. Adding more models (hair/outfit/buildings/locations/furniture) would just lead to a full crash if not fixed early.
Solution:
  • Texture max size is now 2K, down from 4K
  • Most textures are now channel packed, effectively reducing texture count by at least 2 sometimes more

If you're good at math, that's 4 (a 2K texture is a quarter the size of a 4K texture) * 2 (Texture amount reduced by 2) = 8 reduction in GPU usage. Hopefully that will be a visible result in loading times on low end specs. I'll await feedback.
This optimization took me this whole last month and I've only been able to start working on the content you voted for since the end of the last week... As a reminder, the voted content for v0.7 was more hair/outfits, free mode and more daily life animations. I've just started working on the more hair/outfits part and came up another idea. 
I always wanted to add some kind of bonus for patrons who are supporting me and since I am working on additional 3D models, I thought I could use the same system as many other games: bonus hair/outfits for paying patrons. It's purely cosmetic and in low numbers so it's shouldn't be too much of an annoyance, there will still be much more free hair/outfits added to the game, I just wanted a little something for patrons.
So far, I've been able to add 12 new hair styles, 6 for men, 6 for females and I'll put 3 of each in patrons-only bundles. There's also one new beard. In total, that'll be 30 hair styles (15 male, 15 female) in v0.7 with 2 beards. Some of them also have more than 1 color option. Here is the preview of  the new content:
So Followers, Fans and Leader tiers will have extra hair content, one male, one female. I'll try to do the same with outfits, for Supporters, Patrons and VIP tiers so a total of 6 new outfits plus some free outfits.
I should be able to finish this in one or two days, then I'll move on to the new daily animations and release v0.7 with just this. Free mode will have to wait until v0.8 since it's also quite a big development. Moreover, with summer coming, I'll be on family vacation in France after 3 years of Covid restrictions so I won't have much time to work on Glassix 2 I'm afraid. This pushes v0.8 to around mid August :x
Sorry again for not being able to add more content faster to the game. Glassix 2 is quite an ambitious project and I'm mainly focusing on stability and optimization at the moment because it's easier to do it now than later. But that's only to deliver a good quality game, I hope you can understand that. In no way am I trying to stretch my work just for easy money. However I do also understand that not having actual content to play really hurts the idea of support so I'll resume focusing on content now that the game is more optimized.
I'd like to thank all the current patrons who still have faith in me and this project and will do my best to deliver what I've been advertising so far asap even though I'll be a little late this month, sorry again :x
Have a nice day!