Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/taichi-dev/soft2d-release
Soft2D: A 2D multi-material continuum physics engine designed for real-time applications.
https://github.com/taichi-dev/soft2d-release
fluid fluid-simulation physics physics-2d physics-engine physics-simulation sand-simulation snow-simulation softbody-simulation
Last synced: 2 months ago
JSON representation
Soft2D: A 2D multi-material continuum physics engine designed for real-time applications.
- Host: GitHub
- URL: https://github.com/taichi-dev/soft2d-release
- Owner: taichi-dev
- License: apache-2.0
- Created: 2023-05-30T04:10:01.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2023-08-21T09:58:22.000Z (over 1 year ago)
- Last Synced: 2024-01-27T18:10:54.871Z (12 months ago)
- Topics: fluid, fluid-simulation, physics, physics-2d, physics-engine, physics-simulation, sand-simulation, snow-simulation, softbody-simulation
- Language: C++
- Homepage: https://www.soft2d.tech/
- Size: 10.3 MB
- Stars: 45
- Watchers: 4
- Forks: 5
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# soft2d-release
This is soft2d's official repository for the latest releases, user examples, and documentation. The user documentation is hosted [here](https://docs.soft2d.tech/).## Introduction
Soft2D is a 2D multi-material continuum physics engine designed for real-time applications. With soft2d, users can simulate various materials such as fluids, sand, snow, and elastic bodies within their applications. Soft2D runs on GPU, and currently supports Vulkan and Metal backends.Soft2D is distributed as shared library binary files and header files. These files are under the `soft2d/` directory. Additionally, soft2d relies on the [Taichi C-API](https://docs.taichi-lang.org/docs/taichi_core) library. The Taichi C-API library is located at `dependencies/taichi_c_api/`, which has the same directory structure as `soft2d/`.
### Binary Compatibility
Here we list the ABI compatibility of soft2d binary files:
* Linux: x86-64 (Tested on Ubuntu 20.04 and Ubuntu 22.04)
* Windows: x86-64 (Tested on Windows 10 with Visual Studio 2022)
* macOS: arm64-m1 (Tested on Ventura)
* iOS: aarch64
* Android: arm64-v8a## User Examples
![A preview of user examples.](./images/examples.png)Under the `examples/` directory, we provide a collection of user examples demonstrating the capabilities of soft2d. **These examples can run on Linux and Windows with Vulkan installed.** All examples have been tested on Ubuntu 20.04/22.04 and Windows 10 with Visual Studio 2022. Follow the steps below to build and run these examples.
Video-version of these examples can be found on [Soft2D YouTube channel](https://www.youtube.com/@Soft2D).
### Project Cloning
* Use `git-lfs` to clone binary files correctly.
* Use `git submodule` to install the necessary third-party dependencies for the Vulkan renderer.``` bash
# git clone ...
# cd soft2d-release/
git lfs pull
git submodule update --init --recursive
```
### Vulkan Installation
Please install Vulkan SDK from [vulkan-sdk website](https://www.lunarg.com/vulkan-sdk/), and make sure Vulkan-related environment variables (`VULKAN_SDK`) are properly configured.### Running the Examples
Linux and Windows users can use the following commands to build and run the examples:
#### Linux
* Clean the build directory: `./build_linux.sh --clean`
* Run the minimal test (No GUI): `./build_linux.sh --test`
* Run a specific example: `./build_linux.sh --example=`
* For instance, to run `examples/basic_shapes.cpp`, please use the command `./build_linux.sh --example=basic_shapes`
* Build all examples: `./build_linux.sh`
* All output executables will be stored under the `build/` directory.#### Windows
* Clean the build directory: `.\build_windows.bat --clean`
* Run the minimal test (No GUI): `.\build_windows.bat --test`
* Run a specific example: `.\build_windows.bat --example=`
* For instance, to run `examples/basic_shapes.cpp`, please use the command `.\build_windows.bat --example=basic_shapes`
* Build all examples: `.\build_windows.bat`
* All output executables will be stored under the `build/Release/` directory.