Blackjack is a procedural modelling application, following the steps of great tools like Houdini or Blender's geometry nodes project

Overview

Blackjack

Your Rusty 🦀 procedural 3d modeler

Latest version Documentation MIT

Blackjack is a procedural modelling application, following the steps of great tools like Houdini or Blender's geometry nodes project. 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.

Gif showcasing procedural modelling in Blackjack Another gif showcasing procedural modelling in Blackjack

Features and goals

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.

Here are the main goals and philosophy behind blackjack, but note that this shows the direction where things are going, not their current state.

  • 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.
  • Flexible node-based interface: Build complex node graphs, create reusable functions, and tweak every parameter in real-time!
  • 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.
  • 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.

Install and usage

Note: A crates.io version will be published shortly, but it's not possible yet due to unpublished dependencies.

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:

  1. Clone this repository, and make sure to clone its submodules:
git clone https://github.com/setzer22/blackjack
git submodule update --init --recursive
  1. From the same folder, run cargo run to launch Blackjack.

Usage

Some minimal usage instructions. Please do note that these can and will change frequently during early development:

  • The bottom section of the screen is the node graph.
  • 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.
  • Nodes can be dragged around, and its widgets interacted with using the mouse.
  • Dragging the mouse between two nodes' ports will create a connection.
  • Use the 'Set active' button under a node to make it render to the screen.

Tech stack

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:

  • rend3 is used for all rendering purposes.
  • egui is used as the UI toolkit powering all 2d interaction.
  • wgpu, as the base of rend3, is used for all custom visual effects.

Tool Maturity

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.

Contributing

Contributions are welcome! Before writing a PR, please get in touch by filing an issue 😄

Comments
  • Availability of Graph Node Editor

    Availability of Graph Node Editor

    Hi!

    Wow, this project looks really cool! Great work

    I've been on the lookout for a graph node editor, similar to the one implemented in this project. It is intended for a server routing network traffic for stage lighting protocols.

    Is there any way of re-using the graph editor from this project? Is there any chance that the graph editor might be separated into its own crate in the future?

    opened by jostlowe 10
  • Add `MPL-2.0` SPDX identifier and missing Cargo metadata

    Add `MPL-2.0` SPDX identifier and missing Cargo metadata

    Changes:

    • replaces some occurrences of "MIT" with "MPL-2.0" (see SPDX identifier)
    • adds missing metadata to each crate
    • uses same order for fields everywhere
    opened by Bromeon 7
  • Impossible to zoom and hard to trigger click

    Impossible to zoom and hard to trigger click

    I tried blackjack on my MacBook Pro 13' M1 and found out that it was impossible to zoom by using the "roulette wheel" i.e. on my trackpad and pretty hard to trigger the right-click menu I found this related issue #1 but it doesn't seem to be entirely fixed.

    opened by Kerollmops 7
  • Godot plugin no longer works with Godot 3.5

    Godot plugin no longer works with Godot 3.5

    Godot 3.5 was released today and it seems the way how the plugin exported properties to Godot inspector no longer works or something else changed. Jack Property, Show Gui and Material Slot no longer show up. With the version 3.4.5 it works fine and all properties are shown. I tried it with the plugin and libblackjack_godot.so compiled from the latest main on Arch Linux.

    bug 
    opened by novhack 6
  • Update egui to 0.19

    Update egui to 0.19

    Update:

    • egui 0.18 -> 0.19
    • glam 0.20 -> 0.21.2
    • wgpu 0.12 -> 0.13
    • winit 0.26 -> 0.27.2
    • rend3 1b6cac4 -> dbdfc32
    • egui_node_graph 54ae2dc -> 75308d0

    And update the code to account for API changes.

    No more need for custom egui_wgpu/egui_winit fork!

    The only issue I see now is that at high levels of zoom there are warnings at console stating: epaint: WARNING: pixels_per_point (dpi scale) have changed between text layout and tessellation. You must recreate your text shapes if pixels_per_point changes.

    Seems that this check appeared in epaint between 0.18 and 0.19, so that blackjack with egui-0.18 just didn't show it, as the line that produces this warning is this one. I didn't touch it, but if I remove it the warning disappears (but everything gets somewhat blurry on zoom 0.5 and too crisp on zoom > 1).

    opened by inact1v1ty 5
  • Error: `free(): double free detected in tcache 2`

    Error: `free(): double free detected in tcache 2`

    Hi There, when i try to run the app as described in the readme, it throws:

    $ RUST_BACKTRACE=1 cargo run --bin blackjack_ui
        Finished dev [unoptimized + debuginfo] target(s) in 0.13s
         Running `target/debug/blackjack_ui`
    free(): double free detected in tcache 2
    Aborted (core dumped)
    

    Do you have any tip how should i fix this? This project looks amazing, and i'd love to try it out!

    Ubuntu 22.04 rustc 1.64.0 (a55dd71d5 2022-09-19)

    opened by azazdeaz 4
  • Just a question: why lua ?

    Just a question: why lua ?

    I have been playing with blackjack and trying to understand its code base and I have to say that each part of it (node editor, half edge operations, polyasm compiler) is mind blowing brilliant and inspirational for lots of other use cases beside of 3d modeling. So I noticed your latest commit is a lua scripting engine. I played myself with with rhai and thought that would be the natural first choice when there are no special requirements. So why are you experimenting with lua ? Is it faster or otherwise better than your polyasm compiler ? Or do you consider to expose the lua source script AND the node graph in editable form to the user ?

    opened by rsaccon 4
  • Small interface on MacBook Pro

    Small interface on MacBook Pro

    I am on a MacBook Pro 13.3' which has a high resolution i.e. 2560×1600. I read in the documentation of winit that you should decorrelate window size and resolution.

    opened by Kerollmops 4
  • Index out of bounds panic with

    Index out of bounds panic with "Extrude faces" node

    Problem

    The program panics with an "index out of bounds" in src/mesh/halfedge.rs:714:73.

    How to reproduce

    Chain the following nodes:

    • Box
    • Bevel edges 1, 4
    • Extrude face 8

    In the image below, as soon as 7 is changed into 8 in the "Extrude faces" node the panic occurs.

    bug

    Backtrace

    thread 'main' panicked at 'index out of bounds: the len is 2 but the index is 2', src/mesh/halfedge.rs:714:73
    stack backtrace:
       0: rust_begin_unwind
                 at /rustc/e012a191d768adeda1ee36a99ef8b92d51920154/library/std/src/panicking.rs:498:5
       1: core::panicking::panic_fmt
                 at /rustc/e012a191d768adeda1ee36a99ef8b92d51920154/library/core/src/panicking.rs:107:14
       2: core::panicking::panic_bounds_check
                 at /rustc/e012a191d768adeda1ee36a99ef8b92d51920154/library/core/src/panicking.rs:75:5
       3: <usize as core::slice::index::SliceIndex<[T]>>::index
                 at /rustc/e012a191d768adeda1ee36a99ef8b92d51920154/library/core/src/slice/index.rs:189:10
       4: core::slice::index::<impl core::ops::index::Index<I> for [T]>::index
                 at /rustc/e012a191d768adeda1ee36a99ef8b92d51920154/library/core/src/slice/index.rs:15:9
       5: <smallvec::SmallVec<A> as core::ops::index::Index<I>>::index
                 at /home/.../.cargo/registry/src/github.com-1ecc6299db9ec823/smallvec-1.8.0/src/lib.rs:1703:10
       6: blackjack_nodes::mesh::halfedge::HalfEdgeMesh::face_normal
                 at ./src/mesh/halfedge.rs:714:73
       7: blackjack_nodes::mesh::halfedge::edit_ops::extrude_faces
                 at ./src/mesh/halfedge/edit_ops.rs:871:24
       8: blackjack_nodes::graph::poly_asm::PolyAsmProgram::execute_instruction
                 at ./src/graph/poly_asm.rs:285:17
       9: blackjack_nodes::graph::poly_asm::PolyAsmProgram::execute
                 at ./src/graph/poly_asm.rs:332:13
      10: blackjack_nodes::app_window::AppWindow::compile_and_execute_program
                 at ./src/app_window.rs:154:20
      11: blackjack_nodes::app_window::AppWindow::on_main_events_cleared
                 at ./src/app_window.rs:199:32
      12: blackjack_nodes::app_window::AppWindow::run_app::{{closure}}
                 at ./src/app_window.rs:255:45
      13: winit::platform_impl::platform::sticky_exit_callback
                 at /home/.../.cargo/registry/src/github.com-1ecc6299db9ec823/winit-0.26.1/src/platform_impl/linux/mod.rs:753:5
      14: winit::platform_impl::platform::x11::EventLoop<T>::run_return
                 at /home/.../.cargo/registry/src/github.com-1ecc6299db9ec823/winit-0.26.1/src/platform_impl/linux/x11/mod.rs:293:17
      15: winit::platform_impl::platform::x11::EventLoop<T>::run
                 at /home/.../.cargo/registry/src/github.com-1ecc6299db9ec823/winit-0.26.1/src/platform_impl/linux/x11/mod.rs:392:9
      16: winit::platform_impl::platform::EventLoop<T>::run
                 at /home/.../.cargo/registry/src/github.com-1ecc6299db9ec823/winit-0.26.1/src/platform_impl/linux/mod.rs:669:56
      17: winit::event_loop::EventLoop<T>::run
                 at /home/.../.cargo/registry/src/github.com-1ecc6299db9ec823/winit-0.26.1/src/event_loop.rs:154:9
      18: blackjack_nodes::app_window::AppWindow::run_app
                 at ./src/app_window.rs:229:9
      19: blackjack_nodes::main
                 at ./src/main.rs:33:5
      20: core::ops::function::FnOnce::call_once
                 at /rustc/e012a191d768adeda1ee36a99ef8b92d51920154/library/core/src/ops/function.rs:227:5
    
    opened by FedericoStra 4
  • Error on build:

    Error on build: "could not find system library 'fontconfig' required by the 'servo-fontconfig-sys' crate"

    I get an error running following the instructions in the readme, installing the missing dependency with sudo apt install libfontconfig-dev fixes the error. I'll put in a PR to add that to the readme, but adding here to document it and maybe you know of a way to avoid the extra step. Full error is below:

    error: failed to run custom build command for `servo-fontconfig-sys v5.1.0`
    
    Caused by:
      process didn't exit successfully: `/home/henry/workspace/blackjack/target/debug/build/servo-fontconfig-sys-2618e6ca9957a126/build-script-build` (exit status: 101)
      --- stdout
      cargo:rerun-if-env-changed=FONTCONFIG_NO_PKG_CONFIG
      cargo:rerun-if-env-changed=PKG_CONFIG_x86_64-unknown-linux-gnu
      cargo:rerun-if-env-changed=PKG_CONFIG_x86_64_unknown_linux_gnu
      cargo:rerun-if-env-changed=HOST_PKG_CONFIG
      cargo:rerun-if-env-changed=PKG_CONFIG
      cargo:rerun-if-env-changed=FONTCONFIG_STATIC
      cargo:rerun-if-env-changed=FONTCONFIG_DYNAMIC
      cargo:rerun-if-env-changed=PKG_CONFIG_ALL_STATIC
      cargo:rerun-if-env-changed=PKG_CONFIG_ALL_DYNAMIC
      cargo:rerun-if-env-changed=PKG_CONFIG_PATH_x86_64-unknown-linux-gnu
      cargo:rerun-if-env-changed=PKG_CONFIG_PATH_x86_64_unknown_linux_gnu
      cargo:rerun-if-env-changed=HOST_PKG_CONFIG_PATH
      cargo:rerun-if-env-changed=PKG_CONFIG_PATH
      cargo:rerun-if-env-changed=PKG_CONFIG_LIBDIR_x86_64-unknown-linux-gnu
      cargo:rerun-if-env-changed=PKG_CONFIG_LIBDIR_x86_64_unknown_linux_gnu
      cargo:rerun-if-env-changed=HOST_PKG_CONFIG_LIBDIR
      cargo:rerun-if-env-changed=PKG_CONFIG_LIBDIR
      cargo:rerun-if-env-changed=PKG_CONFIG_SYSROOT_DIR_x86_64-unknown-linux-gnu
      cargo:rerun-if-env-changed=PKG_CONFIG_SYSROOT_DIR_x86_64_unknown_linux_gnu
      cargo:rerun-if-env-changed=HOST_PKG_CONFIG_SYSROOT_DIR
      cargo:rerun-if-env-changed=PKG_CONFIG_SYSROOT_DIR
    
      --- stderr
      thread 'main' panicked at '`"pkg-config" "--libs" "--cflags" "fontconfig" "fontconfig >= 2.11.1"` did not exit successfully: exit status: 1
      error: could not find system library 'fontconfig' required by the 'servo-fontconfig-sys' crate
    
      --- stderr
      Package fontconfig was not found in the pkg-config search path.
      Perhaps you should add the directory containing `fontconfig.pc'
      to the PKG_CONFIG_PATH environment variable
      No package 'fontconfig' found
      Package fontconfig was not found in the pkg-config search path.
      Perhaps you should add the directory containing `fontconfig.pc'
      to the PKG_CONFIG_PATH environment variable
      No package 'fontconfig' found
      ', /home/henry/.cargo/registry/src/github.com-1ecc6299db9ec823/servo-fontconfig-sys-5.1.0/build.rs:34:17
    
    opened by HenryWConklin 3
  • Ability to have an existing file as an input

    Ability to have an existing file as an input

    I've been experimenting with this software for a few days and so far I've been loving it.

    I ventured into how nodes are made in Lua and been wondering if there is a way to use an existing file as an input. So far I found out that "file" type is for now only meant for saving files since it opens "save" system dialog via rfd::FileDialog::new().save_file().

    An ability to change a "mode" of file inputs to "save" or "open" would help me a lot because I would like to make a custom node which reads a pre-generated list of 2D positions from a file.

    opened by novhack 3
  • Proof of concept of using Godot for UI

    Proof of concept of using Godot for UI

    This is but a proof of concept made during the weekend in Godot 3.5.

    • uses GDScript instead of GDNative
    • uses a different data structure
    • the layout/format of the GUI is slightly different (e.g. the spreadsheet is a popup panel instead of a constant panel at the top, the displayed data is not the IDs but the positions, the model is only shown after clicking a button - this is to gain more space for the graph itself)
    • basically a MRP, only two nodes are really implemented (a quad and a transform)
    • only one input and one output work for now

    When making the PRs, I found that even for a little PR that amounted to adding a wrapper function in Rust and editing the Lua file, compilation was significantly slow on my Dell Vostro 5581 (enough that I'd tab away to do something else while waiting for it to be done - something around 10, maybe 15 seconds) I strongly suspect this is due to the amount of dependencies, when I first ran the project the part of getting and compiling all the crates was really long, I think the number quoted was around 150-ish Using Godot for the GUI would significantly cut down on them (wgpu, egui, rend3, fontconfig package).

    WASM is also an option for Godot so this would not block #14

    Even if this is not accepted (at least not accepted in the immediate future) I plan to use this little project to brainstorm things like #70 and #55 and also subgraphing (combining two or more nodes to e.g. save space or to use them in combination with a loop - see #70 )

    GraphTest.zip

    opened by Zireael07 5
  • Flow control nodes (mostly for game engine integration)

    Flow control nodes (mostly for game engine integration)

    Things like

    • do the following nodes X times
    • execute the next node(s) only if boolean input is true/if scalar input is more than Y etc.

    especially the second one would allow using the same blackjack file for e.g. buildings with optional parts like overhangs, roofs, vents (probably in conjunction with importing from other file #53 or subgraphs)

    opened by Zireael07 5
  • Some usability issues

    Some usability issues

    1. Can't figure out how to use bridge loops even on a simple cube, every edge I try ends up with a traceback saying it's not in a boundary
    2. Can't subdivide/split a face ~~or an edge~~, just the whole mesh (EDIT: I see we have cut_edge and divide_face implemented but they're not exposed to the UI) EDIT: The latter is now done in a PR I sent

    ~~3) Mesh view can't be zoomed or at least I haven't figured out to do so EDIT: seems that it's because I don't have a mouse, just a touchpad, so no mousewheel events here :P~~ EDIT: solved, dummy me forgot how to do scrolling on a touchpad

    1. Can't click on an edge to get its number/click on spreadsheet number to highlight edge - the only way I can figure out which is which for something more complex is the debug pane
    2. Related, would be nice to be able to drag from spreadsheet to node to fill in the input box
    3. Can't copy graph nodes
    opened by Zireael07 11
  • More geometry primitives

    More geometry primitives

    A few common shapes are bit tricky to create with the existing nodes, it would be nice to have more built-in geometry primitives. Matching the primitives in Blender would be a good starting point.

    • [x] Cylinder
    • [x] Cone/truncated cone
    • [x] Filled in circle/regular N-gon (possibly as an option on the Circle node)
    • [x] Catenary curves (for hanging ropes/wires)
    • [x] Icosphere
    • [ ] Capsule
    opened by HenryWConklin 5
  • Array inputs

    Array inputs

    Some nodes like "Merge meshes" would really benefit from having just one input array (in this case an array of meshes). Blender geometry nodes have this feature and indicate it with a "pill" slot. image

    opened by novhack 4
  • "Import Jack" node

    I really love the latest work that has been done on Blackjack. I think it's currently missing an ability to import one blackjack project as a node to a different blackjack project. I think the most straightforward approach would be to use Jack files and expose their promoted parameters as inputs.

    Since it introduces dependencies it would be cool if it was then possible to export Jack files which would bundle in all other Jack files which were imported. Or maybe include relative paths to those Jack files.

    opened by novhack 4
Owner
null
Following along with the Geometry Processing with Intrinsic Triangulations course in Rust.

Intrinsic Triangulations in Rust In this repo is code I wrote following along with the Nicholas Sharp, Mark Gillespie, Keenan Crane's course on geomet

Lukas Hermann 8 Nov 16, 2021
The main repo for manta relay nodes and manta parachain nodes

Manta Manta is a privacy preserving DeFi stack on Polkadot/Substrate. The code currently hasn't been properly security audited (work in progress), use

Manta Network 94 Nov 26, 2022
A repo to store all my 6-Month Rust learning steps

RustLearn A repo to store all my 6-Month Rust learning steps. (free time only!) at the end of the 6-month course, the repo will be a rust package for

Muasya 2 May 16, 2022
Rust starter project for building CLI and libraries, with great CI

Using the starter project: find where bumblefoot is and replace it with the name of your project. $ rg bumblefoot This is a dual library and binary pr

Rusty Ferris Club 19 Nov 19, 2022
Computational Geometry library written in Rust

RGeometry Computational Geometry in Rust! What is RGeometry? RGeometry is a collection of data types such as points, polygons, lines, and segments, an

null 100 Nov 13, 2022
ARIMA modelling for Rust

ARIMA Rust crate for ARIMA model coefficient estimation and simulation. Example extern crate rand; use rand::prelude::*; use rand::distributions::{Nor

Kai Fricke 18 Nov 9, 2022
Parser for Object files define the geometry and other properties for objects in Wavefront's Advanced Visualizer.

format of the Rust library load locad blender obj file to Rust NDArray. cargo run test\t10k-images.idx3-ubyte A png file will be generated for the fi

Nasser Eddine Idirene 1 Jan 3, 2022
This is a rewrite of the RAMP (Rapid Assistance in Modelling the Pandemic) model

RAMP from scratch This is a rewrite of the RAMP (Rapid Assistance in Modelling the Pandemic) model, based on the EcoTwins-withCommuting branch, in Rus

Dustin Carlino 3 Oct 26, 2022
A personal etude into rust software (RPG<-it's more fun to debug) development: Tales of the Great White Moose

TGWM (Tales of the Great White Moose) NB: Currently compiles. Should compile and run on both 1.28.0 and 1.31.1 if the Cargo.lock files are deleted. A

null 15 Nov 17, 2021
A library that makes it VERY easy to run Holochain as a library, from your own binary, with great defaults

embedded-holochain-runner A library that makes it VERY easy to run Holochain as a library, from your own binary, with great defaults How it will work

Sprillow 14 Jul 23, 2022
Implementation of the great book Ray Tracing in One Weekend in Rust.

Ray Tracing in One Weekend (Rust) Implementation of the great book Ray Tracing in One Weekend in Rust. Fun easy way to pick up and learn Rust (was rou

Stanley Su 6 Dec 29, 2021
Grsql is a great tool to allow you set up your remote sqlite database as service and CRUD(create/read/update/delete) it using gRPC.

Grsql is a great tool to allow you set up your remote sqlite database as service and CRUD (create/ read/ update/ delete) it using gRPC. Why Create Thi

Bruce Yuan 32 Jul 20, 2022
Splits test files into multiple groups to run tests in parallel nodes

split-test split-test splits tests into multiple groups based on timing data to run tests in parallel. Installation Download binary from GitHub releas

Fumiaki MATSUSHIMA 27 Oct 18, 2022
🍋: A General Lock following paper "Optimistic Lock Coupling: A Scalable and Efficient General-Purpose Synchronization Method"

Optimistic Lock Coupling from paper "Optimistic Lock Coupling: A Scalable and Efficient General-Purpose Synchronization Method" In actual projects, th

LemonHX 22 Oct 13, 2022
wait-free spsc linked-list queue with individually reusable nodes

A wait-free single-producer single-consumer linked-list queue with individually reusable nodes.

glowcoil 11 Oct 23, 2022
Count your code by tokens, types of syntax tree nodes, and patterns in the syntax tree. A tokei/scc/cloc alternative.

tcount (pronounced "tee-count") Count your code by tokens, types of syntax tree nodes, and patterns in the syntax tree. Quick Start Simply run tcount

Adam P. Regasz-Rethy 49 Nov 24, 2022
An OOP programming language I am making by following Crafting Interpreters.

horba An OOP programming language I am making by following Crafting Interpreters. https://craftinginterpreters.com/ I intend it to have a somewhat C-s

Thomas 3 Dec 5, 2021
Zenith substitutes PostgreSQL storage layer and redistributes data across a cluster of nodes

Zenith substitutes PostgreSQL storage layer and redistributes data across a cluster of nodes

null 5.3k Nov 23, 2022
A parser for Nodes semver in Rust

This crate is a pure Rust-based implementation of JavaScript's node-semver. That is, it's designed to be compatible with Node/NPM's particular flavor

Felipe Seré 14 Oct 6, 2022