Expand description
KV6 sprite type + the draw_sprite dispatcher.
Mirror of voxlap’s vx5sprite (voxlap5.h:63-79) plus the
drawsprite entry point (voxlap5.c:9818). For R6.1 the
dispatcher is a stub — just enough API surface for the host to
plumb a sprite reference through. R6.2-R6.4 fill in the actual
kv6 frustum-cull + per-voxel rasterization behind it.
Voxlap’s vx5sprite is a 64-byte struct:
point3d p; // position
int32_t flags; // bit 0: 0=normal shading
// bit 1: 0=kv6data, 1=kfatype (oracle uses 0)
// bit 2: 0=normal, 1=invisible
point3d s; // x-basis (kv6data.xsiz direction)
kv6data *voxnum; // (or kfatype *kfaptr if flag bit 1 set)
point3d h; // y-basis
int32_t kfatim;
point3d f; // z-basis
int32_t okfatim;For R6 we only handle kv6 sprites with flags = 0 (the four
oracle sprite poses all use this). KFA animation + the no-z and
invisible flags are deferred.
Structs§
- Draw
Target - Borrowed framebuffer + zbuffer the per-voxel rasterizer fills.
- Sprite
Lighting - Sprite lighting + colour state — the subset of voxlap’s
vx5global thatupdatereflectsreads. Built once per frame fromEnginestate and passed todraw_sprite.
Functions§
- draw_
sprite - draw_
sprites_ parallel - Draw a sprite into a framebuffer + z-buffer.
- sprite_
colmul - Build voxlap’s per-surface-normal colour-modulation table for a
sprite under the given lighting — the
kv6colmul[256](one packed u64 perVoxel::dir, four 16-bit channel multipliers) plus thekv6coladdbiasdraw_spriteadds. This is exactly the table the CPU rasteriser uses (update_reflects); exposed so other backends (the GPU sprite pass) can shade KV6 sprites with identical math rather than re-deriving voxlap’s lighting in a shader.