{"id":13730655,"url":"https://github.com/mattatz/unity-voxel","last_synced_at":"2025-05-16T18:06:39.718Z","repository":{"id":41430494,"uuid":"70213295","full_name":"mattatz/unity-voxel","owner":"mattatz","description":"Mesh voxelization for Unity.","archived":false,"fork":false,"pushed_at":"2019-01-06T03:58:26.000Z","size":119657,"stargazers_count":1463,"open_issues_count":11,"forks_count":156,"subscribers_count":54,"default_branch":"master","last_synced_at":"2025-05-16T18:06:26.974Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"C#","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/mattatz.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2016-10-07T03:42:50.000Z","updated_at":"2025-05-14T08:28:24.000Z","dependencies_parsed_at":"2022-08-10T02:23:07.792Z","dependency_job_id":null,"html_url":"https://github.com/mattatz/unity-voxel","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mattatz%2Funity-voxel","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mattatz%2Funity-voxel/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mattatz%2Funity-voxel/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mattatz%2Funity-voxel/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mattatz","download_url":"https://codeload.github.com/mattatz/unity-voxel/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254582905,"owners_count":22095518,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-08-03T02:01:17.693Z","updated_at":"2025-05-16T18:06:39.699Z","avatar_url":"https://github.com/mattatz.png","language":"C#","readme":"unity-voxel\n=====================\n\nVoxelize mesh algorithm in Unity. (includes GPU and CPU voxelizers.)\n\n![Demo](https://raw.githubusercontent.com/mattatz/unity-voxel/master/Captures/Demo.gif)\n\n## GPUVoxelParticleSystem\n\n![GPUVoxelParticleSystem](https://raw.githubusercontent.com/mattatz/unity-voxel/master/Captures/GPUVoxelParticleSystem.gif)\n\nthe Demo for GPU Particle with geometry shader. (only tested on windows10 (GTX 1060))\n\nInspired by Keijiro Takahashi works⚡️ [StandardGeometryShader](https://github.com/keijiro/StandardGeometryShader) \u0026 [KvantSpray]( https://github.com/keijiro/KvantSpray)\n\n## GPUVoxelMosaic\n\n![GPUVoxelMosaicLevels](https://raw.githubusercontent.com/mattatz/unity-voxel/master/Captures/GPUVoxelMosaicLevels.gif)\n\n![GPUVoxelMosaic](https://raw.githubusercontent.com/mattatz/unity-voxel/master/Captures/GPUVoxelMosaic.gif)\n\nthe Demo to update the resolution of voxels in realtime. (only tested on windows10 (GTX 1060))\n\n## GPUVoxelSkinnedMesh\n\n![GPUVoxelSkinnedMesh](https://raw.githubusercontent.com/mattatz/unity-voxel/master/Captures/GPUVoxelSkinnedMesh.gif)\n\nSample a mesh from SkinnedRenderer in every frame and voxelize it in realtime.\n\nthe human model and animation from [asset store](https://assetstore.unity.com/packages/3d/animations/raw-mocap-data-for-mecanim-5330).\n\n## Usage\n\nwith GPU Voxelizer (recommended)\n```cs\nGPUVoxelData data = GPUVoxelizer.Voxelize(\n    voxelizer,  // ComputeShader (Voxelizer.compute)\n    mesh,       // a target mesh\n    64,         // # of voxels for largest AABB bounds\n    true        // flag to fill in volume or not; if set flag to false, sample a surface only\n);\n\n// build voxel cubes integrated mesh\nGetComponent\u003cMeshFilter\u003e().sharedMesh = VoxelMesh.Build(data.GetData(), data.UnitLength, useUV);\n\n// build 3D texture represent a volume by voxels.\nRenderTexture volumeTexture = GPUVoxelizer.BuildTexture3D(\n  voxelizer,\n  data,\n  texture,    // Texture2D to color voxels based on uv coordinates in voxels\n  RenderTextureFormat.ARGBFloat,\n  FilterMode.Bilinear\n);\n\n// need to release a voxel buffer\ndata.Dispose();\n```\n\nwith CPU Voxelizer\n```cs\n// Voxelize target mesh with CPU Voxelizer\n\nList\u003cVoxel\u003e voxels = CPUVoxelizer.Voxelize(\n    mesh,   // a target mesh\n    20      // # of voxels for largest AABB bounds\n);\n```\n\n## Compatibility\n\nTested on Unity 2018.3.0f2, windows10 (GTX 1060), macOS (metal, not compatible with GPU Particle Demo).\n\n## Sources\n\n- Triangle mesh voxelization / Wolfire Games Blog - http://blog.wolfire.com/2009/11/Triangle-mesh-voxelization\n\n- Möller–Trumbore intersection algorithm - https://en.wikipedia.org/wiki/M%C3%B6ller%E2%80%93Trumbore_intersection_algorithm\n\n- keijiro/StandardGeometryShader - https://github.com/keijiro/StandardGeometryShader\n\n- keijiro/KvantSpray - https://github.com/keijiro/KvantSpray\n\n- Post Processing Stack - https://www.assetstore.unity3d.com/jp/#!/content/83912\n","funding_links":[],"categories":["C#","Voxel"],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmattatz%2Funity-voxel","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmattatz%2Funity-voxel","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmattatz%2Funity-voxel/lists"}