code wiki / (root) / nx_gsplat.nx

nx_gsplat.nx

buildroot/runtime/nx_gsplat.nx

18546 B390 linesdepth 2pulls 3 transitivereach 8 importersview sourcekind librarytopic gsplat
docsdependenciesstructsconstsfunctions

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

nx_syscalls.nx nx_itrig.nx nx_gsplat.nx nx_gsplat_aniso_gate.nx nx_gsplat_elara_gate.nx nx_gsplat_face_gate.nx nx_gsplat_gate.nx nx_gsplat_optimize_gate.nx nx_gsplat_photofit_gate.nx nx_gsplat_showcase.nx nx_persongen_render_gate.nx

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

12const K_MAGIC_4096: i64 = 4096
13const K_MAGIC_3970: i64 = 3970
14const K_MAGIC_2000000000: i64 = 2000000000
15const K_MAGIC_65536: i64 = 65536
16const K_MAGIC_999999: i64 = 999999
18const GW: i64 = 512
19const GH: i64 = 384
20const GHW: i64 = 256
21const GHH: i64 = 192
22const GFOCAL: i64 = 586
23const GFX: i64 = 1024 // model-unit fixed point (matches sdf)
24const GEXPN: i64 = 176 // exp-LUT entries: k=0..175 -> u=k/16 in [0,11) (11σ² = past 3σ)
25const GNB: i64 = 2048 // depth-sort buckets

functions

27func 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 }
31func gs_build_explut(explut: *i64) -> i64
43func gs_clear(acc: *i64, trans: *i64) -> i64
52func 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
155func gs_set(gauss: *i64, i: i64, x: i64, y: i64, z: i64, sc: i64, r: i64, g: i64, b: i64, op: i64) -> i64
164func 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
169func gs_proj_x(x: i64, y: i64, z: i64, sy4: i64, cy4: i64, R: i64) -> i64
called by 1: gs_render_aniso
175func gs_proj_y(x: i64, y: i64, z: i64, sy4: i64, cy4: i64, R: i64) -> i64
called by 1: gs_render_aniso
182func 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
322func 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
called by 3: mainmainmain calls 1: gs_render
387func gs_w() -> i64 { return GW }
388func gs_h() -> i64 { return GH }
389func gs_expn() -> i64 { return GEXPN }
390func gs_nb() -> i64 { return GNB }