code wiki / (root) / nx_subdiv.nx

nx_subdiv.nx

buildroot/runtime/nx_subdiv.nx

5450 B137 linesdepth 3pulls 4 transitivereach 3 importersview sourcekind library
docsdependenciesstructsconstsfunctions

about

nx_subdiv.nx -- SUBDIVISION + DISPLACEMENT DETAIL (the Elara detail architecture, rung 1 of "8K/16K down to sensor level"): gland/pore-scale geometry cannot live in a base mesh -- you SUBDIVIDE the detail region (each level x4 triangles, midpoint dedup keeps it watertight) and DISPLACE vertices along their normals from a DETERMINISTIC DETAIL FIELD (position-hashed bump field: density/amplitude/seed = DATA -- the exact mechanical form of "Montgomery glands on an areola" or skin pores). Position-hashing (not index-hashing) makes shared vertices displace identically => NO CRACKS across subdivision levels or patch borders. ALL INTEGER on nx_mesh3. license_tier: ORIGINAL

dependencies 2 imports · 2 importers

nx_syscalls.nx nx_mesh3.nx nx_subdiv.nx nx_detail_gate.nx nx_loop_subdiv.nx

imports: nx_syscalls.nxnx_mesh3.nx

imported by: nx_detail_gate.nxnx_loop_subdiv.nx

structs

none

consts

10const K_MAGIC_374761393: i64 = 374761393
11const K_MAGIC_668265263: i64 = 668265263
12const K_MAGIC_2147483647: i64 = 2147483647
13const K_MAGIC_974634599: i64 = 974634599
14const K_MAGIC_1274126177: i64 = 1274126177

functions

16func sd_isqrt(v: i64) -> i64
called by 1: sd_normals
24func sd_getvert(mesh: i64, x: i64, y: i64, z: i64) -> i64
36func sd_subdivide(meshIn: i64, meshOut: i64) -> i64
61func sd_hash(x: i64, y: i64, z: i64, seed: i64) -> i64
called by 1: sd_displace
71func sd_normals(mesh: i64, nrm: *i64) -> i64
118func sd_displace(mesh: i64, density: i64, amp: i64, seed: i64, nrm: *i64) -> i64
called by 1: main calls 4: sd_normalsm3_hdrm3_vertsd_hash