Skip to content

mattatz/unity-voxel

Repository files navigation

unity-voxel

Voxelize mesh algorithm in Unity. (includes GPU and CPU voxelizers.)

Demo

GPUVoxelParticleSystem.scene

GPUVoxelParticleSystem

the Demo for GPU Particle with Geometry shader. (only tested on windows10 (GTX 1060))

Inspired by Keijiro Takahashi works⚡️ StandardGeometryShader & KvantSpray

Usage

with GPU Voxelizer (recommended)

GPUVoxelData data = GPUVoxelizer.Voxelize( voxelizer, // ComputeShader (Voxelizer.compute) mesh, // a target mesh 64 // # of voxels for largest AABB bounds ); // build voxel cubes integrated mesh GetComponent<MeshFilter>().sharedMesh = GPUVoxelizer.Build(data); // release a voxel buffer data.Dispose();

with CPU Voxelizer

// Voxelize target mesh with CPU Voxelizer List<Voxel> voxels = Voxelizer.Voxelize( mesh, // a target mesh 20 // # of voxels for largest AABB bounds );

Compatibility

tested on Unity 2017.0.3, windows10 (GTX 1060), macOS (metal).

Sources

About

Mesh voxelization for Unity.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published