nx_render_core.nx
buildroot/runtime/nx_render_core.nx
about
nx_render_core.nx -- Implements a fixed-point 3D rendering core with matrix operations and perspective projection for both native and WebAssembly targets.
dependencies 0 imports · 13 importers
diagram shows first 10 each side; +0 more imports, +3 more importers in the complete lists below.
imports: none
imported by: nx_explode3d_gate.nxnx_flatraster_gate.nxnx_mechparts_gate.nxnx_meshlit_gate.nxnx_meshrender.nxnx_meshrender_gate.nxnx_meshview_wasm.nxnx_pets3d_wasm.nxnx_rc_probe.nxnx_skin_gate.nxnx_skinnorm_gate.nxnx_spec_gate.nxnx_wasm_explodelab.nx
structs
| none |
consts
| 2 | const RC_MAGIC_40500: i64 = 40500 |
| 3 | const RC_MAGIC_65536: i64 = 65536 |
| 4 | const RC_MAGIC_16777216: i64 = 16777216 |
| 5 | const RC_MAGIC_4096: i64 = 4096 |
| 6 | const RC_MAGIC_31599: i64 = 31599 |
| 7 | const RC_MAGIC_29874: i64 = 29874 |
| 8 | const RC_MAGIC_31183: i64 = 31183 |
| 9 | const RC_MAGIC_29647: i64 = 29647 |
| 10 | const RC_MAGIC_5101: i64 = 5101 |
| 11 | const RC_MAGIC_29671: i64 = 29671 |
| 12 | const RC_MAGIC_31719: i64 = 31719 |
| 13 | const RC_MAGIC_9359: i64 = 9359 |
| 14 | const RC_MAGIC_31727: i64 = 31727 |
| 15 | const RC_MAGIC_29679: i64 = 29679 |
| 27 | const RC_Q: i64 = 16384 |
| 28 | const RC_M4_ELEMS: i64 = 16 |
| 29 | const RC_Z_FAR: i64 = 16384000 |
functions
| 32 | func rc_identity_4x4(out: *i64) -> *i64 |
| 42 | func rc_translation_4x4(tx: i64, ty: i64, tz: i64, out: *i64) -> *i64 called by 14: mr_rendermv_rendermv_render_cubemv_skincube_xformmv_sphere_xformmv_render_mesh+8 calls 1: rc_identity_4x4 |
| 52 | func rc_perspective_cs(cos_h: i64, sin_h: i64, aspect_q14: i64, near_q14: i64, far_q14: i64, out: *i64) -> *i64 called by 12: mr_rendermv_rendermv_render_cubemv_skincube_xformmv_sphere_xformmv_render_mesh+6 calls 1: rc_identity_4x4 |
| 75 | func rc_sin_q14(deg: i64) -> i64 |
| 83 | func rc_cos_q14(deg: i64) -> i64 { return rc_sin_q14(deg + 90) } |
| 85 | func rc_mat4_mul(a: *i64, b: *i64, out: *i64) -> *i64 |
| 101 | func rc_mat4_vec4(m: *i64, v: *i64, out: *i64) -> *i64 |
| 114 | func rc_min3(a: i64, b: i64, c: i64) -> i64 { var m: i64 = a; if b < m { m = b } if c < m { m = c } return m } |
| 115 | func rc_max3(a: i64, b: i64, c: i64) -> i64 { var m: i64 = a; if b > m { m = b } if c > m { m = c } return m } |
| 116 | func rc_clamp(v: i64, lo: i64, hi: i64) -> i64 { if v < lo { return lo } if v > hi { return hi } return v } |
| 117 | func rc_same_sign_3(a: i64, b: i64, c: i64) -> i64 |
| 124 | func rc_clear(fb: *i64, w: i64, h: i64, color: i64) -> i64 |
| 130 | func rc_zclear(zb: *i64, w: i64, h: i64) -> i64 |
| 138 | func rc_triangle(fb: *i64, zb: *i64, w: i64, h: i64, tri: *i64) -> i64 called by 10: mainmr_rendermv_rendermv_render_meshmv_render_loaded_camb_tri+4 calls 4: rc_clamprc_min3rc_max3rc_same_sign_3 |
| 202 | func rc_triangle_flat(fb: *i64, zb: *i64, w: i64, h: i64, tri: *i64) -> i64 |
| 239 | func rc_isqrt(n: i64) -> i64 |
| 252 | func rc_pow_q14(base: i64, n: i64) -> i64 called by 1: rc_triangle_phong |
| 263 | func rc_triangle_phong(fb: *i64, zb: *i64, w: i64, h: i64, pb: *i64) -> i64 |
| 339 | func rc_texel(r: i64, g: i64, b: i64, u: i64, v: i64) -> i64 called by 1: rc_triangle_tex |
| 355 | func rc_triangle_tex(fb: *i64, zb: *i64, w: i64, h: i64, tri: *i64, baseR: i64, baseG: i64, baseB: i64, bright: i64) -> i64 |
| 408 | func rc_box_quad(fb: *i64, zb: *i64, sw: i64, sh: i64, corn: *i64, ia: i64, ib: i64, ic: i64, id: i64, col: i64, tri: *i64) -> i64 |
| 424 | func rc_draw_box(fb: *i64, zb: *i64, sw: i64, sh: i64, mvp: *i64, x0: i64, y0: i64, z0: i64, hx: i64, hy: i64, hz: i64, col: i64, hw: i64, hh: i64, scratch: *i64) -> i64 |
| 457 | func rc_draw_scene(fb: *i64, zb: *i64, sw: i64, sh: i64, mvp: *i64, ent: *i64, nent: i64, hw: i64, hh: i64, scratch: *i64) -> i64 |
| 468 | func rc_pow8(r: i64) -> i64 { var v: i64 = 1; var k: i64 = 0; while k < r { v = v * 8; k = k + 1 } return v } called by 1: rc_draw_digit |
| 469 | func rc_pow10(r: i64) -> i64 { var v: i64 = 1; var k: i64 = 0; while k < r { v = v * 10; k = k + 1 } return v } called by 1: rc_draw_number |
| 471 | func rc_fillrect(fb: *i64, fbw: i64, fbh: i64, x0: i64, y0: i64, rw: i64, rh: i64, col: i64) -> i64 |
| 484 | func rc_font3x5(d: i64) -> i64 called by 1: rc_draw_digit |
| 497 | func rc_draw_digit(fb: *i64, fbw: i64, fbh: i64, px: i64, py: i64, d: i64, col: i64, sc: i64) -> i64 |
| 515 | func rc_draw_number(fb: *i64, fbw: i64, fbh: i64, px: i64, py: i64, val: i64, col: i64, sc: i64) -> i64 |
| 528 | func rc_pixel(fb: *i64, w: i64, x: i64, y: i64) -> i64 { return fb[y * w + x] } |
| 529 | func rc_depth(zb: *i64, w: i64, x: i64, y: i64) -> i64 { return zb[y * w + x] } |