Final Project: Physically-Based Foam Tracing (PBFT!)
SeanRosenbaum and MattiasBergbom
Introduction
As children we immensely enjoyed our bubble-baths. We were always mesmerized by the voronoi-like bubble formations of foam and the optical properties they exhibit. Our goal is to create physically-based foam formations by modeling both of these characteristics. Some of the optical properties are shown below.
Reflection and interference
Interesting transparency
Flash lighting
We can observe the bubble formations along the outline of the foam, where it's not too dense. Otherwise it looks more homogenous and the specular effects appear to be spread randomly. Also, there's an interesting difference in the appearance between when lighting with a flash (from the front) and when mainly lighting from behind, likely caused by the unique microstructure of the foam.
Prior Work
To our knowledge there have not been any significant contributions specifically for rendering photo-realistic foam. However, the scientific community proposed a number of models for their geometry and dynamics. In idealized bubble formations, space is "partitioned into cells of equal volume with the least area of surface between them, i.e. the most efficient soap bubble foam". Lord Kelvin proposed a non-optimal geometric model to solve this problem. More recently, the Waire-Phalen structure is believed to be a more optimal solution.
Soap bubble formations in particular are described by Plateau's Laws (http://mathworld.wolfram.com/PlateausLaws.html). They were used to model these bubble formations.
The optical properties of foam are well understood. Interference is key to rendering realistic soap bubble formations. It is a function of the thickness of the walls, wavelength, and the angle the light hits the bubble.
The foam in this "beer and glass" render was modeled using a particle simulation. Though interesting, it lacks any of the optical effects and has no physical basis. Similarly, the foam in this image appears to be an artistic recreation. The author author explains "the foam was created by modelling the volume with triangle meshes and applying a transparent texture and a foam-like procedural material."
Technique
Method 1: Brute Force
We will first implement a brute-force, physically accurate render of the foam. This entails modeling large bubble formations using Plateau's laws and extending PBRT to support film-interference. Kraynik et al. presents some interesting work on relaxing Voronoi structures to produce physically feasible foams, using the Surface Evolver.
Method 2: Subsurface Scattering
We suspect our brute-force model will eat away too many cycles to render large amounts of dense foam. We hope to overcome this by using subsurface-scattering specifically for dense formations. Once the brute-force model is implemented, we plan to trace rays through it to simulate its optical properties in order to develop a subsurface scattering model for it. The combination of subsurface scattering for dense formations and a highly complex brute-force model should enable us to render very interesting foam formations. One of the challenges will be to adaptively alternate between each of these models when rendering a single foam formation without any noticeable artifacts. Another possible challenge is including wavelength dependency in this model.
We look forward to your feedback on this idea!
Extras
Steam
If we have the time, we would also like to do some steam/smoke simulation over the foam formation. This will add greatly to our goal of rendering a photo-realistic bubble-bath scene. This boils down to numerically solving the Navier-Stokes equations - a common model for fluid flow. Stam's paper on real-time fluid dynamics for games presents a simple, efficient, and most importantly unconditionally stable method that achieves aesthetically pleasing results. We would like to implement a 3D simulation based on his work, which we will pass to PBRT as a volumetric texture.
Jos Stam, "Real-Time Fluid Dynamics for Games". Proceedings of the Game Developer Conference, March 2003.
Jos Stam, "Stable Fluids", In SIGGRAPH 99 Conference Proceedings, Annual Conference Series, August 1999, 121-128.
Dynamics
Additionally, we are interested in simulating foam's dynamics over a non-static surface (such as water in a bathtub ). We suspect believable results could be achieved using a crude mass-spring model, since the main property we observed is a severe damping of the high frequence modes of the water surface.
Division of Work
Step 1: Sean will augment PBRT with film-interference, while Mattias developes the brute-force geometric model of the foam. Step 2: The subsurface scattering foam model will be developed by both of us. One of us is likely to focus on developing the foam BSSDF and the other extending PBRT with subsurface scattering (preferably based on one of Henrik Wann Jensen's recent papers). Additionally, we will apply subsurface scattering to other materials in the scene, such as a rubber duck and leaves, using known BSSDFs. Step 4: One of us will integrate the two models. The other member will define formations of foam (e.g. using meta-balls) and its interface with fluid. Step 5: If at this point our foam looks great and we have some time to spare, we will add some other things for kicks, like steam, foam dynamics, and procedural textures.