pacex / GMSOceanSurface

[Finished] Submission to XOR's Fluid rendering contest: An ocean surface renderer incl. wave spectra, Gerstner waves and screen-space reflections

Home Page:https://twitter.com/XorDev/status/1568277920698753026

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

GMSOceanSurface

About

This is my entry for XOR's GM Fluid rendering contest. It is my attempt at rendering a large ocean surface in GameMaker.

screenshot

Features include:

  • Wave functions through discretizing ocean wave spectra
    • Currently: Pierson-Moskowitz spectrum, but easily replaceable
  • Rendering of trochoidal waves (Gerstner waves)
  • Water surface shading
  • Water surface reflections
    • Positionally invariant features (skybox): cube-map reflections
    • Objects in the scene: screen space reflections
      • binary and linear ray marching
  • GUI to control wave and reflection parameters

Usage

  • WASD, Shift, Space to move the camera
  • Right click + drag to turn the camera
  • [U] to update wave functions
  • [G] to toggle GUI

To change the number of wave functions sampled from the spectrum, change the NUM_WAVES parameter on the CPU side as well as in BOTH the vertex and fragment shader!

Future Work

Discrete sampling of the wave spectrum is not ideal. Using an FFT to retrieve vertex displacements from the wave spectrum is far more efficient and provides better visual results. Due to time constraints I was unable to implement this until the contest deadline, but it will remain the main goal for this project.

Boundary awareness of waves adds substantially to visual appearance. This is another aspect I aim to work on in the future.

About

[Finished] Submission to XOR's Fluid rendering contest: An ocean surface renderer incl. wave spectra, Gerstner waves and screen-space reflections

https://twitter.com/XorDev/status/1568277920698753026


Languages

Language:Yacc 44.8%Language:Game Maker Language 38.0%Language:GLSL 17.2%