Home Artists Posts Import Register
The Offical Matrix Groupchat is online! >>CLICK HERE<<

Content

A major concern I've had for quite some time is regarding the size the characters occupy in VRAM (memory on GPU). The great majority of this space is occupied by textures.

In order to draw on textures using the GPU (the coloration system in FurryVNE), we're using something called a "render texture". While being versatile and allowing to draw into them, these are raw, uncompressed data, taking up vast amounts of space. For simple characters, it's not that big of a deal, but for more complex ones having lots of parts and multiple layers of clothing, the memory can grow significantly (up to gigabytes). When only having a single character on screen, it's fine I suppose, but if you're going to have multiple at the same time, the memory usage would simply be unacceptable. Just having 8 of these in a scene would essentially exhaust the memory of many high-end systems. This is not ideal.

Unity (the game engine we're using) does offer some functions for compressing textures to reduce their size, but my experience with them has been underwhelming. I'm not sure why, but even when using the highest quality settings for the compressing, the resulting textures look horrible.

Here's an example of what a normal map looks like when using the built-in compressing functions in Unity:

(Comparison of raw vs compressed data. The texture compression systems in Unity produce horrific results.)

This led us to spending time looking into alternatives. Luckily, we found a free, standalone CLI application that is able to compress textures and retain high quality. The biggest challenge was to prepare raw data from Unity to work with this system, but we managed to get it working. So now we have designed a system that exports the prepared data and compresses it using this third-party CLI application, and then reads it back in again. It works great and the results are much better:

(Comparison of raw vs compressed. The image is actually animating. The results are very similar uncompressed but takes much less size in memory.)

Load optimization

The time it takes to load characters is another concern I've had for a while. Because if you're going to load an interaction with 8 characters in it, and each one takes 8 seconds to load on average, that would be roughly 1 min of waiting. Not ideal!

So once we had this texture compression system in place, we were wondering how much we could speed up character load times by simply directly loading final results rather then generating them. Not only loading final textures directly, but also other parts, such as loading clothing and its final skinning data rather than doing heavy calculations on it.

One of the big challenges with this, we noticed, was finding a nice balance between data generation and data loading. Because as it turns out, some data is actually faster to generate than load (characters in FurryVNE consists of vast amounts of data). Through intense benchmarking, we have been experimenting with making system by system serializable, and cutting them away from generation (and rather load them directly instead through the serialized final data). We believe we have found a somewhat OK balance between generation and data loading.

While there (hopefully) is room for more improvements, we decided to load a few characters using our WIP fast load system and compare the results. You can see them below.

Peppy by Blacky

https://gyazo.com/5b9c99df6756c90980011b0d0ee7c261

Time - 37% (2.7x improvement)

VRAM - 30% (3.3x improvement)

Ankha by joni2k

https://gyazo.com/26521b7945bf11bb446418eed4338ce7

Time - 38% (2.6x improvement)

VRAM - 37% (2.7x improvement)

Maya by Dogson

https://gyazo.com/1be00005b53208b446e14a6490dc66ce

Time - 44% (2.27x improvement)

VRAM - 38% (2.6x improvement)

Krystal by Blacky based on work of kittysasha

https://gyazo.com/b192d61040cf8d96d5b7d9345ac9f242

Time - 22% (4.55x improvement)

VRAM - 30% (3.3x improvement)

----

It seems like the more complicated the character is, the bigger the time gains are. I reckon on slower systems than mine, the difference may even be bigger (as generation would take longer).

Future challenges

While characters are faster to load this way, actually compressing the textures and storing them in the fast load format takes a significant amount of time (something like 30s). Obviously, having to wait 8s for character load and then an additional 30s for compressing the character (FOR EACH ONE) is totally unacceptable user experience. Therefore, the way I'm thinking is making a server that compresses characters automatically as they're uploaded. Then, when somebody wants to use a character in an interaction, it will load the fast load version of the character which is not only faster to load but also uses far less memory.

There are some concerns how exactly that is going to work, though, as a fairly powerful system (in server terms) is required to set something like that up. I've been looking into cloud providers that have the required specs to run FurryVNE and generate the fast load data, and it would be very expensive to run. So expensive, in fact, that it would be cheaper to simply buy your own new computer solely for the purpose of being this server. So the way I'm feeling about this right now is either setup my existing laptop as this server, or simply build some server and have it co-located in some datacenter. We'll see what happens!

Also, another concern is the load time. While significantly less than generation, it still isn't quite as fast as I would hope. Around 2.5s times 8 characters is still 20s. Having to wait 20s for loading an interaction (not including environment load!) is still not a good experience for user.

Furthermore, so far I've only tested this on my own system, and it's a fairly powerful system with nVME SSD. Perhaps the gains would not be as good on slower systems. Needless to say, more time testing this would be optimal, but time is one of those things we don't have a lot of if we're supposed to get interactions out this year!

Summary

We've implemented texture compression into FurryVNE, making characters take far less space in VRAM than before. We've also created a system that instead of generating characters just loads them directly, which speeds up load times significantly.

There are some concerns how to best integrate these things to make the best user experience.

All the best.

- odes

Files

Comments

Anonymous

You and your team could take the whole year trying to optimize these changes, and I’d gladly wait. It may not seem like much, but I just want to say thank you for the effort that you all are putting in for this.

Anonymous

would you be willing to share with us what the 3rd party CLI's name is? the results are great and I'd love to see what else they've worked on.

Andrew

Why not just make baking the fast-load version of a character one of the steps of uploading? Then only the creator will have to wait through that. Or if they have to be redone periodically (say, for new software versions), perhaps you could have the first n clients that try to load it get the slow version, build the fast one, and then automatically upload their results. Once the server receives a few identical results, it can cache it and serve it to everybody following. Offload your computing on the users!

yiffalicious

Your ideas were among the top I had. The first one you already identified a problem with - the fast load format is prone to changes. So you'd have to do it periodically. As for the 2nd solution - it's definitely doable. But also at the cost of user experience as well as introduced complexity. Things like internet upload speed, multiple users trying to upload to the same character at once, errors in the uploaded file not to mention intentional abuse are all things we can circumvent with a dedicated server. Not to mention the user experience would be better, too.

Craket

Good working there. But I must say. Waiting 20 seconds for an 8 character scene to download is not that bad. If you are considering user experience, with so much technical heavy lifting a pc can do, you the have to implement stats per character/scene that tells you "Characters in scene" - "Scene mb size" - "Scene Length". That way, in terms of user experience, people can read into if something is heavy to run or not. Same should be applied to a character "Parts&amp;garments used" - "Character mb Size" etc. Because by the end of the day, you might not be able to dodge making anything faster, cus we will just mess things up and go hard on it. The more optimized you make it, the more "room" for us to be hard on the app. Which is good, but not too necessary. Just give the people the information if something is going to be though to download/open.

Anonymous

Was going to say what someone already said of making the compression step as part of the publishing process. The server solution is trying to solve a problem that you don't yet know actually exists for end users. It introduces a lot of complexity and cost without knowing the payout. Make it simple for now and expand on it later. Another interesting idea might be offering a way for creators to define the resolution of the textures during the character creation process. I don't expect every character needs the absolute highest resolution for everything. It does however introduce potential problems with uv mapping accuracy which some features I imagine are very heavily reliant on.

yiffalicious

You can already change resolution in preferences, and for parts/garments you can pick a specific resolution to use for the part.

rugarou

interesting... so personally, I dont know about the others, but "load in" time doesnt bother me much if everything runs smoothly after the fact. massive mod-lists in bethesda games taught me paitience. Im with Austin on this. however the only issue with leaving texture compression to the end user is ... they wont... old hands like Craket and Blaky know to compress and optimize thier creations/textures. Newer users arent going to do this. the problem with making easy to use tools are they are easy to use. this inevitably leads to inexperienced users using the tools.. lol... so its good to draw new users, but then you also get all the problems associated with it. learning curve. having a server for textures etc is going to use bandwidth, a lot of it, and thats going to be expensive, so at that point you are also accumulating an expense and not just an item. it also implements another potential "fail point" with multiple parts that can fail in its pathway. tho I guess ultimately its not much different than the interactions server, it will just be another VM youll have to run alongside the interactions server assuming you guys plan to keep that concept around.

Anonymous

Hey guys gotta say I’m with the other guys this time with the load times it can become a problem loading other people’s scenes I imagine but when creating I don’t mind waiting a little longer if necessary I can see you’re trying to strike a good balance and speed things up with minimal quality loss but if it ever comes to a point where you have to sacrifice one or the other in my opinion I’m willing to wait longer to have my models load at their best quality That being said will these updates only affect the size occupied on the v ram or will it also change the amount of assets we can add before uploading a character to the cloud because I’ve got multiple characters I’ve never been able to publish because of the size limitations?

yiffalicious

This doesn't have anything to do with the amount of parts you can have in a character. If you're exhausting the limits you could try asking for help in the forum or on discord and we can help sort you out because you should be able to create almost anything despite the limits if you're using the editor correctly. All the best. - odes