All Projects â†’ Postrediori â†’ OceanSimulation

Postrediori / OceanSimulation

Licence: MIT license
Ocean Simulation Based on a Model By Keith Lantz (https://www.keithlantz.net/)

Programming Languages

C++
36643 projects - #6 most used programming language
CMake
9771 projects
GLSL
2045 projects
c
50402 projects - #5 most used programming language

Projects that are alternatives of or similar to OceanSimulation

GLGrassRenderer
OpenGL Grass Renderer
Stars: ✭ 63 (+293.75%)
Mutual labels:  glsl
spritekit-water-node
🌊 Custom SpriteKit node that allows to simulate 2D water with respect to physics. The app demonstrates Flocking behaviour using GameplayKit, key-frame animation and custom fragment shader chaining (GLSL) 🤯
Stars: ✭ 82 (+412.5%)
Mutual labels:  glsl
webgl-noise-examples
examples about noise
Stars: ✭ 72 (+350%)
Mutual labels:  glsl
three-noise
Simple gradient noise library for use with Three.js. Now with fBm!
Stars: ✭ 31 (+93.75%)
Mutual labels:  glsl
WaterColor
openframeworks parametric shader effect watercolor
Stars: ✭ 54 (+237.5%)
Mutual labels:  glsl
PhaserCHOP
A TouchDesigner channel operator for phase-staggered animations
Stars: ✭ 15 (-6.25%)
Mutual labels:  glsl
fftWater
Ocean simulation based on the paper of Jerry Tessendorf: Simulating Ocean Water
Stars: ✭ 20 (+25%)
Mutual labels:  ocean-simulation
pilka
Another live-coding tool for creating shader demos, Vulkan+Wgpu powered.
Stars: ✭ 84 (+425%)
Mutual labels:  glsl
glslc
Simple GLSL compilation checker that uses the display driver
Stars: ✭ 24 (+50%)
Mutual labels:  glsl
card-game-GLSL
card game in the single GLSL shader
Stars: ✭ 20 (+25%)
Mutual labels:  glsl
minimal gl
PC 4K Intro Editor
Stars: ✭ 36 (+125%)
Mutual labels:  glsl
shaderview
A GLSL shader development tool for the LÖVE game framework.
Stars: ✭ 22 (+37.5%)
Mutual labels:  glsl
glsl-doodle
Drawing patterns with glsl shaders on modern browsers.
Stars: ✭ 53 (+231.25%)
Mutual labels:  glsl
hwoa-rang-gl
WebGL Library
Stars: ✭ 21 (+31.25%)
Mutual labels:  glsl
basegl-old
A blazing fast WebGL drawing API.
Stars: ✭ 21 (+31.25%)
Mutual labels:  glsl
ShaderWriter
Library used to write shaders from C++, and export them in either GLSL, HLSL or SPIR-V.
Stars: ✭ 171 (+968.75%)
Mutual labels:  glsl
glsl-smaa
SMAA (Enhanced Subpixel Morphological Antialiasing) post-processing; WebGL (OpenGL ES 2.0) implementation with no fluff.
Stars: ✭ 54 (+237.5%)
Mutual labels:  glsl
react-native-glshaders-testing
Just a demo app that mimic some Instagram + Snapchat features
Stars: ✭ 52 (+225%)
Mutual labels:  glsl
Shader-Playgrounds
A WebGL shaders editor for beginners and otherwise.
Stars: ✭ 28 (+75%)
Mutual labels:  glsl
defisheye
convert ricoh-theta dual fisheye video to equirectangular format
Stars: ✭ 47 (+193.75%)
Mutual labels:  glsl

Introduction

Ocean simulation is based on the project by Keith Lantz. This program uses OpenGL 3.3 for rendering. The version that uses OpenGL 2.0 and can be run on older hardware can be checked in a separate branch: OceanSimulation/opengl2_0.

The numerical model is based on the paper by J. Tessendorf and utilizes Phillips spectrum and algorithm of inverse FFT.

Ocean Simulation screenshot

Ocean Simulation with UI

Ocean Simulation with Colors UI

Prerequisites

Generating build files for your OS and build system requires CMake. Most of the dependencies are bundled with the repository as git submodules. This includes:

  • glad - OpenGL Function Loader.
  • glfw - Windowing and Input.
  • glm - OpenGL Mathematics.
  • plog - Logging library.
  • imgui - UI library.

Building for Linux

Dependencies

The following instructions apply to:

  • Ubuntu 20.04, 18.04, 16.04
  • Debian 9 and higher
sudo apt-get install -y \
    build-essential \
    cmake \
    xorg-dev \
    libgl1-mesa-dev \
    libfreetype6-dev

The following instructions apply to:

  • Fedora 22 and higher
sudo dnf install -y \
    gcc gcc-c++ make \
    cmake \
    mesa-libGL-devel \
    libXrandr-devel \
    libXinerama-devel \
    libXcursor-devel \
    libXi-devel \
    freetype-devel
  • CentOS 7 and higher
sudo yum install -y \
    gcc gcc-c++ make \
    cmake \
    mesa-libGL-devel \
    libXrandr-devel \
    libXinerama-devel \
    libXcursor-devel \
    libXi-devel \
    freetype-devel

Cloning Repository

git clone --recursive https://github.com/Postrediori/OceanSimulation.git
cd OceanSimulation

Cloning the repository requires passing the --recursive flag to load Git submodules.

Building Project

The program is built with the commands below. CMake requires the directory with the main project's CMakeLists.txt file as an argument. Then the CMake creates the build files for the GNU make which build an executable.

mkdir build && cd build
cmake .. -DCMAKE_BUILD_TYPE=Release
make
make install

Running Project

After the successful build the binary Ocean will end up in <source dir>/bundle/Ocean.

cd bundle/Ocean
./Ocean

All of the files required for an executable run are stored in <PathToProject>/bundle/Ocean:

cd <PathToProject>/bundle
tree
.
└── Ocean
    ├── data
    │   ├── ocean.frag
    │   ├── ocean.vert
    │   └── ocean.cfg
    └── Ocean

2 directories, 7 files

Building for macOS

Dependencies

You’ll need to download and install the following to build the project:

  • Xcode and the Xcode command line tools
  • CMake (e.g. via homebrew brew install cmake)

Cloning Repository

git clone --recursive https://github.com/Postrediori/OceanSimulation
cd OceanSimulation

Using CMake

Generate makefiles for the build:

mkdir build
cd build
cmake .. -DCMAKE_OSX_ARCHITECTURES=x86_64 -DCMAKE_BUILD_TYPE=Release

Building

make -j4
make install

An Ocean application bundle will now be present under <Source directory>/bundle/Ocean.

Configuration

The parameters of the model can be adjusted in the data/ocean.cfg file:

# configuration file for Ocean Simulation

# wave parameters
waveAmplitude = 2e-5

# wind parameters
windDirX = 0.0
windDirZ = 12.8

oceanSize = 64
oceanLen = 320.0
oceanRepeat = 5

The following parameters are to be adjusted:

  • waveAmplitude - amplitude of the surface disturbance.
  • windDirX, windDirZ - components of the wind vector. The vertical (Y) component is ignored in the model.
  • oceanLen - discretization parameter.
  • oceanRepeat - this model does use only a small patch of memory to model the whole Ocean. This parameter adjusts the size of the model in terms of one minimal patch. The value represents the number of ocean patches along X and Z dimensions. E.g. value 5 mean the simulated area will be 5x5 the size of the initial patch.
  • oceanSize, oceanLen - these are the parameters of the initial patch that will be used for simulation of the ocean. The first parameter is the grid size and the second value stands for the length of the patch.

Controls

  • F1 - Toggle fullscreen mode.
  • F2 - Show/hide UI on the screen.
  • Arrow keys - Navigate the model.
  • PgUp/PgDown - Adjust vertical position of the viewer point.
  • 1 - Toggle wireframe mode.
  • 2 - Toggle solid surface ("normal") mode.

Links

TODO

  • Adjust ocean parameters in the UI.
  • Color adjustment.
  • [ ] Mouse navigation.
  • [ ] Add build instructions for Windows.
  • [ ] Add Vulkan renderer.
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].