code wiki / _hdl_build / nx_gamechar_sota_fetch.nx
nx_gamechar_sota_fetch.nx source
↩ module page · 63 lines · 4563 B
1// nx_gamechar_sota_fetch.nx -- CORRECTIVE research: how do GAME characters (DOA / Illusion Honey Select /
2// Custom Maid / Koikatsu) reach attractive-realistic WITHOUT neural nets? Ground the real pipeline:
3// VRM/UniVRM = the OPEN standard for exactly this (humanoid MESH + BLENDSHAPES + PBR/TOON materials +
4// SPRING-BONE physics + eye look-at) = "not just mesh on" · Illusion modding stack (char-as-data: mesh +
5// morphs + textures + eye/lash/brow assets) · toon/skin shaders (lilToon/MToon) · photoreal-head SOTA.
6// Banks raw -> knowledge/research/gchar_*.raw. expect_exit: 0
7import "nx_syscalls.nx"
8import "nx_x509_trust_store.nx"
9import "nx_trust_store_load_from_certdata.nx"
10import "nx_https_fetch_follow.nx"
11const K_MAGIC_4194304: i64 = 4194304
12const K_MAGIC_8388608: i64 = 8388608
13
14func w(s: *u8) -> i64 { var n: i64 = 0; while s[n] != (0 as u8) { n = n + 1 } sys_write(1, s, n); return 0 }
15func wn(v: i64) -> i64 {
16 let b: *u8 = sys_mmap(28); var m: i64 = v
17 if m < 0 { m = 0 - m; sys_write(1, "-" as *u8, 1) }
18 let t: *u8 = sys_mmap(28); var k: i64 = 0
19 if m == 0 { t[0] = 48 as u8; k = 1 }
20 while m > 0 { t[k] = (48 + (m % 10)) as u8; m = m / 10; k = k + 1 }
21 var i: i64 = 0; while i < k { b[i] = t[k - 1 - i]; i = i + 1 }
22 sys_write(1, b, k); return 0
23}
24func fetch_one(store: *TrustStore, url: *u8, outpath: *u8, raw: *u8, cap: i64) -> i64 {
25 let st: *i64 = (sys_mmap(8)) as *i64
26 let n: i64 = nx_https_fetch_follow(url, store, raw, cap, 6, st)
27 w(" [" as *u8); wn(st[0]); w("] " as *u8); wn(n); w("B <- " as *u8); w(url); w("\n" as *u8)
28 if n <= 0 { return 0 }
29 let fd: i64 = sys_openat_wr(outpath, 420)
30 if fd < 0 { return 0 }
31 var wr: i64 = 0
32 while wr < n { let c: i64 = sys_write(fd, raw + wr, n - wr); if c <= 0 { break } wr = wr + c }
33 sys_close(fd)
34 return n
35}
36func main() -> i64 {
37 let r: i64 = nx_trust_store_load_from_certdata("data/mozilla_certdata.txt" as *u8, 512, K_MAGIC_4194304)
38 if r <= 0 { w("STORE-FAIL\n" as *u8); return 1 }
39 let store: *TrustStore = r as *TrustStore
40 sys_mkdir("knowledge/research" as *u8, 0x1ed)
41 let cap: i64 = K_MAGIC_8388608
42 let raw: *u8 = sys_mmap(cap)
43 w("=== game-char SOTA researcher: how attractive game chars are built (NO neural) ===\n" as *u8)
44 var ok: i64 = 0
45 // VRM = the OPEN humanoid-avatar standard (mesh + blendshapes + materials + spring-bone + look-at)
46 ok = ok + (fetch_one(store, "https://raw.githubusercontent.com/vrm-c/UniVRM/master/README.md" as *u8, "knowledge/research/gchar_01_univrm.raw" as *u8, raw, cap) > 0)
47 ok = ok + (fetch_one(store, "https://raw.githubusercontent.com/vrm-c/vrm-specification/master/README.md" as *u8, "knowledge/research/gchar_02_vrmspec.raw" as *u8, raw, cap) > 0)
48 // toon/stylized + skin shaders that make anime/semi-real chars ATTRACTIVE
49 ok = ok + (fetch_one(store, "https://raw.githubusercontent.com/lilxyzw/lilToon/master/README.md" as *u8, "knowledge/research/gchar_03_liltoon.raw" as *u8, raw, cap) > 0)
50 ok = ok + (fetch_one(store, "https://raw.githubusercontent.com/Santarh/MToon/master/README.md" as *u8, "knowledge/research/gchar_04_mtoon.raw" as *u8, raw, cap) > 0)
51 // Illusion char-as-data modding stack (mesh + morphs + textures + eye/lash/brow assets)
52 ok = ok + (fetch_one(store, "https://raw.githubusercontent.com/IllusionMods/KK_Plugins/master/README.md" as *u8, "knowledge/research/gchar_05_kkplugins.raw" as *u8, raw, cap) > 0)
53 ok = ok + (fetch_one(store, "https://raw.githubusercontent.com/IllusionMods/IllusionModdingAPI/master/README.md" as *u8, "knowledge/research/gchar_06_kkapi.raw" as *u8, raw, cap) > 0)
54 ok = ok + (fetch_one(store, "https://raw.githubusercontent.com/BepInEx/BepInEx/master/README.md" as *u8, "knowledge/research/gchar_07_bepinex.raw" as *u8, raw, cap) > 0)
55 // photoreal-HEAD SOTA (mesh/gaussian, for the ceiling above game-real)
56 ok = ok + (fetch_one(store, "https://arxiv.org/abs/2312.02069" as *u8, "knowledge/research/gchar_08_gaussianavatars.raw" as *u8, raw, cap) > 0)
57 ok = ok + (fetch_one(store, "https://arxiv.org/abs/2312.03763" as *u8, "knowledge/research/gchar_09_relightavatar.raw" as *u8, raw, cap) > 0)
58 // eye rendering (the #1 beauty driver) + morphable face model lineage
59 ok = ok + (fetch_one(store, "https://arxiv.org/abs/2007.11341" as *u8, "knowledge/research/gchar_10_eyerender.raw" as *u8, raw, cap) > 0)
60 w("=== banked " as *u8); wn(ok); w("/10 sources -> knowledge/research/gchar_*.raw ===\n" as *u8)
61 if ok < 5 { return 1 }
62 return 0
63}