Skip to content

SVOX a fileformat for storing Voxel based position and color data

Notifications You must be signed in to change notification settings

HafiTheCat/SVOX

Repository files navigation

Smaller Vox files with SVOX

SVOX a fileformat for storing voxel based position and color data


The SVOX file format is based on MagicaVoxel's file format .vox which always includes the full color palette for any given amount of voxels. This can lead to the file containing unnecessary data (since the whole range of colors in the palette is often not needed). It can be especially impactful for transmitting smaller assets (which are usually < 256 Voxels) over a network.

Installation

// With npm
npm i svox

// With yarn
yarn add svox

// With pnpm
pnpm add svox

Usage

// CommonJS
const SVOX = require('svox');

// ESModules
import SVOX from 'svox';
// Takes an existing ArrayBuffer containing SVOX data and parses it to an object
SVOX.fromSVOX(file)

// Takes an existing ArrayBuffer containing VOX data and parses it to an object
SVOX.fromVOX(file)

// Takes an existing Object consisting of voxel and palette entries and converts it to SVOX binary data
SVOX.toSVOX(svoxGroup)

File structure

The file structure can be found here: check out filestructure

Changelog

Check out the Changelog

About

SVOX a fileformat for storing Voxel based position and color data

Resources

Stars

Watchers

Forks

Packages

No packages published