Giter Site home page Giter Site logo

capstone-project's Introduction

Ocean Wave Simulation Performance Comparison

Ocean surface generated by program

Overview

This project aims to compare the performance of different methods for simulating ocean waves from oceanographic spectra. Specifically, it focuses on comparing the Discrete Fourier Transform (DFT) and Fast Fourier Transform (FFT) methods. It is using the Phillips spectrum, even though it is not accurate to real world conditions it fits within the purposes of the work done here.

The project aims to compare the performance of the GPGPU versions, implemented using OpenGL compute shaders and CPU versions aswell. Additionally, performance metrics such as simulation time and computational efficiency will be analyzed with the help Python scripts.

The visualization is rudimentary, having visual artifacts and using a plastic like shader. But for the purposes of the program it is good enough.

Requirements

  • GCC 13.2.0 (or another compiler, cannot ensure proper functionality)
  • CMake 3.25.0
  • Support for OpenGL 4.6

Directory Structure

  • src/: Contains C++ source files.
  • include/: Contains C++ include files.
  • shaders/: Contains OpenGL compute and visualization shaders.
  • external/: Contains external dependencies (glm, GLFW, GL3W, fmt, ImGui).
  • build/: Directory for build output.

Build

  1. Clone the repository including the dependencies
git clone --recurse-submodules https://github.com/Rocco2300/capstone-project
  1. Go to the cloned repo directory and create a build folder
cd capstone-project
mkdir build
  1. Use cmake to build project
cd build
cmake ..
cmake --build .
  1. Now you can run it
./capstone-project.exe

Usage

Application ui

You can move the camera to get the view you want of the surface. The controls are:

  • W - move forward
  • S - move backward
  • A - move left
  • D - move right
  • Space - move up
  • Ctrl - move down
  • Shift - speed up movement
  • Right-Click and mouse move - move camera

In the settings menu you can change the algorithm used, which will take effect immediately. Aditionally you can change the simulation size and parameters of the Phillips spectrum, this requiring a reinitialization. The light settings can also be modified, they are represented in spherical coordinates, locked to being above the surface.

In the debug menu you can view the normal and height/displacement maps generated. The debug view of the textures might look off for sizes of <256 since they are scaled to 256. The surface can be rendered in wireframe and the normals can also be visualized. To help in checking the correctness of the surface topology the simulation can be paused aswell.

References

capstone-project's People

Contributors

rocco2300 avatar

Watchers

 avatar

capstone-project's Issues

GPU simulation pipeline

  • Implement TextureArray similar to Texture class
  • Implement a TextureMerger compute to take care of packing of textures in one Displacement and one Normal texture
  • Make DFT generic
  • Implement Sum of Sines and Gerstner DFT based simulation
  • Add a simulation wrapper to take care of which algorithm is used and that steps it takes

Results gathering

  • Simulation class to encompass steps and be generic to CPU or GPU sim
  • Profiler that keeps track of all the dispatches and function call times
  • Saving profiler runs on disk in JSON format
  • Benchmarking that runs each simulation in increasing resolution
  • Use Python to parse JSON profiler output and output graphs of performance metrics

CPU simulation pipeline

  • Spectrum generation/evolution
  • Gerstner and Sum of Sines DFT based sim
  • Generic DFT implementation
  • FFT implementation
  • Image class to modify data on CPU
  • Use STL for_each for easy multithreading, to test single and multithreaded performance
  • ImageArray class?

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.