Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/im-rises/particle-system-webgl

Particle system made in C++ with OpenGL build with Emscripten to WebGL2
https://github.com/im-rises/particle-system-webgl

cpp emscripten graphics opengl particle-system particles simulation system

Last synced: 15 days ago
JSON representation

Particle system made in C++ with OpenGL build with Emscripten to WebGL2

Awesome Lists containing this project

README

        

# particle-system-webgl


cppLogo
openglLogo
cmakeLogo
webglLogo
glfwLogo

## Description

This is a particle system written in C++ and compiled to WebGL using
Emscripten. It is a port of my particle system written in C++ and OpenGL which can be
found [here](https://github.com/Im-Rises/Particlesystem).

## 🚀🚀[you can try the webgl build online by clicking here](https://im-rises.github.io/particle-system-webgl/) 🚀🚀

## Images and Video

[![Watch the video](https://user-images.githubusercontent.com/59691442/216751976-c06c492d-5dfb-466c-afe9-ec44e94e5db9.png)](https://www.youtube.com/watch?v=h5X1RaElC7Y)

[![Watch the video](https://user-images.githubusercontent.com/59691442/216753254-f3315a71-f073-420e-b4e3-86a024913683.png)](https://www.youtube.com/watch?v=h5X1RaElC7Y)

Click on the images to watch the video.

## Dependencies

- C++ 14
- C++ compiler (MSVC, Mingw, ...)
- CMake
- Glad
- GLFW (3.3.8)
- OpenGl (3.3)
- Dear ImGui (1.88.4)
- glm (0.9.8.5)
- stb (2.28)

> **Note**
> Due to the Emscripten new version (3.1.33), I needed to update the ImGui version from 1.84.3 to 1.88.4.

## Building

To build the project, you need to use a UNIX system, like Ubuntu or if you're on Windows you can use WSL.
Then you have to install Emscripten. You can find
instructions on how to install Emscripten here:

You also need to have CMake and make installed. You can find instructions on how to
install CMake here:

Make can be installed by running this command in the terminal:

```bash
sudo apt install make
```

Once you have Emscripten and CMake installed run this command in the project root directory:

```bash
emcmake cmake .
```

Then run this command in the same directory:

```bash
emmake make
```

## To test the website locally

To test the website locally, you need to have Python installed. You can find instructions on how to install Python here:

Once you have Python installed, run this command in the project build directory:

```bash
python -m http.server
```

Then open your browser and go to this address:

## Controls

The speed and some parameters can be modified directly in the ImGui windows.

| Action | Key |
|---------------------|-------------------------------------|
| Translate camera | (WASD) or (↑ ← ↓ →) |
| Pause/Resume | P |
| Move up/down camera | (Space/Shift) or (Page up/down) |
| Rotate camera | Right Mouse Button + Mouse movement |
| Fullscreen | F11 |

## GitHub Actions

This project uses GitHub Actions to build the project and deploy it to GitHub

[![CodeQL](https://github.com/Im-Rises/particle-system-webgl/actions/workflows/codeql.yml/badge.svg?branch=main)](https://github.com/Im-Rises/particle-system-webgl/actions/workflows/codeql.yml)
[![CMake](https://github.com/Im-Rises/particle-system-webgl/actions/workflows/cmake.yml/badge.svg?branch=main)](https://github.com/Im-Rises/particle-system-webgl/actions/workflows/cmake.yml)
[![flawfinder](https://github.com/Im-Rises/particle-system-webgl/actions/workflows/flawfinder.yml/badge.svg?branch=main)](https://github.com/Im-Rises/particle-system-webgl/actions/workflows/flawfinder.yml)
[![cpp-linter](https://github.com/Im-Rises/particle-system-webgl/actions/workflows/cpp-linter.yml/badge.svg?branch=main)](https://github.com/Im-Rises/particle-system-webgl/actions/workflows/cpp-linter.yml)
[![Emscripten-CMake](https://github.com/Im-Rises/particle-system-webgl/actions/workflows/emscripten-cmake.yml/badge.svg)](https://github.com/Im-Rises/particle-system-webgl/actions/workflows/emscripten-cmake.yml)
[![Emscripten-Publish](https://github.com/Im-Rises/particle-system-webgl/actions/workflows/emscripten-publish.yml/badge.svg)](https://github.com/Im-Rises/particle-system-webgl/actions/workflows/emscripten-publish.yml)

The project is set with a set of different scripts:

- CodeQL: This script is used to check the code for security issues.
- CMake: This script is used to build the project.
- Cpp Cmake Publish: This script is used to publish the project on GitHub.
- Flawfinder: This script is used to check the code for security issues.
- Microsoft C++ Code Analysis: This script is used to check the code for security issues.
- Cpp Linter: This script is used to check the code for security issues.
- Emscripten CMake: This script is used to test build of the project using Emscripten toolchain.
- Emscripten-Publish: This script build to webgl and publish the project on GitHub Pages.

## Libraries

glfw:

glm:

glad:

stb (stb_image):

Dear ImGui:

OpenGL:

emscripten:

bin2c:

## Documentation

learnopengl (OpenGL tutorial):

unrealistic.dev (Change CMake working directory):

OpenGL ES 3.0 Reference Pages:

Wikipedia (OpenGL versions):

## Contributors

Quentin MOREL:

- @Im-Rises
-

[![GitHub contributors](https://contrib.rocks/image?repo=Im-Rises/particle-system-webgl)](https://github.com/Im-Rises/particle-system-webgl/graphs/contributors)