Skip to content

Instantly share code, notes, and snippets.

Avatar

CobaltXII CobaltXII

View GitHub Profile
View cosmos.md

Cosmos

Cosmos is an OpenCL accelerated n-body simulator. It can be used to render n-body simulations at a high speed.

Usage

Using Cosmos is a two step process. First, you must output binary data of the results of a n-body simulation. Second, you render this to a high-resolution image sequence. Cosmos provides two tools for these purposes, cosmos_simulate and cosmos_render.

Unfortunately, the Cosmos toolchain does not provide an easy way to tweak initial conditions or parameters. However, it does come with a great set of pre-defined conditions and parameters. If you want to modify these, you will have to edit the source code before compiling. If you want to find places where you can edit parameters, search for the text PARAM in all source files.

View cgol.cpp
// Cellular automata? Awesome.
#include "../boiler/boiler.h"
#include <vector>
#include <utility>
#include <iostream>
typedef unsigned char cell;
View todo.txt
To do
- [x] Quad tree compression
- [ ] GLSL smallpt
- [ ] CPU smallpt
- [ ] Dithering library
- [ ] All RGB
- [ ] Chip-8 emulator
- [ ] Chip-8 assembler
- [ ] Chip-8 disassembler
View n_body_image.cpp
// Emptyness? Awesome.
#define STB_IMAGE_WRITE_IMPLEMENTATION
#include "stb_image_write.h"
#include <vector>
#include <utility>
#include <sstream>
#include <iostream>
View bisqwit_jingle.cpp
#include <SDL2/SDL.h>
#include <cmath>
// An audio driver. This audio driver will define a callback that will
// generate a waveform which is passed to SDL. SDL passes this waveform to
// the OS, where it is output to a physical device.
struct audio_driver
{
You can’t perform that action at this time.