Coder Social home page Coder Social logo

amilajack / fft-ocean Goto Github PK

View Code? Open in Web Editor NEW

This project forked from jbouny/fft-ocean

0.0 1.0 0.0 11.01 MB

WebGL FFT (Fast Fourier transform) ocean rendering for Three.js

Home Page: https://jbouny.github.io/fft-ocean/

License: MIT License

HTML 3.98% JavaScript 94.24% CSS 1.78%

fft-ocean's Introduction

A trip under the moonlight

Fast Fourier Transform ocean rendering for Three.js

This demo shows a way to render realistic scenes in WebGL.

You can travel by using the keyboard and the environment can be selected. You can also explore the working of the scene by typing 'h'.

Live demo: https://jbouny.github.io/fft-ocean/

Screenshots

Alt text

Alt text

Alt text

Features

  • Ocean rendering is based on the generation of a displacement map and a normal map applied with vertex and fragment shader
  • Ocean mesh is computed in screen space
  • Clouds and rain come from Three.js community

Screen space grid

The screen space working is in fact simple:

  • Add a grid in the scene, anywhere
  • The grid must always be seen by the camera, or the vertex shader will not be applied
  • In the vertex shader, the grid is then put in front of the camera in order to fill the entire screen
  • In the vertex shader, the grid is projected on a 3d plane (just change the depth)

A complete explanation can be find here: http://habib.wikidot.com/projected-grid-ocean-shader-full-html-version

So, results are here.

With a 64*64 grid:

Alt text

With a 256*256 grid:

Alt text

Acknowledgments

fft-ocean's People

Contributors

jbouny avatar

Watchers

 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.