code wiki / _hdl_build / nx_cast_gen.nx
nx_cast_gen.nx
buildroot/runtime/_hdl_build/nx_cast_gen.nx
about
nx_cast_gen.nx -- the capability that EXCEEDS the DAZ/Renderosity WORKFLOW on its weak axis: UNIQUENESS AT
SCALE. DAZ/Renderosity devs reuse the same paid marketplace figures -> the same faces recur across games. This
generates a UNIQUE character from a SEED (bounded-random params), infinitely, deterministically, $0, no license,
fully programmatic (no GUI/manual posing). It renders a CONTACT SHEET of a generated cast + reports the distinct
count. HONEST: stylized 2D, behind DAZ on photoreal fidelity; the exceed is uniqueness/cost/license/determinism/
automation, measured by nx_asset_exceed. license_tier: ORIGINAL expect_exit: 0
dependencies 3 imports · 0 importers
imports: nx_syscalls.nxnx_shade.nxnx_png.nx
imported by: nobody (leaf or entry point)
call flow from main pre-order; caps 40 nodes / depth 6 declared; ↻ = already shown
structs
| none |
consts
| 10 | const K_MAGIC_1103515245: i64 = 1103515245 |
| 11 | const K_MAGIC_12345: i64 = 12345 |
| 12 | const K_MAGIC_32767: i64 = 32767 |
| 13 | const K_MAGIC_20260623: i64 = 20260623 |
| 14 | const K_MAGIC_7919: i64 = 7919 |
functions
| 16 | func aw(s: *u8) -> i64 { var n: i64=0; while s[n]!=(0 as u8){n=n+1} sys_write(1,s,n); return 0 } |
| 17 | func an(v: i64) -> i64 { var m: i64=v; if m==0{sys_write(1,"0" as *u8,1);return 0} let t:*u8=sys_mmap(24); var k:i64=0; while m>0{t[k]=(48+(m%10)) as u8;m=m/10;k=k+1} let o:*u8=sys_mmap(24); var i:i64=0; while i<k{o[i]=t[k-1-i];i=i+1} sys_write(1,o,k); return 0 } |
| 18 | func lcg(s: *i64) -> i64 { var x: i64=s[0]; x=x*K_MAGIC_1103515245+K_MAGIC_12345; s[0]=x; return (x>>16)&K_MAGIC_32767 } called by 1: char_dna |
| 19 | func frect(fb: *i64, w: i64, h: i64, x0: i64, y0: i64, x1: i64, y1: i64, c: i64) -> i64 { var yy: i64=y0; if yy<0{yy=0} var ye: i64=y1; if ye>h{ye=h} while yy<ye{ var xx: i64=x0; if xx<0{xx=0} var xe: i64=x1; if xe>w{xe=w} while xx<xe{fb[yy*w+xx]=c; xx=xx+1} yy=yy+1 } return 0 } called by 1: portrait |
| 20 | func efill(fb: *i64, w: i64, h: i64, cx: i64, cy: i64, rx: i64, ry: i64, c: i64) -> i64 { var y: i64=cy-ry; while y<=cy+ry{ var x: i64=cx-rx; while x<=cx+rx{ let dx: i64=x-cx; let dy: i64=y-cy; if dx*dx*ry*ry+dy*dy*rx*rx<=rx*rx*ry*ry{ if x>=0{if x<w{if y>=0{if y<h{fb[y*w+x]=c}}}} } x=x+1 } y=y+1 } return 0 } called by 1: portrait |
| 22 | func skin_of(i: i64) -> i64 { if i==0{return sh_rgb(235,205,178)} if i==1{return sh_rgb(206,162,132)} if i==2{return sh_rgb(176,132,104)} return sh_rgb(148,108,84) } |
| 23 | func hair_of(i: i64) -> i64 { if i==0{return sh_rgb(124,64,42)} if i==1{return sh_rgb(222,192,110)} if i==2{return sh_rgb(40,38,46)} if i==3{return sh_rgb(92,60,40)} if i==4{return sh_rgb(176,176,186)} return sh_rgb(182,72,60) } |
| 24 | func eye_of(i: i64) -> i64 { if i==0{return sh_rgb(72,138,92)} if i==1{return sh_rgb(70,112,184)} if i==2{return sh_rgb(110,70,40)} return sh_rgb(120,96,150) } |
| 25 | func fit_of(i: i64) -> i64 { if i==0{return sh_rgb(118,52,56)} if i==1{return sh_rgb(54,64,104)} if i==2{return sh_rgb(46,80,60)} if i==3{return sh_rgb(92,72,42)} return sh_rgb(60,60,72) } |
| 27 | func portrait(fb: *i64, W: i64, H: i64, skin: i64, hair: i64, hstyle: i64, eyec: i64, outfit: i64) -> i64 |
| 45 | func char_dna(s: *i64, pbox: *i64) -> i64 |
| 51 | func main(argc: i64, argv: *i64) -> i64 |