armory3d / sdfgen

GPU-based SDF generator

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

sdfgen

Stand-alone GPU-based signed distance field generator from 3D triangle meshes. Used in Armory, written in Haxe and Kha.

Run

Takes mesh.obj file and outputs raw 50x50x50 (50x2500) volume of floats into out.bin. This volume can be loaded into a 3D texture using R32/R16 format.

git clone https://github.com/armory3d/sdfgen
cd sdfgen/build/krom

Windows

./run_windows.bat

Linux

./run_linux.sh

MacOS

./run_macos.sh

Viewer

A simple viewer is included. Copy resulting out.bin file into sdfgen/viewer/build/krom.

cd sdfgen/viewer/build/krom
./run_windows.bat
./run_macos.sh
./run_linux.sh

An included mesh.obj file:

Currently results into this:

Build

Node and Git required.

  1. Recursive clone
git clone --recursive https://github.com/armory3d/sdfgen
cd sdfgen
git submodule foreach --recursive git pull origin master
git pull origin master
  1. a) Compile Krom
node Kha/make krom
  1. b) Compile C++
node Kha/make --compile

References

This tool builds upon the works kindly shared in:

Tech

About

GPU-based SDF generator

License:MIT License


Languages

Language:Haxe 59.3%Language:GLSL 35.2%Language:JavaScript 3.0%Language:Shell 1.8%Language:Batchfile 0.7%