nx_cornell.nx
buildroot/runtime/nx_cornell.nx
about
nx_cornell.nx -- ★THE CORNELL BOX on the sovereign stack (field-evidence rung 3: the measured GI reference). A real
PATCH RADIOSITY solver -- Goral/Torrance/Greenberg/Battaile's own SIGGRAPH'84 method, for the very box they built:
red left wall, green right wall, white floor/ceiling/back, ceiling area light, two blocks. Patches gather B = E +
rho*Sum(F_ij*B_j) with point-to-patch form factors + BLOCK OCCLUSION (soft shadows); COLOR BLEEDING emerges from the
bounce, never painted. Axis-aligned block variant; coords shifted so the box centre is the origin (camera z=-camz).
All integer: F in Q16, radiosity B in milli, reflectance fx1024. license_tier: ORIGINAL
dependencies 2 imports · 2 importers
imports: nx_syscalls.nxnx_trimesh.nx
imported by: nx_cornell_dyn_gate.nxnx_cornell_gate.nx
structs
| none |
consts
| 9 | const COR_MAGIC_100000: i64 = 100000 |
| 10 | const COR_MAGIC_1024: i64 = 1024 |
| 11 | const COR_MAGIC_51472: i64 = 51472 |
| 12 | const COR_MAGIC_16384: i64 = 16384 |
| 13 | const COR_MAGIC_65536: i64 = 65536 |
| 14 | const COR_MAGIC_4096: i64 = 4096 |
| 16 | const COR_CAP: i64 = 700 |
functions
| 45 | func cor_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 } |
| 46 | func cor_alloc() -> i64 |
| 62 | func cor_addgrid(P: *i64) -> i64 |
| 98 | func cornell_build() -> i64 |
| 158 | func cor_seg_box(x0: i64, y0: i64, z0: i64, x1: i64, y1: i64, z1: i64, B: *i64) -> i64 called by 1: cor_occluded |
| 184 | func cor_boxes_init() -> i64 |
| 193 | func cor_occluded(x0: i64, y0: i64, z0: i64, x1: i64, y1: i64, z1: i64) -> i64 |
| 200 | func cornell_move_light(dx: i64, dz: i64) -> i64 called by 1: main |
| 207 | func cornell_move_tall(dx: i64) -> i64 called by 1: main |
| 217 | func cor_ff_pair(i: i64, j: i64) -> i64 |
| 240 | func cornell_formfactors() -> i64 |
| 253 | func cornell_ff_partial(from: i64, to: i64) -> i64 |
| 271 | func cornell_solve(iters: i64) -> i64 |
| 304 | func cor_np() -> i64 { return COR_NP } |
| 305 | func cor_b(i: i64, out: *i64) -> i64 { let BR: *i64=COR_BR as *i64; let BG: *i64=COR_BG2 as *i64; let BB: *i64=COR_BB as *i64; out[0]=BR[i]; out[1]=BG[i]; out[2]=BB[i]; return 0 } |
| 306 | func cor_center(i: i64, out: *i64) -> i64 { let CXp: *i64=COR_CX as *i64; let CYp: *i64=COR_CY as *i64; let CZp: *i64=COR_CZ as *i64; out[0]=CXp[i]; out[1]=CYp[i]; out[2]=CZp[i]; return 0 } |
| 308 | func cornell_tomesh(gain: i64) -> i64 |