Giter Site home page Giter Site logo

sdfgenerator's Introduction

GPU SDF Generator

GPU 3D signed distance field generator, written with DirectX 11 compute shader

Building

git clone --recursive https://github.com/AirGuanZ/SDFGenerator.git
cd SDFGenerator
mkdir build
cd build
cmake ..

Options

OPTION(D3D11SDF_BUILD_SAMPLE "build SDF sample"   ON)
OPTION(D3D11SDF_BUILD_CLI    "build SDF cli tool" ON)

Usage

./SDF-CLI.exe -i "./mesh.obj" -o "./output.txt" -r 128,128,128 -q 16 -s -50,-50,-50 -l 50,50,50 -g true
  • -i Input mesh filename (.obj, .stl, .ply)
  • -o Output text filename
  • -s Min point in SDF bounding box. format: x,y,z, or a single floating point value specifying all of them
  • -l Max point in SDF bounding box. format: x,y,z, or a single floating point value specifying all of them
  • -g (Optional) Use gpu or not. default value is true
  • -r (Optional) SDF resolution. format: width,height,depth, or a single integer specifying all of them. default value is 64
  • -q (Optional) Quality. number of rays for determining value sign. default value is 12

Output format

SDF-CLI writes generated values into a text file, using the following pseudocode:

file.write(width)  file.write(" ")
file.write(height) file.write(" ")
file.write(depth)  file.write(" ")
for z in [0, depth):
	for y in [0, height):
		for x in [0, width):
			file.write(SDF[x][y][z])
			file.write(" ")

SDF-Sample

A demo program using ray marching to visualize generated SDF.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.