├── .gitattributes
├── .github
├── FUNDING.yml
└── workflows
│ ├── ci.yml
│ └── release.yml
├── .gitignore
├── .gitmodules
├── .licensure.yml
├── .luaurc
├── .stylua.toml
├── Cargo.lock
├── Cargo.toml
├── LICENSE
├── README.md
├── all_nodes_test.bjk
├── blackjack_commons
├── Cargo.toml
└── src
│ ├── lib.rs
│ ├── math.rs
│ └── utils.rs
├── blackjack_engine
├── Cargo.toml
└── src
│ ├── engine_tests.rs
│ ├── gizmos.rs
│ ├── graph.rs
│ ├── graph
│ └── serialization.rs
│ ├── graph_interpreter.rs
│ ├── lib.rs
│ ├── lua_engine.rs
│ ├── lua_engine
│ ├── blackjack_utils.lua
│ ├── lua_stdlib.rs
│ ├── lua_stdlib
│ │ ├── lua_core_library.rs
│ │ ├── lua_documentation.rs
│ │ ├── lua_require_io.rs
│ │ └── runtime_types.rs
│ ├── node_library.lua
│ └── node_params.lua
│ ├── mesh.rs
│ ├── mesh
│ ├── halfedge.rs
│ ├── halfedge
│ │ ├── channels.rs
│ │ ├── compact_mesh.rs
│ │ ├── edit_ops.rs
│ │ ├── edit_ops
│ │ │ └── deprecated.rs
│ │ ├── gpu_buffer_generation.rs
│ │ ├── halfedge_lua_api.rs
│ │ ├── id_types.rs
│ │ ├── mappings.rs
│ │ ├── mesh_index_impls.rs
│ │ ├── primitives.rs
│ │ ├── selection.rs
│ │ ├── traversals.rs
│ │ └── wavefront_obj.rs
│ └── heightmap.rs
│ ├── prelude.rs
│ └── sync.rs
├── blackjack_godot
├── Cargo.toml
└── src
│ ├── godot_lua_io.rs
│ └── lib.rs
├── blackjack_lua
├── lib
│ ├── gizmo_helpers.lua
│ ├── priority_queue.lua
│ ├── table_helpers.lua
│ └── vector_math.lua
└── run
│ ├── .gitignore
│ └── core_nodes.lua
├── blackjack_macros
├── Cargo.toml
└── src
│ ├── blackjack_lua_module.rs
│ ├── blackjack_lua_module
│ └── fn_attr.rs
│ ├── lib.rs
│ └── utils.rs
├── blackjack_ui
├── Cargo.toml
├── assets
│ ├── bevel_edge_test_case_1.obj
│ ├── bevel_edge_test_case_2.mtl
│ ├── bevel_edge_test_case_2.obj
│ ├── debug
│ │ ├── arrow.mtl
│ │ ├── arrow.obj
│ │ ├── cylinder.obj
│ │ └── icosphere.obj
│ ├── matcap
│ │ ├── 2E763A_78A0B7_B3D1CF_14F209.png
│ │ ├── 304FB1_69A1EF_5081DF_5C8CE6.png
│ │ ├── 313131_BBBBBB_878787_A3A4A4.png
│ │ ├── 326666_66CBC9_C0B8AE_52B3B4.png
│ │ ├── 34352A_718184_50605E_6E6761.png
│ │ ├── A67362_36150C_5E2E1E_F6C3BF.jpg
│ │ ├── CREDITS.txt
│ │ ├── E8DEE1_B5A6AA_CCBCC1_C4BBBC.png
│ │ └── Perenyi-Midtgaard APLAS20.pdf
│ └── test.obj
└── src
│ ├── app_window.rs
│ ├── app_window
│ ├── gui_overlay.rs
│ └── input.rs
│ ├── application.rs
│ ├── application
│ ├── app_viewport.rs
│ ├── application_context.rs
│ ├── code_viewer.rs
│ ├── gizmo_ui.rs
│ ├── graph_editor.rs
│ ├── inspector.rs
│ ├── root_graph.rs
│ ├── root_ui.rs
│ ├── serialization.rs
│ ├── viewport_3d.rs
│ ├── viewport_3d
│ │ └── lerp.rs
│ └── viewport_split.rs
│ ├── cli_args.rs
│ ├── color_hex_utils.rs
│ ├── custom_widgets.rs
│ ├── custom_widgets
│ └── smart_dragvalue.rs
│ ├── egui_ext.rs
│ ├── graph.rs
│ ├── graph
│ ├── graph_interop.rs
│ └── node_graph.rs
│ ├── main.rs
│ ├── prelude.rs
│ ├── render_context.rs
│ ├── rendergraph.rs
│ └── rendergraph
│ ├── common.rs
│ ├── edge_wireframe_draw.wgsl
│ ├── face_draw.wgsl
│ ├── face_overlay_draw.wgsl
│ ├── face_routine.rs
│ ├── grid_routine.rs
│ ├── grid_shader.wgsl
│ ├── id_picking_routine.rs
│ ├── point_cloud_draw.wgsl
│ ├── point_cloud_routine.rs
│ ├── rend3_common.wgsl
│ ├── rend3_object.wgsl
│ ├── rend3_uniforms.wgsl
│ ├── rend3_vertex.wgsl
│ ├── shader_manager.rs
│ ├── utils.wgsl
│ ├── viewport_3d_routine.rs
│ └── wireframe_routine.rs
├── build_godot_plugin.sh
├── build_ldoc.sh
├── doc
├── images
│ ├── cube_primitive.png
│ ├── dissolve_edge.png
│ ├── drawings.excalidraw
│ ├── edge_divide.png
│ ├── edge_extrude.excalidraw
│ ├── edge_extrude.png
│ ├── navigate_edge_loop.png
│ ├── split_edge.png
│ └── split_vertex.png
├── resources
│ ├── blackjack.gif
│ ├── blackjack_gif2.gif
│ ├── blackjack_gif3.gif
│ ├── blackjack_gif4.gif
│ ├── blackjack_gif5.gif
│ ├── showcase.png
│ ├── showcase2.png
│ └── showcase3.png
└── why_lua.md
├── examples
├── EXAMPLES_LICENSE
├── box.bjk
├── stylised_sword.bjk
└── tp_cutter.bjk
├── godot_plugin
└── addons
│ └── blackjack_engine_godot
│ ├── BgaFileResource.gd
│ ├── BlackjackApi.gdns
│ ├── BlackjackInspectorPlugin.gd
│ ├── BlackjackJack.gd
│ ├── BlackjackPropertiesTweaker.gd
│ ├── BlackjackPropertiesTweaker.tscn
│ ├── ErrorLabel.gd
│ ├── ErrorLabel.tscn
│ ├── JackImportPlugin.gd
│ ├── ScalarProp.gd
│ ├── ScalarProp.tscn
│ ├── SelectionProp.gd
│ ├── SelectionProp.tscn
│ ├── StringProp.gd
│ ├── StringProp.tscn
│ ├── VectorProp.gd
│ ├── VectorProp.tscn
│ ├── blackjack_godot.gdnlib
│ ├── icon.png
│ ├── icon.png.import
│ ├── plugin.cfg
│ └── plugin.gd
├── ldoc.css
├── reinstall_godot_plugin.sh
└── test
└── test_mesh.obj
/.gitattributes:
--------------------------------------------------------------------------------
1 | *.png filter=lfs diff=lfs merge=lfs -text
2 | *.jpg filter=lfs diff=lfs merge=lfs -text
3 |
--------------------------------------------------------------------------------
/.github/FUNDING.yml:
--------------------------------------------------------------------------------
1 | # These are supported funding model platforms
2 |
3 | github: setzer22
4 | ko_fi: setzer22
5 |
6 | # patreon: # Replace with a single Patreon username
7 | # open_collective: # Replace with a single Open Collective username
8 | # tidelift: # Replace with a single Tidelift platform-name/package-name e.g., npm/babel
9 | # community_bridge: # Replace with a single Community Bridge project-name e.g., cloud-foundry
10 | # liberapay: # Replace with a single Liberapay username
11 | # issuehunt: # Replace with a single IssueHunt username
12 | # otechie: # Replace with a single Otechie username
13 | # lfx_crowdfunding: # Replace with a single LFX Crowdfunding project-name e.g., cloud-foundry
14 | # custom: # Replace with up to 4 custom sponsorship URLs e.g., ['link1', 'link2']
15 |
--------------------------------------------------------------------------------
/.github/workflows/ci.yml:
--------------------------------------------------------------------------------
1 | on:
2 | push:
3 | branches: [ main ]
4 | pull_request:
5 |
6 | name: CI
7 |
8 | env:
9 | # This is required to enable the web_sys clipboard API which egui_web uses
10 | # https://rustwasm.github.io/wasm-bindgen/api/web_sys/struct.Clipboard.html
11 | # https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html
12 | RUSTFLAGS: --cfg=web_sys_unstable_apis
13 |
14 | jobs:
15 | test:
16 | name: Run tests
17 | runs-on: ubuntu-latest
18 | steps:
19 | - uses: actions/checkout@v2
20 | - uses: actions-rs/toolchain@v1
21 | with:
22 | profile: minimal
23 | toolchain: stable
24 | override: true
25 | - uses: Swatinem/rust-cache@v2
26 | - run: sudo apt-get update; sudo apt-get install libgtk-3-dev
27 | - run: cargo test --all-features
28 |
29 | fmt:
30 | name: Rustfmt
31 | runs-on: ubuntu-latest
32 | steps:
33 | - uses: actions/checkout@v2
34 | - uses: actions-rs/toolchain@v1
35 | with:
36 | profile: minimal
37 | toolchain: stable
38 | override: true
39 | - uses: Swatinem/rust-cache@v2
40 | - run: rustup component add rustfmt; sudo apt-get update; sudo apt-get install libgtk-3-dev
41 | - uses: actions-rs/cargo@v1
42 | with:
43 | command: fmt
44 | args: --all -- --check
45 |
46 | clippy:
47 | name: Clippy
48 | runs-on: ubuntu-latest
49 | steps:
50 | - uses: actions/checkout@v2
51 | - uses: Swatinem/rust-cache@v2
52 | - uses: actions-rs/toolchain@v1
53 | with:
54 | profile: minimal
55 | toolchain: stable
56 | override: true
57 | - uses: Swatinem/rust-cache@v2
58 | - run: rustup component add clippy; sudo apt-get update; sudo apt-get install libgtk-3-dev
59 | - uses: actions-rs/cargo@v1
60 | with:
61 | command: clippy
62 | args: -- -D warnings
63 |
64 | license:
65 | name: License
66 | runs-on: ubuntu-latest
67 | steps:
68 | - uses: actions/checkout@v2
69 | - uses: Swatinem/rust-cache@v2
70 | - uses: actions-rs/toolchain@v1
71 | with:
72 | profile: minimal
73 | toolchain: stable
74 | override: true
75 | # NOTE: Licensure uses an inconsistent newline style in version 0.3.*
76 | - run: cargo install licensure --version "0.2.1"
77 | - run: ~/.cargo/bin/licensure --project --check
78 |
--------------------------------------------------------------------------------
/.github/workflows/release.yml:
--------------------------------------------------------------------------------
1 | name: Create new release
2 | on:
3 | push:
4 | tags:
5 | - v*
6 | jobs:
7 | linux-build:
8 | name: Build Blackjack for Linux
9 | runs-on: ubuntu-20.04
10 | steps:
11 | - uses: actions/checkout@v3
12 | with:
13 | branch: feature/release_ci
14 | repository: setzer22/blackjack
15 | lfs: true
16 | - uses: actions-rs/toolchain@v1
17 | with:
18 | profile: minimal
19 | toolchain: stable
20 | override: true
21 | - uses: Swatinem/rust-cache@v2
22 | - run: cargo build --release
23 | - run: ./build_godot_plugin.sh
24 | - run: |
25 | mkdir ./blackjack_linux
26 | cp ./target/release/blackjack_ui ./blackjack_linux
27 | chmod +x ./blackjack_linux/blackjack_ui
28 | cp -r ./blackjack_lua ./blackjack_linux
29 | - uses: actions/upload-artifact@v3
30 | with:
31 | name: blackjack-linux
32 | path: blackjack_linux
33 | - uses: actions/upload-artifact@v3
34 | with:
35 | name: blackjack-godot-base
36 | path: target/godot_plugin
37 |
38 | windows-build:
39 | name: Build Blackjack for Windows
40 | runs-on: windows-latest
41 | steps:
42 | - uses: actions/checkout@v3
43 | with:
44 | branch: feature/release_ci
45 | repository: setzer22/blackjack
46 | lfs: true
47 | - uses: actions-rs/toolchain@v1
48 | with:
49 | profile: minimal
50 | toolchain: stable
51 | override: true
52 | - uses: Swatinem/rust-cache@v2
53 | - run: cargo build --release
54 | - run: cargo build --release -p blackjack_godot
55 | - run: |
56 | mkdir ./blackjack_windows
57 | ls target/release
58 | cp ./target/release/blackjack_ui.exe ./blackjack_windows
59 | cp -r ./blackjack_lua ./blackjack_windows
60 | shell: bash
61 | - uses: actions/upload-artifact@v3
62 | with:
63 | name: blackjack-windows
64 | path: blackjack_windows/
65 | - uses: actions/upload-artifact@v3
66 | with:
67 | name: blackjack-godot-windows-lib
68 | path: target/release/blackjack_godot.dll
69 |
70 | macos-build:
71 | name: Build Blackjack for MacOS
72 | runs-on: macos-latest
73 | steps:
74 | - uses: actions/checkout@v3
75 | with:
76 | branch: feature/release_ci
77 | repository: setzer22/blackjack
78 | lfs: true
79 | - uses: actions-rs/toolchain@v1
80 | with:
81 | profile: minimal
82 | toolchain: stable
83 | override: true
84 | - uses: Swatinem/rust-cache@v2
85 | - run: cargo build --release
86 | - run: cargo build --release -p blackjack_godot
87 | - run: |
88 | mkdir ./blackjack_macos
89 | ls target/release/
90 | cp ./target/release/blackjack_ui ./blackjack_macos
91 | chmod +x ./blackjack_macos/blackjack_ui
92 | cp -r ./blackjack_lua ./blackjack_macos
93 | shell: bash
94 | - uses: actions/upload-artifact@v3
95 | with:
96 | name: blackjack-macos
97 | path: blackjack_macos/
98 | - uses: actions/upload-artifact@v3
99 | with:
100 | name: blackjack-godot-macos-lib
101 | path: target/release/libblackjack_godot.dylib
102 |
103 | create-release:
104 | name: Assemble packages and create release
105 | needs:
106 | - windows-build
107 | - linux-build
108 | - macos-build
109 | runs-on: ubuntu-latest
110 | steps:
111 | - uses: actions/checkout@v3
112 | - name: Get pushed tag
113 | run: echo "RELEASE_VERSION=${GITHUB_REF#refs/*/}" >> $GITHUB_ENV
114 | - name: Print tag
115 | run: echo The tag is $RELEASE_VERSION
116 |
117 | - name: Download editor executable (Linux)
118 | uses: actions/download-artifact@v3
119 | with:
120 | name: blackjack-linux
121 | path: blackjack_linux
122 | - name: Download editor executable (Windows)
123 | uses: actions/download-artifact@v3
124 | with:
125 | name: blackjack-windows
126 | path: blackjack_windows
127 | - name: Download editor executable (MacOS)
128 | uses: actions/download-artifact@v3
129 | with:
130 | name: blackjack-macos
131 | path: blackjack_macos
132 |
133 | - name: Package the editor zips
134 | run: |
135 | ls -lh
136 |
137 | # Package for Windows
138 | mv blackjack_windows blackjack-$RELEASE_VERSION-windows
139 | zip -r blackjack-$RELEASE_VERSION-windows.zip blackjack-$RELEASE_VERSION-windows
140 |
141 | # Package for Linux
142 | mv blackjack_linux blackjack-$RELEASE_VERSION-linux
143 | zip -r blackjack-$RELEASE_VERSION-linux.zip blackjack-$RELEASE_VERSION-linux
144 |
145 | # Package for MacOS
146 | mv blackjack_macos blackjack-$RELEASE_VERSION-macos
147 | zip -r blackjack-$RELEASE_VERSION-macos.zip blackjack-$RELEASE_VERSION-macos
148 |
149 | - name: Download godot plugin Base (Linux)
150 | uses: actions/download-artifact@v3
151 | with:
152 | name: blackjack-godot-base
153 | path: godot_plugin
154 | - name: Download godot plugin Windows dll
155 | uses: actions/download-artifact@v3
156 | with:
157 | name: blackjack-godot-macos-lib
158 | path: godot_plugin/addons/blackjack_engine_godot/
159 | - name: Download godot plugin MacOS dll
160 | uses: actions/download-artifact@v3
161 | with:
162 | name: blackjack-godot-windows-lib
163 | path: godot_plugin/addons/blackjack_engine_godot/
164 |
165 | - name: Package the godot plugin
166 | run: |
167 | ls -lh
168 | pushd godot_plugin
169 | zip -r ../blackjack-godot-plugin-$RELEASE_VERSION.zip *
170 | popd
171 | ls -lh
172 | ls -lh godot_plugin
173 |
174 | - name: Create a release draft
175 | run: |
176 | gh release create \
177 | --draft \
178 | $RELEASE_VERSION \
179 | blackjack-$RELEASE_VERSION-{windows,linux,macos}.zip \
180 | blackjack-godot-plugin-$RELEASE_VERSION.zip
181 | env:
182 | GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
183 |
184 |
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 | .idea/
2 | gen/
3 | target/
4 | .cargo/
5 | .vscode
6 |
--------------------------------------------------------------------------------
/.gitmodules:
--------------------------------------------------------------------------------
1 | [submodule "rend3"]
2 | path = rend3
3 | url = https://github.com/setzer22/rend3.git
4 |
--------------------------------------------------------------------------------
/.licensure.yml:
--------------------------------------------------------------------------------
1 | change_in_place: true
2 | excludes:
3 | - \.gitignore
4 | - .*lock
5 | - \.git/.*
6 | - \.licensure\.yml
7 | - README.*
8 | - LICENSE.*
9 | - .*\.(md|rst|txt)
10 | - priority_queue.lua
11 | licenses:
12 | - files: "(^.*\\.rs$|^.*\\.lua$|^.*\\.gd$)"
13 | ident: MPL-2.0
14 | authors:
15 | - name: setzer22 and contributors
16 | template: "Copyright (C) [year] [name of author]\n\n
17 |
18 | This Source Code Form is subject to the terms of the Mozilla Public
19 | License, v. 2.0. If a copy of the MPL was not distributed with this
20 | file, You can obtain one at https://mozilla.org/MPL/2.0/."
21 | comments:
22 | - columns: 70
23 | extensions:
24 | - rs
25 | commenter:
26 | type: line
27 | comment_char: "//"
28 | trailing_lines: 1
29 | - columns: 70
30 | extensions:
31 | - lua
32 | commenter:
33 | type: line
34 | comment_char: "--"
35 | trailing_lines: 1
36 | - columns: 70
37 | extensions:
38 | - gd
39 | commenter:
40 | type: line
41 | comment_char: "#"
42 | trailing_lines: 1
43 |
--------------------------------------------------------------------------------
/.luaurc:
--------------------------------------------------------------------------------
1 | {
2 | "languageMode": "strict",
3 | "globals": [
4 | "Blackjack",
5 | "vector",
6 | "Primitives",
7 | "Types",
8 | "Ops",
9 | "NodeLibrary"
10 | ]
11 | }
--------------------------------------------------------------------------------
/.stylua.toml:
--------------------------------------------------------------------------------
1 | line_endings = "Unix"
2 | indent_type = "Spaces"
3 | indent_width = 4
4 | column_width = 100
5 |
--------------------------------------------------------------------------------
/Cargo.toml:
--------------------------------------------------------------------------------
1 | [workspace]
2 | members = [
3 | "blackjack_commons",
4 | "blackjack_engine",
5 | "blackjack_ui",
6 | "blackjack_godot",
7 | "blackjack_macros",
8 | ]
9 |
10 | resolver = "2"
11 |
12 | # Image loading is too slow in debug mode. This compiles all dependencies with optimizations.
13 | [profile.dev.package."*"]
14 | opt-level = 3
15 |
16 |
17 | [patch.crates-io]
18 | # This is necessary until egui 0.20, because blackjack needs the changes from this PR:
19 | # https://github.com/emilk/egui/pull/2051
20 | egui = { git = "https://github.com/setzer22/egui", branch = "egui_0_19_plus_pr_2051" }
21 | egui-winit = { git = "https://github.com/setzer22/egui", branch = "egui_0_19_plus_pr_2051" }
22 | egui-wgpu = { git = "https://github.com/setzer22/egui", branch = "egui_0_19_plus_pr_2051" }
23 |
24 | # NOTE: These patches are only used for development, and should be left
25 | # commented out in any commits to the 'main' branch
26 | # egui_wgpu_backend = { path = "../egui_wgpu_backend" }
27 | # egui_winit_platform = { path = "../egui_winit_platform" }
28 | # egui_node_graph = { path = "../egui_node_graph/egui_node_graph", features = ["persistence"] }
29 | # egui = { path = "../egui/egui" }
30 | # egui-winit = { path = "../egui/egui-winit" }
31 | # egui-wgpu = { path = "../egui/egui-wgpu" }
32 | # rend3 = { path = "../rend3/rend3" }
33 | # rend3-routine = { path = "../rend3/rend3-routine" }
34 | # wavefront_rs = { path = "../wavefront_rs" }
35 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | > Your Rusty 🦀 procedural 3d modeler
6 |
7 | 
8 | 
9 |
10 | **ARCHIVED REPOSITORY** This repository is now archived because of a variety of technical and political reasons that made me loose my motivation to continue contributing to the Rust community in my free time.
11 |
12 | **Blackjack** is a procedural modelling application, following the steps of great tools like [Houdini](https://www.sidefx.com/) or [Blender's geometry nodes project](https://docs.blender.org/manual/en/latest/modeling/geometry_nodes/index.html). At its core, Blackjack is a simple node-driven interface where you can compose operations to create a 3d mesh in a non-destructive way.
13 |
14 |
15 | 
16 |
17 | 
18 | 
19 | 
20 |
21 |
22 |
23 | ## Features and goals
24 | Blackjack **does not aim to replace an industry powerhouse such as Houdini**. Instead, it aims to provide a less cluttered, more robust and user-friendly experience for a small subset of the features that make these tools a great fit in the world of game development and real-time simulations.
25 |
26 | Here are the main goals and philosophy behind blackjack, but note that this shows the direction where things are going, not their current state.
27 |
28 | - **Procedural polygonal modelling, first and foremost**: The main focus in Blackjack is the creation of low-poly procedural assets like the ones one would see in videogames. In particular, surface extraction of volumetric data is not among its goals.
29 | - **Flexible node-based interface:** Build complex node graphs, create reusable functions, and tweak every parameter in real-time!
30 | - **Integration with popular game engines:** Export your procedural assets as tiny programs and tweak their parameters at runtime by adding a simple library to your engine of choice.
31 | - **Error resilience, crash resistance:** When things go wrong, Blackjack will make an effort to *respect your time* as a user and not lose your work. Errors will be clearly communicated and fixing any bugs leading to a crash will take the highest priority.
32 |
33 | ## Install and usage
34 | > **Note**: A crates.io version cannot be published due to unreleased dependencies. Blackjack depends on the bleeding edge version of some crates and requires custom forks for some others. This situation may change once development stabilizes.
35 |
36 | Here are the steps in order to try out the early development version of Blackjack. Binaries and easier installation methods will be provided in the future. The steps below require a complete Rust toolchain using `cargo`, with a minimum supported Rust version (MSRV) of **1.62.0**.
37 |
38 | 1. Clone this repository, and make sure to download LFS files. In some systems, this may require separately installing a `git-lfs`[^1] package:
39 | ```bash
40 | git clone https://github.com/setzer22/blackjack
41 | git lfs install
42 | git lfs fetch --all
43 | git lfs pull
44 | ```
45 |
46 | [^1]: Linux users can install `git-lfs` with their distro's package manager (`apt install git-lfs` / `yum install git-lfs` / `pacman -S git-lfs`). MacOS users using homebrew can use `brew install git-lfs`. Other users should follow the [git-lfs install instructions](https://git-lfs.github.com/).
47 |
48 | 2. Install build dependencies. This may not cover everything, please file an issue or a pull request if you find anything missing:
49 | * Ubuntu/Debian: `sudo apt install libfontconfig-dev`
50 | * Arch Linux: `sudo pacman -S fontconfig`
51 | * Fedora: `sudo dnf install fontconfig-devel`
52 | > **Note**: The `fontconfig` native dependency is temporary, and will no longer be necessary once this upstream issue is fixed: https://github.com/rust-windowing/winit/issues/2373
53 |
54 | 3. From the same folder, run `cargo run --release --bin blackjack_ui` to launch Blackjack.
55 |
56 | ### Usage
57 | Some minimal usage instructions. Please do note that these can and will change frequently during early development:
58 |
59 | - The bottom section of the screen is the node graph.
60 | - Use right click to open the node selector. Find a node and spawn it by clicking on it. You can also use the search bar.
61 | - Nodes can be dragged around, and its widgets interacted with using the mouse.
62 | - Dragging the mouse between two nodes' ports will create a connection.
63 | - Use the 'Set active' button under a node to make it render to the screen.
64 |
65 | ## Tech stack
66 | Blackjack is built using Rust 🦀 and stands on the shoulders of giants. Here's a shout out to some great rust crates being used in this project:
67 |
68 | - [rend3](https://github.com/BVE-Reborn/rend3) is used for all rendering purposes.
69 | - [egui](https://github.com/emilk/egui) is used as the UI toolkit powering all 2d interaction.
70 | - [wgpu](https://github.com/gfx-rs/wgpu), as the base of `rend3`, is used for all custom visual effects.
71 | - [mlua](https://github.com/khvzak/mlua) is used to integrate [Luau](https://github.com/Roblox/luau) as an extension language.
72 |
73 | ## Tool Maturity
74 | Blackjack is still under active development. Many features are missing and are bound to change. For now, **no promises are made with regards to stability**, but API breakage will be considered only when absolutely necessary.
75 |
76 | ## Contributing
77 | Contributions are welcome! Before writing a PR, please get in touch by filing an issue 😄
78 |
79 |
80 |
--------------------------------------------------------------------------------
/blackjack_commons/Cargo.toml:
--------------------------------------------------------------------------------
1 | [package]
2 | name = "blackjack_commons"
3 | description = "A procedural, node-based modelling tool, made in Rust"
4 | homepage = "https://github.com/setzer22/blackjack"
5 | repository = "https://github.com/setzer22/blackjack"
6 | version = "0.1.0"
7 | edition = "2021"
8 | rust-version = "1.62"
9 | license = "MPL-2.0"
10 | keywords = ["gamedev", "3d", "modelling", "procedural"]
11 | authors = ["setzer22"]
12 |
13 | # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
14 |
15 | [dependencies]
16 | glam = { version = "0.21.2", features = ["serde", "bytemuck"] }
17 | smallvec = { version = "1.7.0", features = ["serde"] }
18 | itertools = "0.10"
19 | float-ord = "0.3.2"
--------------------------------------------------------------------------------
/blackjack_commons/src/lib.rs:
--------------------------------------------------------------------------------
1 | // Copyright (C) 2023 setzer22 and contributors
2 | //
3 | // This Source Code Form is subject to the terms of the Mozilla Public
4 | // License, v. 2.0. If a copy of the MPL was not distributed with this
5 | // file, You can obtain one at https://mozilla.org/MPL/2.0/.
6 |
7 | /// Some utility math types and conversions
8 | pub mod math;
9 |
10 | /// General utility methods and helper traits
11 | pub mod utils;
12 |
--------------------------------------------------------------------------------
/blackjack_commons/src/math.rs:
--------------------------------------------------------------------------------
1 | // Copyright (C) 2023 setzer22 and contributors
2 | //
3 | // This Source Code Form is subject to the terms of the Mozilla Public
4 | // License, v. 2.0. If a copy of the MPL was not distributed with this
5 | // file, You can obtain one at https://mozilla.org/MPL/2.0/.
6 |
7 | use std::ops::{Add, Mul, Sub};
8 |
9 | use float_ord::FloatOrd;
10 |
11 | #[derive(Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash)]
12 | pub struct Vec3Ord([FloatOrd; 3]);
13 |
14 | pub trait ToOrd
15 | where
16 | T: Eq + PartialEq + Ord + PartialOrd + std::hash::Hash + Copy,
17 | {
18 | fn to_ord(&self) -> T;
19 | }
20 |
21 | impl ToOrd for glam::Vec3 {
22 | fn to_ord(&self) -> Vec3Ord {
23 | Vec3Ord([FloatOrd(self.x), FloatOrd(self.y), FloatOrd(self.z)])
24 | }
25 | }
26 |
27 | pub trait ToVec {
28 | fn to_vec(&self) -> T;
29 | }
30 |
31 | impl ToVec for Vec3Ord {
32 | fn to_vec(&self) -> glam::Vec3 {
33 | glam::Vec3::new(self.0[0].0, self.0[1].0, self.0[2].0)
34 | }
35 | }
36 |
37 | pub fn lerp(start: T, end: T, t: f32) -> T
38 | where
39 | T: Copy + Add