Code Monkey home page Code Monkey logo

nbodies's Introduction

NBodies

A C# & OpenCL 2D SPH NBody Simulation Toy. Utilizes a compressed multi-level hybrid fast multipole "mesh" for a high performance loosely bound simulation.

Features

  • Loosely bound field: Supports very large complex and sparse simulations. Multiple passes will be used where allocation size exceeds the max allowed by the platform.
  • Hybrid fast multipole "mesh" optimization: A multi-layer mesh and neighbor list is constructed using optimized hybrid CPU/GPU methods. And aliasing is reduced by averaging each mesh cells center of mass. Cell size and level count can be adjusted at runtime.
  • Multi-mode collisional physics: Bodies collide with SPH or elastic/merge collisions depending on their size & roche status. Collisions can also be disabled completely.
  • Large body roche fractures: Large bodies will fracture into a circular clump of particles when the gravitational force exceeds a ratio of thier mass.
  • Save States: Fields and be saved and loaded from disk via a ProtoBuf serializer.
  • Simple User Interaction: Fields/bodies can be added, moved and edited on the fly with simple mouse & keyboard inputs. Navigation around the field is done via intuitive click-drag Google Maps style inputs.
  • Multiple Display Styles & Scaling: Normal, Pressure, Density, Velocity, Index, Spatial Order, Force and High Contrast display types with scaling that can be changed at runtime.
  • Rewind Buffer: The option to selectively rewind the simulation up to 200 frames can be enabled.
  • Dual-mode abstracted rendering: The default renderer utilizes SharpDX for Direct 2D rendering. But a GDI based renderer is included and they can be swiched anytime during runtime.
  • Matter types with density: A basic series of matter types with varying densities can be used to create complex SPH interactions including stratification of clumps.
  • etc, etc, etc

Performance

  • Intel i7-6820HQ
  • AMD Radeon R7 M370

(Varies with field density and clumps)

5k particles

250+ FPS

10k particles

~150 FPS

20k particles

~100 FPS

50k particles

60 - 70 FPS

100k particles

40 - 50 FPS

400k particles

~14 FPS

nbodies's People

Contributors

bobbar avatar

Stargazers

 avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.