Skip to content

GabriellaQiong/Project3-Simulation

 
 

Repository files navigation

CIS565: Project 3: CUDA Simulation and GLSL Visualization

Fall 2013

Qiong Wang


INTRODUCTION

This is a Nbody Simulation Project based on CUDA and OpenGL for CIS 565 GPU Programming. The GLSL visualization gives beautiful results of simulation.

In the first part, the simulation is about how a star system works. There are N small planets moving around the center star with the acceleration computed from the Newton's Gravitation Law. The second part is about the general flocking phenomenon in nature. The mechanism of flocking can be listed as the following three main steering behaviors:

  1. Alignment: Boids within a certain distance tends to move with the average velocity.
  2. Cohesion: Boids within a certain distance tends to move to the average position.
  3. Separation: Each boid will give a force to push other close boids away.

FEATURES IMPLEMENTED

###PART 1

Basic features:

  • Calculating forces between all interacting bodies
  • The same, but with shared memory
  • Vertex shader code to render a height field
  • Fragment shader code to light that height field
  • Geometry shader code to create screen facing billboards from rendered points
  • Fragment shader code to render those billboards like spheres with simple diffuse shading

Optional features:

  • Unique looking for planets
  • Runge Kutta integration
  • Replace geometry shader billboarding with adding a pyramid pointing in the direction of velocity

###PART 2

Features:

  • Three steering behavior of boids
  • Border handling with velocity bounce
  • Fragment shader code to light on pyramid with simple diffuse shading
  • Geometry shader code to create screen facing billboards from rendered pyramids pointing in the direction of velocity
  • Height Geometry shader of the plane with the height field
  • Runge Kutta integration

Features needs to improve:

  • Interactive mouse and keyboard is still debugging which will change the view and projection whenenver pressing the left/right, up/down button, and zoom in and out with the mouse wheel rolling

SCREENSHOTS OF THE FEATURES IMPLEMENTED

  • Basic Star System of Part 1

ScreenShot

  • Star System of Part 1 with unique looking planets

ScreenShot

  • Basic Flocking of Part 2 with pyrimid geometry shader

ScreenShot

  • Flocking of Part 2 with diffuse pyrimid geometry shader

ScreenShot

  • Flocking of Part 2 with diffuse pyrimid geometry shader and height field

ScreenShot

  • Flocking of Part 2 with improved height field

ScreenShot

  • Flocking of Part 2 with improved noise height field

ScreenShot

  • Flocking of Part 2 with improved ocean wave effect height field

ScreenShot


VIDEOS OF IMPLEMENTATION

Here is the video of the working star system.

ScreenShot

This is the video of the flocking process of small pyramids.

ScreenShot

Another new video of flocking with ocean wave effect is this:

ScreenShot

The youtube links are here if you cannot open the video in the markdown file: http://www.youtube.com/watch?v=CIzqrhkuMrI, http://www.youtube.com/watch?v=b5fV_K9yWqA and http://www.youtube.com/watch?v=OxMKQQeQXx4.


PERFORMANCE EVALUATION

Here is the table for the performance evaluation when changing the number of planets and with shared memory or not for part 1.

particle # with shared memory approximate fps
50 no 12.77
64 no 10.23
128 no 5.67
256 no 1.28
50 yes 10.43
64 yes 9.56
128 yes 5.72
256 yes 1.34

Unfortunately, the computers in Moore 100 cannot work when the particle number is bigger than 256, so here only listed four kinds of particle number. Probability, when the particle number is much larger, the advantage to use shared memory will be apparent.


REFERENCES


ACKNOWLEDGEMENT

Thanks a lot to Patrick and Liam for the preparation of this project. Thank you :)

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • C 54.7%
  • C++ 45.1%
  • Other 0.2%