nx_gltf_export_material_candidate_t340.nx
buildroot/runtime/nx_gltf_export_material_candidate_t340.nx
about
nx_gltf_export.nx -- export a bestiary mesh as binary glTF (.glb), roadmap R7 / the VRM foundation. glTF 2.0
is THE modern interchange format (web three.js/babylon, Unity/Godot/Blender, and the container VRM extends for
riggable avatars). Extends the STL/OBJ export (nx_meshgen verts+tris) to a real scene-graph format: a JSON
chunk (scene/node/mesh/accessors) + a BIN chunk (float32 positions + uint32 indices). Positions are the fx1024
integer verts encoded as float32, with a node scale of 1/1024 so the imported mesh is correctly sized. v0 =
static mesh; the skeleton + skin + VRM humanoid extension are the next layer. license_tier: ORIGINAL
dependencies 5 imports · 2 importers
imports: nx_syscalls.nxnx_atomic_rewrite.nxnx_vecmath.nxnx_vnormals_lib.nxnx_glbnorm_lib.nx
imported by: nx_char_asset_material_candidate_t340.nxnx_gltf_skin_recipe_candidate_t340.nx
structs
| none |
consts
| 12 | const K_MAGIC_8192: i64 = 8192 |
| 157 | const GL_MAT_R:i64=0 |
| 158 | const GL_MAT_G:i64=1 |
| 159 | const GL_MAT_B:i64=2 |
| 160 | const GL_MAT_METALLIC:i64=3 |
| 161 | const GL_MAT_ROUGHNESS:i64=4 |
| 162 | const GL_MAT_WORDS:i64=5 |
| 163 | const GL_MAT_IO_RC_BASE:i64=-100 |
| 164 | const GL_MAT_LINEAR_Q:i64=100000 |
| 165 | const GL_MAT_RATIO_Q:i64=1000 |
functions
| 15 | func gl_i2f32(v: i64) -> i64 |
| 29 | func gl_wr32(buf: *u8, o: i64, v: i64) -> i64 |
| 33 | func gl_cat(d: *u8, o: i64, s: *u8) -> i64 { var i: i64=0; while s[i]!=(0 as u8){d[o+i]=s[i]; i=i+1} return o+i } |
| 34 | func gl_num(d: *u8, o: i64, v: i64) -> i64 |
| 63 | func gl_vnormals(vbuf: *i64, fbuf: *i64, nv: i64, nf: i64, nrm: *i64) -> i64 |
| 70 | func write_glb_colored(vbuf: *i64, fbuf: *i64, cbuf: *i64, nv: i64, nf: i64, path: *u8) -> i64 |
| 166 | func gl_material_ok(m:*i64,words:i64)->i64 called by 1: write_glb_material |
| 172 | func gl_material_decimal(out:*u8,pos:i64,value:i64,q:i64)->i64 |
| 176 | func gl_material_json(out:*u8,pos:i64,m:*i64)->i64 |
| 184 | func gl_write_glb_scalar(vbuf: *i64, fbuf: *i64, nv: i64, nf: i64, path: *u8, material:*i64) -> i64 called by 2: write_glbwrite_glb_material calls 14: sys_mmapgl_vnormalsgl_wr32gl_i2f32gn_unit3gn_f32+8 |
| 277 | func write_glb(vbuf:*i64,fbuf:*i64,nv:i64,nf:i64,path:*u8)->i64{return gl_write_glb_scalar(vbuf,fbuf,nv,nf,path,0 as *i64)} |
| 279 | func write_glb_material(vbuf:*i64,fbuf:*i64,nv:i64,nf:i64,material:*i64,words:i64,path:*u8)->i64 called by 2: char_write_glb_skin_recipewrite_glb_skin_recipe calls 2: gl_material_okgl_write_glb_scalar |