Home Creators Posts Import Register Favorites Logout

Content

As someone that isn't really a programmer, one word always makes my skin crawl, optimization.

Apologies as this might feel a bit technical, but I just feel I need to let you guys know more about what I am doing, even if it's kind of boring to a layman.

As a designer I don't like breaking a look I am going for because the resources required make the GPU sweat a bit, but I also understand I can't have it be 2FPS either, so I am constantly trying to balance it, like making the overall scope of the project small (smaller, more contained maps, low character count, etc.)

Still, I hit some bottlenecks that I needed to think differently about, and one of those places was something called "Draw Calls". I don't think I can properly explain it, but think of Draw Calls as the GPU pulling what it needs and layering it on the screen for you. The more it has to pull and layer, the worst it gets. Every unique mesh, ever unique material, every shadow, it all requires a draw. This was causing some really bad shuttering once I moved beyond six or seven characters on the screen at once, even more so when I added outfits, and further once I got some LoDs setup.

The biggest offender on this ended up being how I setup the character materials.

The character models have a lot of what are called Material Slots for different parts of the body, and while this made them easy to customize, it turns out each "Slot" adds a draw call. You have the same slots on LoDs for a mesh, well those also require draw calls, so shit ramps up fast. The character model has 13+ slots and often two character are together in tandem, obviously.

It took some thinking and some freak luck, but I discovered a way to reduce everything down to only TWO SLOTS, one for the body, and one for the eyes, without having to redo the entire UV system thanks to a function called UDIM. It allows me to load multiple textures as a sort of atlas map that matches with specific UV areas.

Since this meant certain things, like the nail color, lips, etc, would no longer be unique slots, I had to adjust how I handled recoloring, and made a material function system that utilizes masks instead. Oddly enough, while I worried doing this would add too much material complexity, it actually lowered it a bit compared to what it used to be since I no longer had to use TextureArray items.

So that is it for now, still trucking away with what little free time I have right now.

Files

Comments

infernalperson

Interesting, thanks for the write-up on it!