code wiki / _hdl_build / nx_shade.nx
nx_shade.nx
buildroot/runtime/_hdl_build/nx_shade.nx
about
nx_shade.nx -- P1 VISUALIZATION: RGB GOURAUD shading + TEXTURE mapping (barycentric), writing to a
packed-RGB framebuffer (fb[y*w+x] = R | G<<8 | B<<16) ready for nx_png.write_png. Extends the existing
single-channel shaded raster to full per-vertex RGB interpolation + per-vertex UV texture sampling.
Pure integer (Pineda edge functions). 100% sovereign. license_tier: ORIGINAL
dependencies 1 imports · 10 importers
imports: nx_syscalls.nx
imported by: nx_arcade_render.nxnx_cast_gen.nxnx_char_gen.nxnx_char_scene.nxnx_game_scaffold.nxnx_game_scaffold_gate.nxnx_minigame_capstone_gate.nxnx_shade_gate.nxnx_vn_art.nxnx_zpng_test.nx
structs
| none |
consts
| none |
functions
| 7 | func sh_rgb(r: i64, g: i64, b: i64) -> i64 { return (r & 0xff) | ((g & 0xff) << 8) | ((b & 0xff) << 16) } |
| 8 | func sh_r(c: i64) -> i64 { return c & 0xff } |
| 9 | func sh_g(c: i64) -> i64 { return (c >> 8) & 0xff } |
| 10 | func sh_b(c: i64) -> i64 { return (c >> 16) & 0xff } |
| 13 | func sh_edge(ax: i64, ay: i64, bx: i64, by: i64, cx: i64, cy: i64) -> i64 |
| 17 | func sh_clear(fb: *i64, w: i64, h: i64, c: i64) -> i64 { var i: i64=0; while i < w*h { fb[i]=c; i=i+1 } return 0 } |
| 20 | func sh_tri_gouraud(fb: *i64, w: i64, h: i64, |
| 54 | func sh_tri_textured(fb: *i64, w: i64, h: i64, tex: *i64, ts: i64, |