Giter Site home page Giter Site logo

ripple's Introduction

ripple

A simple webgl simulation of the surface of a fluid. I was inspired to make this after seeing this really cool simulation as part of three.js's examples. The algorithm for evolving the height of the surface in that example turned out to be based on this really old article from 1998. The trail ends there, but even that one's author attributes it to someone else. It's a really simple algorithm but it produces a pretty realistic effect.

Other than the height map, the simulation also calculates a velocity field for moving the little cubes and a normal map for lighting. The velocity field is simply the gradient of the height map multiplied by -1.

My implementation is written with plain webgl. The lighting isn't as nice as what three.js offers; I basically followed along with the Basic Lighting chapter from learnopengl.com. Nevertheless it still creates a pretty cool simulation.

Hosted on github.io.

Credits

ripple's People

Contributors

bassicali 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.