nx_gsplat.nx
buildroot/runtime/nx_gsplat.nx
about
nx_gsplat.nx -- ★SOVEREIGN 3D GAUSSIAN SPLATTING (the frontier rendering rep for photoreal avatars, confirmed
#1 by the 2024-2025 SOTA scan: GaussianAvatars/VRGaussianAvatar/HumanSplat all use it). A scene = a cloud of
3D Gaussians {position, scale(σ), colour, opacity}; render = PROJECT each to a 2D splat, DEPTH-SORT, and
FRONT-TO-BACK alpha-composite. ALL INTEGER (fx1024 positions, fx256 opacity/transmittance, an integer exp-LUT
for the Gaussian falloff), deterministic, VM-vettable. ★The RENDERER needs NO trained weights (only a
generator would) -- so it is fully sovereign-buildable TODAY. v0 = ISOTROPIC Gaussians (spherical σ -> a
circular screen splat); anisotropic 3D covariance (the Jacobian projection) + SH view-dependent colour are the
next rungs. Camera convention MATCHES nx_sdfrender (yaw orbit, FOCAL 586) so splats align with our SDF/mesh.
license_tier: ORIGINAL
dependencies 2 imports · 8 importers
imports: nx_syscalls.nxnx_itrig.nx
imported by: nx_gsplat_aniso_gate.nxnx_gsplat_elara_gate.nxnx_gsplat_face_gate.nxnx_gsplat_gate.nxnx_gsplat_optimize_gate.nxnx_gsplat_photofit_gate.nxnx_gsplat_showcase.nxnx_persongen_render_gate.nx
structs
| none |
consts
| 12 | const K_MAGIC_4096: i64 = 4096 |
| 13 | const K_MAGIC_3970: i64 = 3970 |
| 14 | const K_MAGIC_2000000000: i64 = 2000000000 |
| 15 | const K_MAGIC_65536: i64 = 65536 |
| 16 | const K_MAGIC_999999: i64 = 999999 |
| 18 | const GW: i64 = 512 |
| 19 | const GH: i64 = 384 |
| 20 | const GHW: i64 = 256 |
| 21 | const GHH: i64 = 192 |
| 22 | const GFOCAL: i64 = 586 |
| 23 | const GFX: i64 = 1024 // model-unit fixed point (matches sdf) |
| 24 | const GEXPN: i64 = 176 // exp-LUT entries: k=0..175 -> u=k/16 in [0,11) (11σ² = past 3σ) |
| 25 | const GNB: i64 = 2048 // depth-sort buckets |
functions
| 27 | func gs_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 } |
| 31 | func gs_build_explut(explut: *i64) -> i64 |
| 43 | func gs_clear(acc: *i64, trans: *i64) -> i64 |
| 52 | func gs_render(gauss: *i64, ng: i64, yaw: i64, camz: i64, fb: *i64, acc: *i64, trans: *i64, depth: *i64, sxb: *i64, syb: *i64, sigb: *i64, order: *i64, count: *i64, explut: *i64, bgr: i64, bgg: i64, bgb: i64) -> i64 |
| 155 | func gs_set(gauss: *i64, i: i64, x: i64, y: i64, z: i64, sc: i64, r: i64, g: i64, b: i64, op: i64) -> i64 |
| 164 | func gs_set_aniso(gauss: *i64, i: i64, x: i64, y: i64, z: i64, nx: i64, ny: i64, nz: i64, rtan: i64, r: i64, g: i64, b: i64, op: i64) -> i64 |
| 169 | func gs_proj_x(x: i64, y: i64, z: i64, sy4: i64, cy4: i64, R: i64) -> i64 called by 1: gs_render_aniso |
| 175 | func gs_proj_y(x: i64, y: i64, z: i64, sy4: i64, cy4: i64, R: i64) -> i64 called by 1: gs_render_aniso |
| 182 | func gs_render_aniso(gauss: *i64, ng: i64, yaw: i64, camz: i64, fb: *i64, acc: *i64, trans: *i64, depth: *i64, sxb: *i64, syb: *i64, pa: *i64, pb: *i64, pc: *i64, pdet: *i64, order: *i64, count: *i64, explut: *i64, bgr: i64, bgg: i64, bgb: i64) -> i64 |
| 322 | func gs_color_grad_step(gauss: *i64, ng: i64, target: *i64, yaw: i64, camz: i64, fb: *i64, acc: *i64, trans: *i64, depth: *i64, sxb: *i64, syb: *i64, sigb: *i64, order: *i64, count: *i64, explut: *i64, gradbuf: *i64, wnorm: *i64) -> i64 |
| 387 | func gs_w() -> i64 { return GW } |
| 388 | func gs_h() -> i64 { return GH } |
| 389 | func gs_expn() -> i64 { return GEXPN } |
| 390 | func gs_nb() -> i64 { return GNB } |