Articles

How to Create Photorealistic Foam and Bubbles in CGI

ARTILABZ™

ARTILABZ™ gives you unlimited access to all Houdini courses, 3D assets, simulation files, textures and tools. updated every month.

Everything You Need to master Houdini.

01

Premium Houdini Tutorials

Full access to every course — fluid simulation, procedural FX, brand visuals and more.

02

Monthly New Content

Fresh tutorials and assets added every month — your library grows with you.

03

Instant Access to Everything

The moment you join, the full library is yours — no drip-feed, no waiting.

04

Project Files Included

Every tutorial comes with the full Houdini scene file — open every node, learn every detail.

FROM 14.99€/MONTH

Includes one exclusive complete course

The exclusive course — a full production tutorial you won't find anywhere else, never sold alone.

Best Seller
Most Loved
Tutorial Camera Rig

ADVANCED CUSTOM CAMERA RIG

ANIMATION · CONSTRAINTS · CUSTOM UI

BUILD A FULLY CUSTOM CONSTRAINT-BASED CAMERA RIG IN HOUDINI WITH A CUSTOM UI PANEL. DESIGN FLEXIBLE SYSTEMS FOR PRECISE, CINEMATIC CAMERA ANIMATION ON ANY PROJECT.

€29.99

Freebies
Free Studio HDRI Pack box by Artivoxa showing 60 studio lighting setups with softboxes wrapped around the packaging

Studio HDRI Collection

ASSETS · EXR & HDR · 60 HDRIS

DOWNLOAD 60 STUDIO HDRIS CAPTURED IN A REAL PHOTO STUDIO. LIGHT YOUR PRODUCT AND BEAUTY RENDERS LIKE A PHOTOGRAPHER — SOFTBOX, LANTERN, STRIP AND GRID SETUPS, READY FOR ANY RENDERER.

FREE

How to Create Photorealistic Foam and Bubbles in CGI

Ever spent hours tweaking your foam simulation only to watch it collapse into a flat, plasticky mess? Wondering why your bubbles never catch that soft translucency you see in high-end photorealistic foam shots?

It’s frustrating when every tweak in Houdini feels like guesswork. One wrong parameter and your microbubbles vanish, or your mesh explodes. Slow caches and unpredictable surface tension can stall a project.

In this guide, you’ll discover a clear CGI workflow for generating lifelike bubbles and foam. We’ll cover simulation setup, shading basics, and optimization techniques to keep your renders fast and stable.

By the end, you’ll understand how to balance particle emission, control surface tension, and apply material settings that hold up under close-up inspection. Say goodbye to flat splashes and hello to convincing sea spray.

What references, visual goals and level-of-detail should you define before starting?

Before diving into a photorealistic foam sim in CGI, gather targeted references: high-res stills, slow-motion footage of cresting waves, bath bubbles or beer head. Note bubble size distribution, translucency and clustering. Annotate lighting angles and rim highlights to calibrate your shader’s scattering and refraction parameters in Houdini.

Define visual goals by camera distance and shot duration. For close-ups you’ll need per-bubble geometry or microfoam volumetrics with VDB-based scattering. Mid-range shots may rely on instanced spheres with animated UV foam masks. For background plates, plan to use foam textures or flipbook sprites to save memory and render time.

Establish level-of-detail tiers early. Common LOD breakdown:

  • LOD0: Full FLIP + particle foam to VDB conversion
  • LOD1: Instanced bubble clusters with noise-driven scale
  • LOD2: Texture overlays or flipbook sprites at distance

In Houdini, organize each LOD in separate subnetworks. Parameterize switch thresholds based on camera proximity using a CHOP or Python expression. This procedural setup ensures automatic blending between detailed and lightweight foam elements as the camera moves, maintaining both realism and performance.

How do you set up a reliable base fluid simulation in Houdini (FLIP: resolution, seeding, boundary and emitter setup)?

Begin by creating a FLIP Object node. Set the Particle Separation—this value drives your effective resolution: 0.05 for preview, 0.02–0.03 for final. Lower separation equals smaller particles and crisper fluid detail. Always match your geometry SDF and emitter field voxel sizes to this separation to avoid artifacts.

For boundaries, convert collision geometry to a signed distance field with a VDB From Polygons SOP. Set the Voxel Size equal to your Particle Separation and enable anti‐aliasing. Inside the DOP network, link it as a Static Object, using the SDF as the collision volume—it guarantees your particles respect container walls without leaks.

Emitters are defined via a FLIP Source DOP. Use “Volume” emission mode: input a volume or surface group that captures your emitter geo. Match its Volume Rasterization Voxel Size to Particle Separation, then adjust the Emission Region Union or Pyro Path to seed evenly. Enable “Transfuse” to fill any inside pockets.

  • Particle Separation: primary resolution control
  • VDB From Polygons: generates collision SDF
  • FLIP Source: manages fluid seeding
  • Static Object SDF: reliable boundary enforcement
  • Substeps: increase to 2–3 for high velocity regions

Finally, fine‐tune time step substeps on the FLIP Solver to stabilize splashes. Two to three substeps prevent jitter in fast chases. Always visualize the particle count and SDF overlap with temporary guides—this procedural checklist ensures a stable, high‐fidelity simulation ready for foam and bubble generation.

How do you generate foam, spray and entrained bubbles from the FLIP simulation (sources, attributes and particle solvers)?

To separate foam, spray and entrained bubbles, we leverage Houdini’s FLIP points and per-point attributes inside a DOP Network. By feeding FLIP into multiple POP Solver chains via POP Source nodes, each element can be emitted under different physical criteria. This approach yields independent particle streams for realistic shading and motion.

Begin by wiring a FLIP Solver and FLIP Object into three POP Source nodes. Set each POP Source to read from your FLIP Object but use a distinct birth expression or group mask. This isolates foam, spray and bubbles before they enter their respective POP Solver contexts.

  • Foam: In a SOP Solver upstream, compute curvature on FLIP points (e.g., using a Point Wrangle: @curv=curvature(0,@P);). In the POP Source, set Birth Expression to @curv>foam_thresh.
  • Spray: Use a birth test on speed and surface mask: length(@v)>spray_speed && @surface==1. “Surface” can be the rest–dynamic SDF difference.
  • Bubbles: Generate a “bubble_density” volume in a SOP Solver by sampling pressure or divergence. In POP Source, filter by bubble_density>low && bubble_density<high.

Within each POP Solver, tailor forces and lifespans. For foam, assign a longer life and moderate drag linked to @curv. For spray, enable gravity, high air resistance, and a short TTL. For entrained bubbles, use buoyancy force in the POP Solver’s Forces tab, then set point size via a POP Wrangle (@pscale=fit(bubble_density,0,1,0.005,0.02);).

Finally, merge your three particle streams with a DOP Import Points node back in SOPs. Group by type, then instance geometry or volume-rasterize for rendering. This procedural, attribute-driven setup ensures each secondary fluid effect behaves and renders in a physically believable manner.

How should you shade foam and bubbles for photorealism (material approach and AOV planning)?

Shading white foam and microfoam: scattering, roughness, opacity masks and procedural detail

To achieve photorealistic foam, begin with a layered material: a thin water film over a volumetric microfoam layer. In Houdini’s Material context, use the Principled Shader for the film and a Volume VOP for microfoam. Assign a low-thickness, high-specular coat to the film, then plug a pyro noise–driven mask into its opacity to simulate soap residue.

For the underlying microfoam, enable subsurface scattering in the Volume VOP. Set the scattering distance to mimic microscopic bubble clusters (~0.1–1 cm). Drive the scattering color slightly warm (RGB 0.9,0.95,1) to replicate light absorption. Control roughness with a particle-size attribute: small bubbles yield smoother reflections, larger ones rougher. Use particle age or radius attributes from POPs to blend between roughness values.

Procedural detail is key. Feed additional fractal noise into the surface bump of the film layer for tiny ripples. Combine Voronoi noise in the microfoam volume to break uniformity. Finally, generate an AOV mask for foam regions and another for microfoam depth; this separation allows precise compositing of scattering and specular contributions.

Shading spherical soap bubbles: thin-film interference, refraction, IOR and caustic considerations

Spherical soap bubbles rely on thin-film interference and accurate refraction. In Houdini, create a custom VOP network or use MaterialX’s Thin-Film node. Compute optical path difference from film thickness (100–300 nm) and feed into an RGB layer mixer to simulate iridescence. Vary thickness procedurally per bubble using a mapped attribute.

Assign an IOR of 1.33 to both sides of the thin film and enable two-sided refraction in Karma or Mantra. Keep the surface roughness near zero for crisp reflections. Plug the thin-film color into the base color input so that the iridescent hues modulate reflection and refraction simultaneously. Use an HDRI environment to capture realistic sky and studio light reflections.

For caustics, enable photon mapping or path-traced caustics. Define caustic AOVs—direct, indirect, specular and caustic passes—to isolate light patterns. In production, render a separate caustic AOV and blend in compositing. Adjust photon count and gather radius to avoid noise while preserving sharp bright spots.

  • Foam Mask AOV: isolates white foam for compositing
  • Microfoam Depth AOV: controls scattering falloff
  • Thin-Film AOV: captures interference colors
  • Caustics AOV: fine-tunes light patterns under bubbles

How do you render and light foam and bubbles efficiently (sampling, denoising, LODs and useful AOVs)?

First, control sampling budgets by using Houdini’s LOD workflows. In SOPs, generate three foam proxies—high-res spheres, medium-res icospheres and flat billboards—then drive a Switch SOP based on camera distance. In Solaris LOPs, tag each proxy with a lod attribute (lod0, lod1, lod2). In the Mantra ROP, set adaptive pixel samples to 2×2 base and 6×6 max with a low variance threshold to focus rays on bubble edges.

Next, leverage built-in denoising with Karma XPU’s Intel OpenImageDenoise. In the Render Settings ROP, enable AOV extraction: output separate specular_direct, specular_indirect, diffuse and transmission passes. Run denoise on the combined beauty layer while preserving high-frequency specular AOVs. In Solaris’s Render Settings, route OpenImageDenoise only on the beauty buffer to retain crisp bubble highlights.

Key AOVs to export for precise compositing:

  • depth – for accurate focus and overlap
  • foam_mask – generated via a Foam Shader mask
  • specular_direct – isolates direct bubble reflections
  • transmission – captures light passing through bubbles

Finally, optimize your LODs by culling off-screen foam using Houdini’s ROP Geometry Freeze or procedural bounding checks. Lower-res proxies reduce ray counts dramatically at distance, while high-res spheres near the camera preserve photorealistic detail without overspending samples.

How do you composite, optimize and troubleshoot common issues (flicker, popping, memory and scale mismatches)?

In a CGI pipeline, compositing photorealistic foam begins with exporting dedicated AOVs: foam density, velocity, and depth. In Houdini, use the Mantra ROP to bake these passes and import them into your compositing tool. Blend foam over the liquid base using the Z-depth pass to correct occlusion. Apply a subtle color grade on foam density to mimic light scattering in real water, ensuring integration without harsh edges.

Troubleshooting flicker and popping requires both simulation and post adjustments. First, refine substeps in your DOP network—raise the Frame Substep Count to smooth rapid accelerations. Next, apply temporal filtering in compositing or add a TimeBlend node to distribute samples. Common fixes include:

  • Increase substeps or adjust CFL in Flip Solver to reduce sudden velocity changes
  • Enable particle separation in Pop Solver to prevent clustering artifacts
  • Use Volume Smooth SOP on density fields to remove edge noise
  • Implement a slight motion blur via the Mantra VEX blur or a dedicated Blur node

Memory optimization hinges on selective caching and instancing. Crop your volume caches to the region of interest using a Volume Crop SOP, then write one compressed .bgeo.sc per range of frames. For high-density foam, use packed primitives or GPU instanced sprites with a Particle Fluid Surface SOP. This approach slashes viewport overhead and accelerates render I/O.

Scale mismatches often stem from inconsistent unit settings between SOP and DOP contexts. Always verify Houdini’s scene scale (Meters vs Centimeters) under Hip File Options. In DOPs, adjust solver parameters—like Voxel Size on the FLIP Tank—to match your scene units. When integrating foam into larger water bodies, align grid resolution and particle separation to maintain consistent droplet sizes and avoid visual discontinuities.

— FOREVER FREE —

Free Studio HDRI Pack box by Artivoxa showing 60 studio lighting setups with softboxes wrapped around the packaging
  • Blender
  • Cinema 4D
  • Houdini
  • Maya
  • 3ds Max
  • Unreal
  • Redshift
  • Octane
  • Karma
  • Cycles
  • Arnold
  • V-Ray
  • Corona

60 studio lighting HDRIs in one free pack — softboxes, lanterns, strip boxes, grids, top-light and three-point setups, all shot in a real photo studio.