티클러 2025. 11. 6. 17:17

https://github.com/Forceflow/cuda_voxelizer

 

CUDA를 이용해서 빠른 시간안에 복셀화를 시켜주는 프로그램.. 물론 CPU도 지원..

Grid size GPU (GTX 1050 TI) CPU (Intel i7 8750H, 12 threads)
64³ 0.2 ms 39.8 ms
128³ 0.3 ms 63.6 ms
256³ 0.6 ms 118.2 ms
512³ 1.8 ms 308.8 ms
1024³ 8.6 ms 1047.5 ms
2048³ 44.6 ms 4147.4 ms
# generates a 256 x 256 x 256 vox-based voxel model which will be stored in bunny_256.vox.
$ cuda_voxelizer -f bunny.ply -s 256 

# generates a solid (filled) 64 x 64 x 64 .obj voxel model which will be stored in torus_64.obj.
$ cuda_voxelizer -f torus.ply -s 64 -o obj -solid

cuda_voxelizer_v0.6.zip
2.64MB

 

테스트해보니.. 잘됨.

$ cuda_voxelizer.exe -f bunny.obj -s 100 -o obj
## CUDA VOXELIZER
CUDA Voxelizer v0.6 by Jeroen Baert
https://github.com/Forceflow/cuda_voxelizer - mail (at) jeroen-baert (dot) be

## PROGRAM PARAMETERS
[Info] Filename: bunny.obj
[Info] Grid size: 100
[Info] Output format: obj file (cubes)
[Info] Using CPU-based voxelization: No (default: No)
[Info] Using Solid Voxelization: No (default: No)

## READ MESH
[I/O] Reading mesh from bunny.obj
[Mesh] Number of triangles: 22236
[Mesh] Number of vertices: 11120
[Mesh] Computing bbox

## VOXELISATION SETUP
[Voxelization] Bounding Box: (0.000288,-0.073080,-0.008127)-(0.627064,0.553695,0.618648)
[Voxelization] Grid size: 100 100 100
[Voxelization] Triangles: 22236
[Voxelization] Unit length: x: 0.006268 y: 0.006268 z: 0.006268

## CUDA INIT
[CUDA] CUDA device(s) found, picking best one
[CUDA] GPU Device 0: "Pascal" with compute capability 6.1
[CUDA] Best device: Quadro P1000
[CUDA] Available device memory: 3363 of 4095 MB

## TRIANGLES TO GPU TRANSFER
[Mesh] Allocating 781 KB of CUDA-managed UNIFIED memory for triangle data
[Mesh] Copy 22236 triangles to CUDA-managed UNIFIED memory
[Perf] Mesh transfer time to GPU: 164.6 ms
[Voxel Grid] Allocating 122 KB of CUDA-managed UNIFIED memory for Voxel Grid

## GPU VOXELISATION
[Perf] Voxelization GPU time: 0.1 ms

## FILE OUTPUT
[I/O] Writing data in obj voxels format to file bunny.obj_100_voxels.obj
[I/O] Writing to file: 0%...25%...50%...75%...100%
[I/O] Reordering / Optimizing mesh with Trimesh2
[I/O] Writing final mesh to file bunny.obj_100_voxels.obj

## STATS
[Perf] Total runtime: 4198.3 ms

 

개발자 커피 사줘야겠네..