insberr / archea

3D Falling Sand Simulation

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Archea

Archea is a 3D Falling Sand Simulation I am developing because I am bored and love falling sand simulations. I also needed an excuse to learn graphics programming and to make a custom game engine. This project has been a bit of a challenge so far and has been through multiple rewrites. See Journey Of Archea

You can watch my streams of making this project on YouTube here.
If you don't feel like watching the streams (I don't blame you, they are long), you can watch my dev log videos instead

Development Setup

Make sure to follow the specific OS instructions.

(SOON) For VSCode, there should be a run and debug configuration already provided.

JetBrains CLion will automatically set up the build configs.

Linux

First you need to install OpenGL development libraries. This is really easy on linux.

sudo apt install libglew-dev libglfw3-dev libglm-dev

You will also need to install CMake.

# TODO add CMake install instructions

Then configure CMake in your IDE of choice.

Windows

Install packages with vcpkg (builtin to CLion)

  • glew
  • glfw3
  • glm

Have fun good luck.

MacOS

I have no idea, you are on your own for this. (I will look later I guess)

Cross Compiling

I have to look up how to do these.

Compile for Windows on Linux

TODO

Compile for Linux on Windows

TODO

Wording

  1. Particle - Refers to a voxel which is simulated (i.e. sand, water)
  2. Voxel - The cubes you see in the world, duh

Journey Of Archea

Here is the journey I went through and some history LOL.

I started out trying to make a 2D falling sand simulation in Godot using C# with a friend. We made some progress but kept dealing with performance issues. We stopped working on it shortly after.

Later I started trying to make a 3D simulation in rust using the Bevy game library. I quickly learned two things:

  1. I needed to make my own engine specifically for the simulation.
  2. Rust wasn't working well for me. I needed to switch to a language I was more comfortable with.

So I decided to switch to c++ and start learning graphics programming. I started out by following a YouTube tutorial to learn directx11. (My learning_d3d11 repository).

I started making a 2d falling sand game in directx11 and quickly made it 3D because I am impatient.
Then decided my code was too messy.
I started looking for ways to render the particles and discovered ray marching. Ray marching seemed interesting so I started experimenting with it in shader toys.
I started learning opengl and messing with ray marching. Once I had a handle on that I came back here (to Archea) and started rewriting it in c++.
3 Days later I have a basic engine working, ray marching working, opengl working, ImGui set up, and a very basic simulation of particles.

I have been spending way too much time working on the shader. I really need to start working on the simulation itself.

About

3D Falling Sand Simulation


Languages

Language:C++ 89.5%Language:C 9.8%Language:GLSL 0.6%Language:CMake 0.1%