- Notifications
You must be signed in to change notification settings - Fork0
proof of concept signed distance DSL with a RVSDG based optimizer. Mirror of the same repository on GitLab.
License
Apache-2.0, MIT licenses found
Licenses found
SiebenCorgie/minisdf
Folders and files
Name | Name | Last commit message | Last commit date | |
---|---|---|---|---|
Repository files navigation
Proof of concept RVSDG based compiler for a simple SignedDistanceField language.
tree-sitter-minisdf
: The tree-sitter grammar and parser, if you get strange tree-sitter errors, change into that directory and call ´tree-sitter generate´
minisdf-ast
: AST implementation for MiniSDF. Can either be parsed from a file (using tree-sitter), or generated by a program.
minisdf-optimizer
: The RVSDG based optimizer /middle-end. Takes an AST and builds a RVSDG representation using basic lowlevel-ish operations.
minisdf-backend-spirv
: simple SPIR-V backend based onrspirv.
msdfc
:MiniSdfCompiler: Simple library that accepts a miniSDF compiler source file, or AST, and generates, if possible, a SPIR-V Binary.
The following example defines a field that subtracts smoothed-box from a unit box that repeats in the domain 4³.
The offset of the subtracted box is set by an externaloffset
parameter. Which can be animated through the callingshader.
field myfield(offset: vec3){ sub(){ repeat(4.0, 4.0, 4.0){ box(vec3(1.0, 1.0, 1.0)) } }{ translate(offset){ smooth(0.25){ box(vec3(1.0, 1.0, 2.0)) } } }}
Licensed under either of
- Apache License, Version 2.0, (LICENSE-APACHE orhttp://www.apache.org/licenses/LICENSE-2.0)
- MIT license (LICENSE-MIT orhttp://opensource.org/licenses/MIT)
at your option.
Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.
About
proof of concept signed distance DSL with a RVSDG based optimizer. Mirror of the same repository on GitLab.