Video Overview

https://s3-us-west-2.amazonaws.com/secure.notion-static.com/ec582c37-ef53-4c8a-93db-98f9858a2be1/Screen_Recording_2021-05-09_at_4.12.33_PM.mov

Abstract


For our project, we implemented a simulation of raindrops sliding on a glass window using WebGL for rendering graphics. The main components of this project were architecting the raindrops themselves, the motion of the raindrops, and the fragment shaders used to simulate the reflection and refraction of raindrops. We also used a physically-inspired hack on the background image, blurring it to give it the appearance of glass for the raindrops to "slide" on. Our simulation responds to user controls and there are two menus to change the background and shaders and a GUI available to manipulate different raindrop architecture and motion parameters.

Our project simulation is available here.

Technical Approach


<aside> 💭 Disclaimer: we're all pretty new to web development, so to minimize struggles with the infrastructure surrounding this project, we decided to clone an existing project with a similar stucture (RainEffect) and use its WebGL infrastructure as a foundation. We rewrote the motion simulation of each raindrop, and the shaders, from scratch, while using the article as a guide on specific physics/graphics areas to research and understand. We also added several novel components, including a handful of different shaders and a GUI to modify hyperparameters.

</aside>

Raindrop Motion Architecture

When raindrops fall onto a window, they exhibit a few key behaviors. Below, we walk through the seven attributes of a raindrop that we define to characterize the behavior of a drop. Then, we discuss how we simulate the motion of each drop. This approach doesn't explicitly model the viscocity of the water/gravitational forces/etc. - but it does look realistic, and the approach is inspired by these physical properties.


Creating the Drop

  1. Each drop has some initial size.
  2. Each drop has some initial position.
  3. Each drop has some initial radius. This radius is chosen by rand(min_radius, max_radius)
  4. Each drop has some initial shrink.
  5. Each drop has some initial momentum.