changed 2 years ago
Linked with GitHub

Anata VRMs

tags: anata

presentation by jin


Where we at?

  1. Sort Metadata ✅
  2. 3D modeling: 95%
  3. QA / Optimization: Ready
  4. Assembly into VRM Ready
  5. More QA / Polish 🔜
  6. Final delivery 🕺

Metadata


3000+ Unique Traits


Female Anata

Image Not Showing Possible Reasons
  • The image was uploaded to a note which you don't have access to
  • The note which the image was originally uploaded to has been deleted
Learn More →

1000 Female Anata, 1761 total unique traits



Male Anata

Image Not Showing Possible Reasons
  • The image was uploaded to a note which you don't have access to
  • The note which the image was originally uploaded to has been deleted
Learn More →

1000 Files, 1600 total unique traits



Number of traits per Anata

Stats Minimum Maximum Average
Female 5 14 8
Male 4 14 7

3D Modeling


Brace

FEMALE SHARED MALE

Clips and Kanzashi

FEMALE SHARED MALE

Clothing

FEMALE SHARED MALE

Earring

FEMALE SHARED MALE

Eyes

FEMALE SHARED MALE

Face Other

FEMALE SHARED MALE

Glasses

FEMALE SHARED MALE

tldr


Data wrangling all the final assets

Requirements:

  • 1-2 materials, 5-10k triangles max each
  • Principled bsdf materials
  • Parented to armatures in the blend file
  • Properly weighted (vertex weights)
  • Properly named in hierarchy (based on folder)
  • 1 blend per category (multiple for clothing)




Anata Traits All


Anata Traits Female


Anata Traits Shared


Anata Traits Male


Avatar Guidelines

We can have multiple levels of detail, High -> Low



Current versions are heavy


Manual work

great results but doesn't scale well


Male Stats

per individual traits

5/27/23

Summary Sum Average Maximum
File Size 2.1 GB 3.2 MB 37.8 MB
Images 992 1.5 13.00
Draw calls 985 1.5 6.00
Triangles 4,417,217 6723 182,168

6/25/23

Summary Sum Average Maximum
Size (KB) 3.8 GB 3.8 MB 38 MB
Images 2093 2.1 13
Draw calls 2102 2.1 8
Triangles 7,465,674 7,649 182,168

Male Stats


Shared Stats (5/27/23)

Summary Sum Average Maximum
Size (KB) 160.63 MB 1.15 MB 7 MB
Images 146 1 3
Draw calls 159 1 3
Triangles 997,454 7,124 88,884

Shared Stats


Female Stats (5/27/23)

Summary Sum Average Maximum
Size 1.24 GB 1.83 MB 82.72 MB
Images 797 ~1.18 4
Draw calls 1,251 ~1.85 17
Triangles 11,571,477 17,168 264,156

Female Stats



Female Body

2 draw calls
1 animations
1 materials
9089 vertices
15030 triangles
8 MB


Female BRACE

Value
Unique assets: 115
Total assets: 252
Percent: 25%
Min Size (KB): 174.0
Max Size (KB): 4825.2
Avg Size (KB): 1334.1
Min Images: 1.0
Max Images: 4.0
Avg Images: 1.5
Min Draw Calls: 1.0
Max Draw Calls: 6.0
Avg Draw Calls: 1.9

Female CLOTHING

Value
Unique assets: 297
Total assets: 1000
Percent: 100%
Min Size (KB): 643.4
Max Size (KB): 82723.0
Avg Size (KB): 2437.1
Min Images: 1.0
Max Images: 3.0
Avg Images: 1.0
Min Draw Calls: 1.0
Max Draw Calls: 17.0
Avg Draw Calls: 1.8

Female EYES

Value
Unique assets: 13
Total assets: 17
Percent: 2%
Min Size (KB): 7754.3
Max Size (KB): 8783.8
Avg Size (KB): 8227.8
Min Images: 1.0
Max Images: 2.0
Avg Images: 1.3
Min Draw Calls: 1.0
Max Draw Calls: 3.0
Avg Draw Calls: 1.6

Female GLASSES

Value
Unique assets: 59
Total assets: 399
Percent: 40%
Min Size (KB): 79.2
Max Size (KB): 1843.3
Avg Size (KB): 705.0
Min Images: 1.0
Max Images: 2.0
Avg Images: 1.2
Min Draw Calls: 1.0
Max Draw Calls: 3.0
Avg Draw Calls: 1.8

Female HAIR

Value
Unique assets: 296
Total assets: 1000
Percent: 100%
Min Size (KB): 990.6
Max Size (KB): 4225.5
Avg Size (KB): 2299.7
Min Images: 1.0
Max Images: 1.0
Avg Images: 1.0
Min Draw Calls: 1.0
Max Draw Calls: 2.0
Avg Draw Calls: 1.7

Female HALOS

Value
Unique assets: 18
Total assets: 68
Percent: 7%
Min Size (KB): 408.9
Max Size (KB): 2910.8
Avg Size (KB): 1007.9
Min Images: 1.0
Max Images: 2.0
Avg Images: 1.2
Min Draw Calls: 1.0
Max Draw Calls: 2.0
Avg Draw Calls: 1.8

Female HATS

Value
Unique assets: 11
Total assets: 21
Percent: 2%
Min Size (KB): 131.3
Max Size (KB): 1675.1
Avg Size (KB): 1111.3
Min Images: 1.0
Max Images: 1.0
Avg Images: 1.0
Min Draw Calls: 1.0
Max Draw Calls: 1.0
Avg Draw Calls: 1.0

Female HEAD

Value
Unique assets: 87
Total assets: 360
Percent: 36%
Min Size (KB): 205.2
Max Size (KB): 7723.8
Avg Size (KB): 1375.8
Min Images: 1.0
Max Images: 3.0
Avg Images: 1.2
Min Draw Calls: 1.0
Max Draw Calls: 3.0
Avg Draw Calls: 2.0

Female MASKS

Value
Unique assets: 14
Total assets: 60
Percent: 6%
Min Size (KB): 185.2
Max Size (KB): 5767.7
Avg Size (KB): 1097.9
Min Images: 1.0
Max Images: 2.0
Avg Images: 1.1
Min Draw Calls: 1.0
Max Draw Calls: 2.0
Avg Draw Calls: 1.1

Female NECK

Value
Unique assets: 68
Total assets: 304
Percent: 30%
Min Size (KB): 183.5
Max Size (KB): 1278.9
Avg Size (KB): 714.1
Min Images: 1.0
Max Images: 2.0
Avg Images: 1.1
Min Draw Calls: 1.0
Max Draw Calls: 3.0
Avg Draw Calls: 2.0

Female SIGIL

Value
Unique assets: 121
Total assets: 358
Percent: 36%
Min Size (KB): 131.3
Max Size (KB): 7438.0
Avg Size (KB): 1244.9
Min Images: 1.0
Max Images: 4.0
Avg Images: 1.6
Min Draw Calls: 1.0
Max Draw Calls: 6.0
Avg Draw Calls: 1.6

Female TAIL

Value
Unique assets: 19
Total assets: 152
Percent: 15%
Min Size (KB): 451.2
Max Size (KB): 2671.1
Avg Size (KB): 1750.6
Min Images: 1.0
Max Images: 1.0
Avg Images: 1.0
Min Draw Calls: 1.0
Max Draw Calls: 1.0
Avg Draw Calls: 1.0

Female WEAPON

Value
Unique assets: 80
Total assets: 560
Percent: 56%
Min Size (KB): 191.5
Max Size (KB): 3758.7
Avg Size (KB): 1356.1
Min Images: 1.0
Max Images: 2.0
Avg Images: 1.4
Min Draw Calls: 1.0
Max Draw Calls: 8.0
Avg Draw Calls: 2.6

Female WINGS

Value
Unique assets: 45
Total assets: 151
Percent: 15%
Min Size (KB): 334.9
Max Size (KB): 7528.4
Avg Size (KB): 3054.3
Min Images: 1.0
Max Images: 1.0
Avg Images: 1.0
Min Draw Calls: 2.0
Max Draw Calls: 4.0
Avg Draw Calls: 2.4

Male Body

1 draw calls
0 Animations
1 materials
7030 vertices
11038 triangles
3.6 MB


Male BRACE

Value
Unique assets: 114
Total assets: 374
Percent: 37%
Min Size (KB): 84.1
Max Size (KB): 7986.6
Avg Size (KB): 1754.6
Min Images: 1.0
Max Images: 4.0
Avg Images: 1.5
Min Draw Calls: 1.0
Max Draw Calls: 4.0
Avg Draw Calls: 1.4

Male CLOTHING

Value
Unique assets: 303
Total assets: 1000
Percent: 100%
Min Size (KB): 201.6
Max Size (KB): 37896.5
Avg Size (KB): 8177.7
Min Images: 1.0
Max Images: 13.0
Avg Images: 3.7
Min Draw Calls: 1.0
Max Draw Calls: 8.0
Avg Draw Calls: 3.7

Male EARRING

Value
Unique assets: 61
Total assets: 197
Percent: 20%
Min Size (KB): 17.8
Max Size (KB): 3119.3
Avg Size (KB): 293.9
Min Images: 1.0
Max Images: 3.0
Avg Images: 1.6
Min Draw Calls: 1.0
Max Draw Calls: 3.0
Avg Draw Calls: 1.3

Male GLASSES

Value
Unique assets: 64
Total assets: 219
Percent: 22%
Min Size (KB): 31.7
Max Size (KB): 1666.0
Avg Size (KB): 558.6
Min Images: 0.0
Max Images: 3.0
Avg Images: 1.0
Min Draw Calls: 1.0
Max Draw Calls: 3.0
Avg Draw Calls: 1.2

Male HAIR

Value
Unique assets: 121
Total assets: 1000
Percent: 100%
Min Size (KB): 837.9
Max Size (KB): 4126.7
Avg Size (KB): 2237.3
Min Images: 3.0
Max Images: 7.0
Avg Images: 4.1
Min Draw Calls: 3.0
Max Draw Calls: 7.0
Avg Draw Calls: 4.3

Male HALOS

Value
Unique assets: 28
Total assets: 129
Percent: 13%
Min Size (KB): 29.6
Max Size (KB): 1221.4
Avg Size (KB): 330.8
Min Images: 0.0
Max Images: 2.0
Avg Images: 1.3
Min Draw Calls: 1.0
Max Draw Calls: 2.0
Avg Draw Calls: 1.4

Male HATS

Value
Unique assets: 11
Total assets: 17
Percent: 2%
Min Size (KB): 136.8
Max Size (KB): 962.1
Avg Size (KB): 368.5
Min Images: 1.0
Max Images: 2.0
Avg Images: 1.1
Min Draw Calls: 1.0
Max Draw Calls: 2.0
Avg Draw Calls: 1.1

Male HEAD

Value
Unique assets: 89
Total assets: 449
Percent: 45%
Min Size (KB): 6.6
Max Size (KB): 2406.8
Avg Size (KB): 397.7
Min Images: 0.0
Max Images: 3.0
Avg Images: 1.2
Min Draw Calls: 1.0
Max Draw Calls: 2.0
Avg Draw Calls: 1.3

Male MASKS

Value
Unique assets: 15
Total assets: 47
Percent: 5%
Min Size (KB): 4.5
Max Size (KB): 2295.3
Avg Size (KB): 626.7
Min Images: 0.0
Max Images: 1.0
Avg Images: 0.9
Min Draw Calls: 1.0
Max Draw Calls: 1.0
Avg Draw Calls: 1.0

Male NECK

Value
Unique assets: 61
Total assets: 208
Percent: 21%
Min Size (KB): 9.8
Max Size (KB): 5159.8
Avg Size (KB): 1244.4
Min Images: 1.0
Max Images: 4.0
Avg Images: 1.2
Min Draw Calls: 1.0
Max Draw Calls: 2.0
Avg Draw Calls: 1.1

Male SIGIL

Value
Unique assets: 95
Total assets: 435
Percent: 44%
Min Size (KB): 45.6
Max Size (KB): 9024.3
Avg Size (KB): 3795.4
Min Images: 1.0
Max Images: 2.0
Avg Images: 1.2
Min Draw Calls: 1.0
Max Draw Calls: 3.0
Avg Draw Calls: 1.2

Male TAIL

Value
Unique assets: 19
Total assets: 82
Percent: 8%
Min Size (KB): 98.3
Max Size (KB): 1584.9
Avg Size (KB): 637.4
Min Images: 1.0
Max Images: 1.0
Avg Images: 1.0
Min Draw Calls: 1.0
Max Draw Calls: 1.0
Avg Draw Calls: 1.0

Male TATTOO

Value
Unique assets: 108
Total assets: 233
Percent: 23%
Min Size (KB): 3104.5
Max Size (KB): 4988.6
Avg Size (KB): 3217.9
Min Images: 1.0
Max Images: 1.0
Avg Images: 1.0
Min Draw Calls: 1.0
Max Draw Calls: 1.0
Avg Draw Calls: 1.0

Male WEAPON

Value
Unique assets: 100
Total assets: 516
Percent: 52%
Min Size (KB): 314.8
Max Size (KB): 11012.7
Avg Size (KB): 2483.1
Min Images: 1.0
Max Images: 2.0
Avg Images: 1.2
Min Draw Calls: 1.0
Max Draw Calls: 2.0
Avg Draw Calls: 1.2

Male WINGS

Value
Unique assets: 47
Total assets: 126
Percent: 13%
Min Size (KB): 287.9
Max Size (KB): 9573.4
Avg Size (KB): 3050.3
Min Images: 0.0
Max Images: 2.0
Avg Images: 1.0
Min Draw Calls: 1.0
Max Draw Calls: 2.0
Avg Draw Calls: 1.0

Material Optimization

1. First have all the final assets exported
2. Resize non-po2 images to power of 2
3. Optimize textures (pngquant, jpegoptim)
4. Rebundle into glTF binary files


Setup Environment

  1. Get stats for glbs per directory (male example)

./scripts/get_stats.sh files/male KB

Outputs a CSV with "Category,Name,Size (KB),Images,Draw calls,Triangles,File Path"


  1. Filter + Generate: HTML / TXT / JSON / CSV
    python3 scripts/visualize_stats.py metadata/stats/male.csv -o all

These will be useful for us later on, especially the JSON file which we use to load into our modelviewer HTML app during mesh optimization phase

Outputs files to metadata/stats folder


  1. Copy male files + folders to "files/optimize/"
    bash scripts/optimize/to_optimize2.sh metadata/stats/male_viz.csv

We essentially create a duplicate environment where it's safe to break things during the QA process. Uses the CSV made from before to grab file paths


  1. Create detailed stats about each category

python3 category_stats.py male_viz.json male_trait_stats.csv

We copy paste the output into the slide presentation you're viewing here!


Convert glbs to glTF, separate textures

find ./files -iname "*.glb" -exec sh -c 'gltf-pipeline -i "$1" -s -o "$(dirname "$1")/$(basename "$1" .glb).gltf"' _ {} \;


Generate CSVs about Texture Info

jpg

{ echo "path,resolution,kilobytes,bytes"; find ./files -type f -iname "*.jpg" -exec sh -c 'identify -format "\"%d/%f\",\"%wx%h\",\"%b\"\n" "$0" | awk -F, "{gsub(/[^0-9]/, \"\", \$3); printf \"%s,%s,%.2f,%.0f\\n\", \$1, \$2, \$3/1024, \$3}"' {} \;; } > male_jpg.csv

png

{ echo "path,resolution,kilobytes,bytes"; find ./files -type f -iname "*.png" -exec sh -c 'identify -format "\"%d/%f\",\"%wx%h\",\"%b\"\n" "$0" | awk -F, "{gsub(/[^0-9]/, \"\", \$3); printf \"%s,%s,%.2f,%.0f\\n\", \$1, \$2, \$3/1024, \$3}"' {} \;; } > male_png.csv


We will generate multiple CSVs like this one

pathresolutionkilobytesbytes
./files/male/TAIL/Siyokoy/tail_siyokoy.png1024x1024122.25125187
./files/male/TAIL/Gray_Cat_Tail_Dual/Gray_Cat_Tail_Gray_Cat_Tail_BaseColor.1001.png1024x1024115.86118642
./files/male/TAIL/Pink_Cat_Tail/tail_4_tail_4_BaseColor.1001.png1024x102485.0787115
./files/male/TAIL/Green_Tiger_Tail/green_Tiger_Tail.png2048x2048156.25160004
./files/male/TAIL/Mermaid_Tail/blue_tail_2.png1024x1024688.86705390
./files/male/TAIL/Chakra_Kitsune/tail_10_tail_10_BaseColor.1001.png1024x102498.93101306
./files/male/TAIL/Gray_Cat_Tail/Gray_Cat_Tail.png1024x1024156.11159860

Each time we do something, we make a new CSV


  1. Resize NPOT (Non Power of Two) Textures

Best practices to guarantee better performance


In green are power of two resolution textures

Everything else needs to be resized, for this we use resize_textures.py


After resize_textures.py

Image Not Showing Possible Reasons
  • The image file may be corrupted
  • The server hosting the image is unavailable
  • The image path is incorrect
  • The image format is not supported
Learn More →


PNG Compression example

Original: 1.2 MB

  • imagecompressor (web): 370 KB
  • optipng: 580 KB
  • imagemagick: 663 KB
  • pngquant: 372 KB

First Pass: PNG Compression for Male Assets

Sum (KB) Average (KB) Median (KB) Minimum (KB) Maximum (KB)
Before 577028.02 379.37 236.46 0.29 7827.18
After (default) 492233.93 323.63 195.23 0.12 4614.26
After (80%) 448954.15 295.17 195.18 0.12 2045.04

15% improvement by default highest quality
23% improvement with 80% quality
~1525 files


JPG Compression

PNG converted to jpg: 212 KB

  • 80% quality (imagemagick): 141 KB
  • 80% quality (jpegoptim): 114 KB

For textures that look like this, we can use JPG

10x filesize reduction

Image Not Showing Possible Reasons
  • The image file may be corrupted
  • The server hosting the image is unavailable
  • The image path is incorrect
  • The image format is not supported
Learn More →


First Pass: JPG Compression Male Assets

Sum (KB) Average (KB) Median (KB) Minimum (KB) Maximum (KB)
Before 239204.35 429.45 403.01 11.19 1802.60
After (80%) 114924.40 206.33 189.64 19.20 910.69

~50% file size reduction


First Pass Resize + Compression Overview

  • 2.8G images.tar (original)
  • 2.2G images_resized.tar (power of two)
  • 1.4G images_compressed_1.tar (png only)
  • 1022M images_compressed_2.tar (png 80%)
  • 801M images_compressed_jpg-png_80.tar (all)

Not bad, still plenty of room for improvement!


Todo: Texture Filename Sanitization


Filesize Estimations

Since 99% of the assets are modeled, we can make rough estimates about how every individual Anata stats might look when assembled together



Female VRM Estimates

Data taken from June 2023

Size (KB) Draw Calls Images Triangles
Minimum 6,472 1 1 2,900
Maximum 51,319 22 12 380,283
Sum 14,245,453 5977 4802 56,560,831
Average 14,245 5.98 4.80 56,560

Filesize is good so far, draw calls are heavy probably due to images, triangles are looking pretty heavy


Male VRM Estimates

Data taken from June 2023

Size (KB) Draw Calls Images Triangles
Minimum 3,525 1 0 804
Maximum 45,812 17 19 205288
Sum 16,579,220 7450 7055 27,566,221
Average 16,579 7.45 7.05 27,566

Filesize is almost good, draw calls are heavy, probably due to images (need to bake together), and triangles are good so far.


Mesh Optimization

Tools used:


Workflow

Setup

Get File size, Draw Calls, Triangles, Preview / Filter, Copy folder structure to files/optimize for processing

flowchart LR

GetStats(get_stats.sh)
Preview(visualize_stats.py)
Move(to_optimize.sh)
Step2(Step 2: Optimization QA / Model Viewer)

GetStats --> Preview
Preview --> Move
Move --> Step2

Step 2: Made visual tool to help QA process

Still gathering assets before commencing step


Assembling VRMs


Anata Boom Tools Vlog Update: June 3rd

Image Not Showing Possible Reasons
  • The image file may be corrupted
  • The server hosting the image is unavailable
  • The image path is incorrect
  • The image format is not supported
Learn More →

https://www.youtube.com/watch?v=30dsk97126s


Anata Boom-Tools Milestones


  1. Clothing


  1. Importing Assets


  1. Weight Transfering


  1. Spring Bones Additions

Modify the existing code to add spring bones to unique instances of hair, testing thoroughly while adding other spring bones as needed


Select a repo