https://github.com/konrad-kubacki/px_particles
Basic particles on the screen using OpenGL and C++.
https://github.com/konrad-kubacki/px_particles
cpp opengl particles simd
Last synced: over 1 year ago
JSON representation
Basic particles on the screen using OpenGL and C++.
- Host: GitHub
- URL: https://github.com/konrad-kubacki/px_particles
- Owner: konrad-kubacki
- Created: 2020-10-24T19:09:51.000Z (over 5 years ago)
- Default Branch: master
- Last Pushed: 2020-10-27T09:51:47.000Z (over 5 years ago)
- Last Synced: 2025-03-01T21:20:29.800Z (over 1 year ago)
- Topics: cpp, opengl, particles, simd
- Language: C++
- Homepage:
- Size: 4.65 MB
- Stars: 6
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: readme.md
Awesome Lists containing this project
README
# OpenGL + SIMD + C++
## v1.0
It's a test project. Main purpose is to play with SIMD (Single Instruction Multiple Data). I'm using [vectorclass](https://github.com/vectorclass) library for SIMD, [SFML](https://github.com/sfml/sfml) for Window creation and input handling.
# **Usage**
Use *left mouse button* to attract particles towards it. Hold *left shift* to attract them continuously. Use *R* key to reset the particles.
# **Command line arguments**
`-arg_name=value`, for example `-win_w=1280 -win_h=720`.
| argument | description | default value |
| :- | :- | :- |
| win_w | window width, has to be divisible by 4 | 800 |
| win_h | window height | 600 |
| fps | FPS limit | 0 (no limit) |
| alignment | alignment of particles memory, has to be power of 2 | 32 |
| pulse_demo | are we running the pulsating demo mode? Interaction is disabled in pulse mode. | 0 (non-zero means yes) |
| pulse_min | minimum pulse time, in milliseconds | 100 |
| pulse_max | maximum pulse time, in milliseconds | 900 |
| use_lines | use GL_LINE_LOOP instead of GL_POINTS, gives a cool effect | 0 (non-zero means yes) |
# Compiling
Just open the .sln using Visual Studio 2019 and compile. Binaries will in the `_binaries` folder.
# [Lines demo](https://youtu.be/ypdq5brqjEE)
# [Pulse demo](https://youtu.be/V5rohV-xLDM)
# [Clicking demo](https://youtu.be/A0FwfGXOCbs)
# Screens
Just note that the coolset thing about this program is that particles move really fast. It's hard to catch the fun stuff on still images.
## Lines mode:

## Pulsating particles mode:

## Following screenshots were captured in a 1000x1000 window, 1 milion particles, clicking mode.



