code wiki / _hdl_build / nx_shade.nx

nx_shade.nx

buildroot/runtime/_hdl_build/nx_shade.nx

4072 B88 linesdepth 2pulls 2 transitivereach 10 importersview sourcekind library
docsdependenciesstructsconstsfunctions

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

nx_syscalls.nx nx_shade.nx nx_arcade_render.nx nx_cast_gen.nx nx_char_gen.nx nx_char_scene.nx nx_game_scaffold.nx nx_game_scaffold_gate.nx nx_minigame_capstone_gate.nx nx_shade_gate.nx nx_vn_art.nx nx_zpng_test.nx

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

7func sh_rgb(r: i64, g: i64, b: i64) -> i64 { return (r & 0xff) | ((g & 0xff) << 8) | ((b & 0xff) << 16) }
8func sh_r(c: i64) -> i64 { return c & 0xff }
9func sh_g(c: i64) -> i64 { return (c >> 8) & 0xff }
10func sh_b(c: i64) -> i64 { return (c >> 16) & 0xff }
13func sh_edge(ax: i64, ay: i64, bx: i64, by: i64, cx: i64, cy: i64) -> i64
17func 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 }
20func sh_tri_gouraud(fb: *i64, w: i64, h: i64,
called by 2: mainmain calls 5: sh_edgesh_rsh_gsh_bsh_rgb
54func sh_tri_textured(fb: *i64, w: i64, h: i64, tex: *i64, ts: i64,
called by 1: main calls 1: sh_edge