Skip to content

mengtaiqi888/sdfgen

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Haxe 59.3%
  • GLSL 35.2%
  • JavaScript 3.0%
  • Shell 1.8%
  • Batchfile 0.7%