Render MagicaVoxel .vox files with the Unity Visual Effect Graph
Unity 2019.1 or later.
This project uses the HDRP as that's the only way to get lit meshes in the VFX graph at present.
There are two VFX graphs and two example projects.
Volume: The simpler example. Converts each voxel into a pixel in a texture3D. This means even empty voxels are rendered (as transparent meshes)
Sprite: More efficient. The voxels are stored in a texture with rgb=xyx for position and the alpha channel storing an index into a separate pallette texture that provides the color information.
The latter scene file currently scans for files in the specified directory that match the given pattern. Check out the scene itself.
- MagicaVoxelUnity: https://github.com/darkfall/MagicaVoxelUnity
- Keijiro's Low Poly Shapes: https://github.com/keijiro/LowPolyShapes (and for huge amounts of inspiration)
- Sample vox files from: https://github.com/mikelovesrobots/mmmm