nx_sdfrender.nx
buildroot/runtime/nx_sdfrender.nx
about
dependencies 2 imports · 42 importers
diagram shows first 10 each side; +0 more imports, +32 more importers in the complete lists below.
imports: nx_syscalls.nxnx_itrig.nx
imported by: nx_assetvariant.nxnx_assetvariant_gate.nxnx_autorig.nxnx_autorig_gate.nxnx_body_figure.nxnx_body_figure_gate.nxnx_bodypose.nxnx_char_asset.nxnx_char_custom_gate.nxnx_char_layers.nxnx_char_layers_gate.nxnx_creature_motion.nxnx_creature_motion_gate.nxnx_critic_kernel.nxnx_critic_visual.nxnx_face_carve_gate.nxnx_face_r2.nxnx_face_vs_target.nxnx_faceanat.nxnx_gen_orchestrator.nxnx_genloop_gate.nxnx_gltf_export_gate.nxnx_i2mesh_gate.nxnx_makeup.nxnx_makeup_gate.nxnx_meshgen.nxnx_meshgen_gate.nxnx_meshtex.nxnx_motion_photo_gate.nxnx_natstat_optimize.nxnx_obj_export_gate.nxnx_outfit.nxnx_outfit_gate.nxnx_person_face_gate.nxnx_photoreal_critic.nxnx_recombine_novelty_gate.nxnx_render_amp_compare.nxnx_sdfrender_gate.nxnx_sdfrender_mt.nxnx_t2mesh.nxnx_t2mesh_gate.nxnx_variant_mesh_gate.nx
structs
| none |
consts
| 9 | const PARTS_MAGIC_1206: i64 = 1206 |
| 10 | const PARTS_MAGIC_1330: i64 = 1330 |
| 11 | const PARTS_MAGIC_1024: i64 = 1024 |
| 12 | const PARTS_MAGIC_4096: i64 = 4096 |
| 13 | const PARTS_MAGIC_92821: i64 = 92821 |
| 14 | const PARTS_MAGIC_68917: i64 = 68917 |
| 15 | const PARTS_MAGIC_40503: i64 = 40503 |
| 16 | const PARTS_MAGIC_48271: i64 = 48271 |
| 17 | const PARTS_MAGIC_2147483647: i64 = 2147483647 |
| 18 | const PARTS_MAGIC_999999: i64 = 999999 |
| 19 | const PARTS_MAGIC_1048576: i64 = 1048576 |
| 20 | const PARTS_MAGIC_1250: i64 = 1250 |
| 21 | const PARTS_MAGIC_3600: i64 = 3600 |
| 22 | const PARTS_MAGIC_2600: i64 = 2600 |
| 23 | const PARTS_MAGIC_262144: i64 = 262144 |
| 24 | const PARTS_MAGIC_9000: i64 = 9000 |
| 25 | const PARTS_MAGIC_1445: i64 = 1445 |
| 26 | const PARTS_MAGIC_3400: i64 = 3400 |
| 27 | const PARTS_MAGIC_4200: i64 = 4200 |
| 28 | const PARTS_MAGIC_65536: i64 = 65536 |
| 29 | const PARTS_MAGIC_8201: i64 = 8201 |
| 30 | const PARTS_MAGIC_8192: i64 = 8192 |
| 31 | const PARTS_MAGIC_8183: i64 = 8183 |
| 32 | const PARTS_MAGIC_2026: i64 = 2026 |
| 33 | const PARTS_MAGIC_2048: i64 = 2048 |
| 35 | const W: i64 = 512 |
| 36 | const H: i64 = 384 |
| 37 | const HW: i64 = 256 |
| 38 | const HH: i64 = 192 |
| 39 | const FX: i64 = 1024 // fixed-point unit (1.0) |
| 40 | const FOCAL: i64 = 586 // ray focal (fx1024 ndc scale) -- scaled with width to keep the FOV |
| 41 | const KBLEND: i64 = 130 // smin blend radius: joints fuse smoothly but limbs stay DISTINCT (340 melted the whole figure into a blob) |
| 42 | const NPART: i64 = 18 |
| 43 | const PARTS_CAP: i64 = 48 // physical part-array capacity (room for a carved face; side slots moved out) |
| 44 | const O_FB: i64 = 0 |
| 45 | const O_PARTS: i64 = 1572864 // W*H*8 ; up to PARTS_CAP*6 i64 {cx,cy,cz,rx,ry,rz} |
| 46 | const O_KBLEND: i64 = 1575168 // = O_PARTS + PARTS_CAP*6*8 ; per-body smin blend; 0 => default KBLEND |
| 47 | const O_NPART: i64 = 1575176 // active part count (t2mesh objects vary); 0 => default NPART |
| 48 | const O_OPS: i64 = 1575184 // PARTS_CAP i64: per-part op -- 0=union(add), 1=carve(smooth-subtract) |
| 49 | const O_MATS: i64 = 1575568 // PARTS_CAP i64: per-part MATERIAL -- 0=skin(default), 1=EYE (sclera/iris/pupil) |
| 50 | const O_KB2: i64 = 1575952 // PARTS_CAP i64: PER-PART smin blend radius; 0 = inherit the body default. |
| 53 | const O_ROT: i64 = 1576336 // PARTS_CAP * 2 i64: per-part PITCH orientation (cos256, sin256); 0,0 = |
| 56 | const O_FLOOR: i64 = 1577104 // 1 i64 (in the O_ROT slack): 1 = render a GROUND PLANE (figures only) |
| 57 | const O_MTXAMP: i64 = 1577112 // 1 i64: micro-texture amplitude scale (256 = 1.0x) -- the reverse-judge knob |
| 63 | const O_FTEX: i64 = 1577120 // *u8 RGB8 rows (w*h*3); 0 = OFF |
| 64 | const O_FTEXW: i64 = 1577128 |
| 65 | const O_FTEXH: i64 = 1577136 |
| 66 | const O_FPUC: i64 = 1577144 |
| 67 | const O_FPVC: i64 = 1577152 |
| 68 | const O_FPSU: i64 = 1577160 |
| 69 | const O_FPSV: i64 = 1577168 |
| 70 | const O_FPVLO: i64 = 1577176 // photo-v projection BAND [vlo,vhi): reference-specific (hairline..chin); |
| 71 | const O_FPVHI: i64 = 1577184 // vhi<=0 -> full [1,th-2). Photo-space, so transform-invariant (person path). |
| 75 | const O_EYE: i64 = 1577192 // 1 i64: lateral eye offset (model units); 0 = centered/mono |
| 397 | const HS_BOB: i64 = 1 // the sdf_face default cap+nape (explicit id = a no-op, negative-control-provable) |
| 398 | const HS_LONG: i64 = 2 // deep nape + a back-fall volume down the back |
| 399 | const HS_PIXIE: i64 = 3 // tight cap hugging the skull, nape tucked short |
| 400 | const HS_PONY: i64 = 4 // nape tucked + a high tail behind the crown |
| 401 | const HS_BALD: i64 = 5 // hair parts collapsed inside the skull -> skin scalp renders |
functions
| 76 | func sdf_set_facetex(base: i64, tex: i64, w: i64, h: i64, uc: i64, vc: i64, su: i64, sv: i64) -> i64 |
| 89 | func sdf_set_facetex_band(base: i64, vlo: i64, vhi: i64) -> i64 |
| 99 | func sdf_set_facetex_person(base: i64, tex: i64, w: i64, h: i64, uc: i64, vc: i64, su: i64, sv: i64) -> i64 |
| 105 | func sdf_bytes() -> i64 { return O_ROT + PARTS_CAP * 2 * 8 + PARTS_MAGIC_4096 } |
| 106 | func sdf_set_floor(base: i64, on: i64) -> i64 { let f: *i64 = (base + O_FLOOR) as *i64; f[0] = on; return 0 } |
| 107 | func sdf_set_mtx_amp(base: i64, amp: i64) -> i64 { let f: *i64 = (base + O_MTXAMP) as *i64; f[0] = amp; return 0 } |
| 108 | func sdf_set_eye(base: i64, dx: i64) -> i64 { let f: *i64 = (base + O_EYE) as *i64; f[0] = dx; return 0 } called by 1: main |
| 109 | func fb_off() -> i64 { return O_FB } |
| 110 | func ww() -> i64 { return W } |
| 111 | func hh() -> i64 { return H } |
| 113 | func sdf_isqrt(v: i64) -> i64 { if v <= 0 { return 0 } var x: i64 = v; var y: i64 = (x + 1) / 2; while y < x { x = y; y = (x + v / x) / 2 } return x } |
| 114 | func sdf_min(a: i64, b: i64) -> i64 { if a < b { return a } return b } called by 1: sdf_smin |
| 115 | func sdf_abs(a: i64) -> i64 { if a < 0 { return 0 - a } return a } |
| 117 | func sdf_knee(v: i64) -> i64 { if v < 0 { return 0 } if v < 205 { return v } let x: i64 = v - 205; var o: i64 = 205 + x * 50 / (x + 85); if o > 255 { o = 255 } return o } |
| 120 | func sdf_aces(v: i64) -> i64 called by 1: sdf_shade_ray |
| 135 | func sk_hash(a: i64, b: i64, c: i64) -> i64 |
| 142 | func sk_vnoise(x: i64, y: i64, z: i64, C: i64) -> i64 |
| 167 | func sk_pore(x: i64, y: i64, z: i64) -> i64 |
| 201 | func mat_height(qx: i64, qy: i64, qz: i64) -> i64 |
| 207 | func sk_microtex(qx: i64, qy: i64, qz: i64) -> i64 |
| 215 | func sdf_clear_ops(base: i64, n: i64) -> i64 |
| 225 | func sdf_set_rot(base: i64, idx: i64, deg4096: i64) -> i64 |
| 231 | func sdf_set_op(base: i64, idx: i64, v: i64) -> i64 { let op: *i64 = (base + O_OPS) as *i64; op[idx] = v; return 0 } |
| 232 | func sdf_set_mat(base: i64, idx: i64, v: i64) -> i64 { let mt: *i64 = (base + O_MATS) as *i64; mt[idx] = v; return 0 } |
| 233 | func sdf_set_kb(base: i64, idx: i64, v: i64) -> i64 { let k2: *i64 = (base + O_KB2) as *i64; k2[idx] = v; return 0 } |
| 237 | func sdf_body(base: i64) -> i64 called by 11: mainmainmainmainmainmain+5 calls 4: sdf_clear_opssdf_set_floorsdf_set_mtx_ampsdf_set_kb |
| 288 | func sdf_head(base: i64) -> i64 |
| 319 | func sdf_face(base: i64) -> i64 called by 12: mainmainmainmainmainmain+6 calls 6: sdf_clear_opssdf_set_floorsdf_set_mtx_ampsdf_set_opsdf_set_matsdf_set_rot |
| 402 | func sdf_face_hairstyle(base: i64, hs: i64) -> i64 |
| 457 | func sdf_person2(base: i64, scratch: i64, hs: i64) -> i64 |
| 498 | func sdf_person(base: i64, scratch: i64) -> i64 { return sdf_person2(base, scratch, 0) } |
| 503 | func sdf_person_full(base: i64, scratch: i64, hs: i64) -> i64 |
| 544 | func sdf_shift_y(base: i64, dy: i64) -> i64 |
| 556 | func sdf_ellip(px: i64, py: i64, pz: i64, cx: i64, cy: i64, cz: i64, rx: i64, ry: i64, rz: i64) -> i64 |
| 568 | func sdf_ellip_rot(px: i64, py: i64, pz: i64, cx: i64, cy: i64, cz: i64, rx: i64, ry: i64, rz: i64, rc: i64, rs: i64) -> i64 |
| 583 | func sdf_smin(a: i64, b: i64, k: i64) -> i64 |
| 589 | func sdf_smax(a: i64, b: i64, k: i64) -> i64 { return 0 - sdf_smin(0 - a, 0 - b, k) } |
| 591 | func sdf_eval(base: i64, px: i64, py: i64, pz: i64) -> i64 |
| 626 | func sdf_eval_part(base: i64, px: i64, py: i64, pz: i64) -> i64 |
| 648 | func sdf_softshadow(base: i64, ox: i64, oy: i64, oz: i64, lx: i64, ly: i64, lz: i64) -> i64 |
| 671 | func sdf_ao(base: i64, ox: i64, oy: i64, oz: i64, nx: i64, ny: i64, nz: i64) -> i64 |
| 697 | func sdf_gi(base: i64, px: i64, py: i64, pz: i64, nx: i64, ny: i64, nz: i64) -> i64 |
| 757 | func sdf_shade_ray(base: i64, rox: i64, roy: i64, roz: i64, rdx: i64, rdy: i64, rdz: i64, skin_r: i64, skin_g: i64, skin_b: i64, misscol: i64) -> i64 called by 13: tile_renderfig_renderc_renderc_renderlg_rendercg_render+7 calls 14: sdf_evalsdf_isqrtsdf_softshadowsdf_gisdf_acessdf_eval_part+8 |
| 1241 | func sdf_render_rows(base: i64, yaw: i64, camz_units: i64, skin_r: i64, skin_g: i64, skin_b: i64, y0: i64, y1: i64) -> i64 |
| 1294 | func sdf_render(base: i64, yaw: i64, camz_units: i64, skin_r: i64, skin_g: i64, skin_b: i64) -> i64 |