BubbleX:面向移动 AR 的实时物理仿真与性能架构 BubbleX: Real-Time Physics Simulation and Performance Architecture for Mobile AR
摘要Abstract
移动端增强现实(AR)中的交互式薄膜仿真受限于 SoC 功耗预算、热降频以及 ARKit / ARCore 的基础跟踪开销。BubbleX 在可控的同屏规模下,围绕解析降阶模型与唯象模型构建了一套实时仿真架构。 Interactive thin-film simulation in mobile augmented reality (AR) is limited by SoC power budgets, thermal throttling, and the baseline tracking cost of ARKit / ARCore. BubbleX builds a real-time simulation architecture around analytic reduced-order and phenomenological models, within a controlled on-screen scale.
运动层采用无散度旋度噪声(curl noise)作为背景湍流,结合半经验吹气射流模型、球谐毛细振动(满足 $R^{-1.5}$ 标度律)与 Plateau 双泡几何;飘落物体则遵循帧率无关的空气动力学模型。渲染层将 Airy 薄膜干涉与离线光谱查找表(LUT)、唯象重力排液、牛顿黑膜(Newton black film)以及标志性的正倒双反射结合在一起。 The motion layer uses divergence-free curl noise as background turbulence, together with a semi-empirical jet model, spherical-harmonic capillary oscillation (with $R^{-1.5}$ scaling), and Plateau double-bubble geometry; falling objects follow a frame-rate-independent aerodynamic model. The rendering layer combines Airy thin-film interference with an offline spectral lookup table (LUT), phenomenological gravity drainage, Newton black film, and the characteristic upright/inverted double reflection.
性能通过屏幕空间自适应着色细节、动态网格合批以及分平台热控制帧率策略来管理。在 Pixel 8 同场景实测中,整机电流从固定 60 fps 时的约 2.05 A 降至固定 30 fps 时的约 1.27 A。 Performance is managed through screen-space adaptive shading detail, dynamic mesh batching, and per-platform thermal frame-rate control. On a Pixel 8 in the same scene, whole-device current dropped from about 2.05 A at a fixed 60 fps to 1.27 A at a fixed 30 fps.
1. 引言1. Introduction
在消费级手机上运行实时 AR 肥皂泡仿真,需要在三项约束之间取得平衡:(1)感知敏感度:叠加在实时相机画面之上时,生硬的匀速漂浮、相互穿模或塑料般的静态高光都会立刻显得虚假;(2)固定 AR 开销:ARKit 与 ARCore 持续运行视觉惯性里程计(VIO)和平面估计,留给应用本身的只是剩余帧预算;(3)散热限制:大面积半透明叠加会推高像素填充率(fill-rate)开销并触发热降频。 Running a real-time AR soap-bubble simulation on consumer phones means balancing three constraints: (1) perceptual sensitivity: composited over live camera video, uniform drift, interpenetration, or static plastic highlights immediately look fake; (2) fixed AR overhead: ARKit and ARCore continuously run visual-inertial odometry and plane estimation, leaving only the remaining frame budget; (3) thermal limits: large translucent overlays drive up fill-rate cost and trigger throttling.
1.1 物理尺度与无量纲数1.1 Physical scales and dimensionless numbers
BubbleX 面向厘米至分米级泡泡($R \in [0.01,\ 0.4]\text{ m}$)以及低速气流中的轻质 3D 物体($v_{\text{rel}} \sim 0.05\text{--}1.0\text{ m/s}$,$\rho_{\text{air}} \approx 1.2\text{ kg/m}^3$,$\nu \approx 1.5 \times 10^{-5}\text{ m}^2/\text{s}$,液膜表面张力 $\sigma \approx 0.03\text{ N/m}$,双界面有效表面张力 $2\sigma \approx 0.06\text{ N/m}$)。三个无量纲数决定了整体架构设计: BubbleX targets centimeter-to-decimeter bubbles ($R \in [0.01,\ 0.4]\text{ m}$) and light 3D objects in slow air ($v_{\text{rel}} \sim 0.05\text{--}1.0\text{ m/s}$, $\rho_{\text{air}} \approx 1.2\text{ kg/m}^3$, $\nu \approx 1.5 \times 10^{-5}\text{ m}^2/\text{s}$, film surface tension $\sigma \approx 0.03\text{ N/m}$, effective double-interface value $2\sigma \approx 0.06\text{ N/m}$). Three dimensionless numbers organize the design:
- 雷诺数(Reynolds number):$Re = \dfrac{2 R v_{\text{rel}}}{\nu} \sim 10^2\text{--}10^4$。对于球体,当 $Re \approx 270$ 以下时尾流稳定且对称;高于该阈值则开始出现非定常三维涡街脱落。因此快速吹气或挥动手机阶段不能仅依赖稳态阻力,而需要引入尾流脱落摆动近似。 Reynolds number: $Re = \dfrac{2 R v_{\text{rel}}}{\nu} \sim 10^2\text{--}10^4$. For a sphere, the wake is steady and symmetric below $Re \approx 270$; above it, unsteady three-dimensional vortex shedding begins. Fast blowing and waving phases therefore cannot rely on steady drag alone and need a wake-shedding sway approximation.
- 斯特劳哈尔数(Strouhal number):在中高 $Re$ 区间,$St = \dfrac{f \cdot 2R}{v_{\text{rel}}} \approx 0.2$,它决定了高速运动的大泡泡的横向摆动频率(第 4.3 节)。 Strouhal number: $St = \dfrac{f \cdot 2R}{v_{\text{rel}}} \approx 0.2$ in the mid-to-high $Re$ range, which sets the lateral sway frequency of fast, large bubbles (Section 4.3).
- 韦伯数(Weber number):$We = \dfrac{\rho_{\text{air}} v_{\text{rel}}^2 (2R)}{2\sigma}$。刚脱离泡泡环时($v_{\text{rel}} \sim 0.5\text{--}1.0\text{ m/s}$,$R = 0.05\text{ m}$),$We = \mathcal{O}(1)$:气动压力与表面张力相当,解释了初始阶段的剧烈形变振荡。进入自由漂浮阶段后($v_{\text{rel}} \sim 0.05\text{--}0.15\text{ m/s}$),$We \approx 0.005\text{--}0.045 \ll 1$:表面张力占主导达一到两个数量级,因此小振幅球谐模态足以在物理上合理地替代全自由表面 CFD。 Weber number: $We = \dfrac{\rho_{\text{air}} v_{\text{rel}}^2 (2R)}{2\sigma}$. At release from the wand ($v_{\text{rel}} \sim 0.5\text{--}1.0\text{ m/s}$, $R = 0.05\text{ m}$), $We = \mathcal{O}(1)$: aerodynamic pressure and surface tension are comparable, which explains the strong initial oscillation. During free floating ($v_{\text{rel}} \sim 0.05\text{--}0.15\text{ m/s}$), $We \approx 0.005\text{--}0.045 \ll 1$: surface tension dominates by one to two orders of magnitude, so small-amplitude spherical-harmonic modes are a physically sound substitute for full free-surface CFD.
2. 相关工作2. Related Work
- 肥皂膜渲染与泡沫动力学。Glassner [11] 系统综述了肥皂膜的物理光学;Ďurikovič [12] 使用质点弹簧模型仿真泡泡形变、聚集与碰撞;Iwasaki 等 [13] 利用预计算二维反射率查找表实现少数泡泡的实时渲染。Da 等 [14]、Ishida 等 [16] 与 Huang 等 [15] 以极高保真度求解液膜流动、厚度演化与表面活性剂输运,但其开销远超同屏百个泡泡的移动 AR 帧预算。Plateau [2]、Rayleigh [3]、Lamb [4]、Taylor [5] 与 Culick [6] 提供了经典的静力学、毛细波与液膜破裂理论结果。 Soap-film rendering and foam dynamics. Glassner [11] surveys the physical optics of soap films; Ďurikovič [12] simulates bubble deformation, clustering, and collision with mass-spring models; Iwasaki et al. [13] render a few bubbles in real time using a precomputed 2D reflectance LUT. Da et al. [14], Ishida et al. [16], and Huang et al. [15] resolve film flow, thickness evolution, and surfactant transport with high fidelity, at a cost too high for a mobile AR frame budget with a hundred bubbles on screen. Plateau [2], Rayleigh [3], Lamb [4], Taylor [5], and Culick [6] supply the classical statics, capillary-wave, and film-rupture results.
- 过程化湍流与薄膜光学。Bridson 等 [1] 提出了旋度噪声作为低成本、保体积的湍流源;Born & Wolf [7] 与 Schlick [8] 给出了 Airy 公式与 Fresnel 近似。BubbleX 在 Iwasaki 等 [13] 的 LUT 思路基础上,将其拓展至竖屏广角 AR,并结合了解析球谐模态、Plateau 双泡几何、唯象排液、牛顿黑膜管线以及屏幕空间细节控制。 Procedural turbulence and thin-film optics. Bridson et al. [1] introduced curl noise as a cheap, volume-preserving turbulence source; Born & Wolf [7] and Schlick [8] provide the Airy formula and Fresnel approximation. BubbleX builds on the LUT idea of Iwasaki et al. [13] and extends it to portrait wide-angle AR with analytic spherical-harmonic modes, Plateau double-bubble geometry, phenomenological drainage, a Newton black film pipeline, and screen-space detail control.
- 轻质物体空气动力学。Andersen 等 [9](飘动平板)与 Cummins 等 [10](蒲公英分离涡环)为我们的多物种阻力模型提供了启发。BubbleX 的工程贡献在于将多物种阻力、多泡泡几何以及平台热控制帧率策略压缩进同一套跨帧率行为一致的实时架构中。 Light-object aerodynamics. Andersen et al. [9] (fluttering plates) and Cummins et al. [10] (dandelion separated vortex ring) inform our species-specific drag models. BubbleX’s engineering contribution is compressing multi-species drag, multi-bubble geometry, and platform thermal frame-rate policy into one real-time architecture with consistent behavior across frame rates.
3. 系统架构3. System Architecture
BubbleX 将核心仿真层与平台 AR 接口层解耦。核心层仅依赖三项抽象输入:吹气强度、场景碰撞查询与环境反射贴图。平台差异由适配层吸收,当某项能力不可用时自动优雅降级。每一帧依次执行风场采样、泡泡与飘落物仿真、带细节分级的视图同步以及双通道薄膜渲染。在提交渲染前的最后一刻,手持泡泡环会重新对齐至最新的相机位姿,以消除快速旋转时的拖拽延迟。 BubbleX separates a core simulation layer from a platform AR interface layer. The core depends only on three abstract inputs: blow intensity, scene collision queries, and an environment reflection map. Platform differences are absorbed by an adapter layer, with graceful degradation when a capability is missing. Each frame performs wind-field sampling, bubble and falling-object simulation, view synchronization with detail grading, and two-pass film rendering. Just before render submission, the hand-held wand is re-aligned to the latest camera pose to avoid drag lag during fast rotation.
4. 空气动力学与泡泡运动学4. Aerodynamics and Bubble Kinematics
4.1 无散度旋度噪声湍流4.1 Divergence-free curl-noise turbulence
为避免粒子在汇点(sink)处聚集,我们用三组带偏移的 3D Simplex 噪声构造矢势 $\mathbf{\Psi}(\mathbf{p}, t)$,并取其旋度作为背景湍流: To avoid particle clustering at sinks, a vector potential $\mathbf{\Psi}(\mathbf{p}, t)$ is built from three offset 3D simplex noises, and the background turbulence is its curl:
$$\mathbf{v}_{\text{curl}}(\mathbf{p}, t) \propto \nabla \times \mathbf{\Psi}(\mathbf{p}, t)$$由于 $\nabla \cdot (\nabla \times \mathbf{\Psi}) = 0$,湍流基底严格无散。吹气射流、手部扇风推力与近相机避让场属于局部动量源,并不无散;因此总采样风场仅在自由湍流区域近似无散。 Since $\nabla \cdot (\nabla \times \mathbf{\Psi}) = 0$, the turbulence base is divergence-free. The blow jet, hand-fan thrust, and near-camera avoidance fields are local momentum sources and are not; the total sampled field is approximately divergence-free only in free turbulent regions.
4.2 半经验吹气射流与近场交互4.2 Semi-empirical blow jet and near-field interaction
吹气过程由受湍流圆射流自相似性启发的半经验降阶射流模型描述:风速沿出流方向随距离衰减,并随偏轴角在横向上收窄。仅当泡泡位于嘴部前方且检测到吹气时激活,停止吹气后呈指数衰减。近距离挥动手机会施加单向“扇风”推力;靠近镜头处指向相机的风场分量会被衰减,以防止泡泡穿入观察者面部。 Blowing is modeled by a semi-empirical reduced-order jet inspired by the self-similarity of turbulent round jets: it decays with distance along the outflow direction and narrows laterally with off-axis angle. It is active only when the bubble is in front of the mouth and blowing is detected, and decays exponentially after blowing stops. Waving the phone at close range adds a one-way “fan” thrust, and wind components pointing at the camera are attenuated near the lens to prevent bubbles from clipping into the viewer’s face.
4.3 单泡泡运动的耦合机制4.3 Coupled mechanisms of single-bubble motion
- 暖气浮力:刚吹出的泡泡因呼气温度略高于室温而轻微上升,并随存在时间呈指数冷却。 Warm-breath buoyancy: freshly blown bubbles rise slightly and cool exponentially with age.
- 尺寸相关的惯性滞后:由于附加质量效应,较大的泡泡对气流变化的响应更慢。 Size-dependent inertial lag: larger bubbles respond more slowly to airflow because of added mass.
- 尾流启发摆动:当 $Re$ 超过三维涡脱区间(第 1.1 节)时,叠加按 $St \approx 0.2$ 标度的横向振荡,主要在快速吹气或挥动时显现。 Wake-inspired sway: when $Re$ exceeds the 3D shedding regime (Section 1.1), a lateral oscillation with $St \approx 0.2$ scaling is added, visible mainly in fast blowing or waving moments.
- 涡量驱动自旋:较大泡泡的自旋角速度趋向于局部空气涡量的一半,带动表面干涉花纹旋转。 Vorticity-driven spin: larger bubbles spin toward half the local air vorticity, rotating the surface pattern.
- 近壁缓冲:靠近 AR 平面时法向速度降低。这是受气垫效应启发的经验缓冲,并非解析挤压膜解。净沉降速度也经过刻意放慢,以保留充足的近距离观察与互动窗口。 Near-wall cushion: normal velocity is reduced near AR planes. This is an empirical cushion inspired by air-cushion effects, not an analytic squeeze-film solution. Net settling speed is deliberately slowed to preserve a close-up viewing and interaction window.
5. 多体力学、Plateau 几何与毛细波5. Multi-Body Mechanics, Plateau Geometry and Capillary Waves
5.1 气体惯性与碰撞代理质量5.1 Gas inertia and collision proxy mass
对于厘米级泡泡,液膜本身的质量远小于内部包裹空气及周围流体的附加质量,因此有效惯性由气体主导($m_{\text{eff}} \propto \rho_{\text{air}} R^3$),由此得到毛细振动标度律 $\omega \propto R^{-1.5}$(第 5.3 节)。然而在低速碰撞中,若直接按 $R^3$ 计算冲量,大小泡泡之间的质量比会过于悬殊,导致小泡泡被不自然地弹飞。因此碰撞模块采用工程代理质量来保持接触柔和。 For a centimeter-scale bubble, the film itself is far lighter than the enclosed air and the added mass of the surrounding flow, so effective inertia is gas-dominated ($m_{\text{eff}} \propto \rho_{\text{air}} R^3$), giving the capillary scaling $\omega \propto R^{-1.5}$ (Section 5.3). In low-speed collisions, however, using $R^3$ for impulses would make the mass ratio between large and small bubbles extreme and fling small bubbles away unnaturally. The collision module therefore uses an engineered proxy mass to keep contact gentle.
5.2 Plateau 双泡几何5.2 Plateau double-bubble geometry
根据 Plateau 定律 [2],半径分别为 $r_a, r_b$ 的两个泡泡与公共隔膜在交界处呈 $120^\circ$ 相交。由于球半径垂直于球面,交界处两半径之间的夹角为 $60^\circ$,由余弦定理可得稳定球心距: By Plateau’s law [2], two bubbles of radii $r_a, r_b$ and their shared septum meet at $120^\circ$. Since sphere radii are normal to the surfaces, the angle between the two radii at the junction is $60^\circ$, and the law of cosines gives the stable center distance:
$$D = \sqrt{r_a^2 + r_b^2 - 2 r_a r_b \cos 60^\circ} = \sqrt{r_a^2 + r_b^2 - r_a r_b}$$对于不等大的双泡,Young–Laplace 压差会使隔膜向较大泡泡一侧凸起,其曲率半径为 $r_{\text{cap}} = \frac{r_a r_b}{|r_a - r_b|}$,两球半径越接近则隔膜越趋于平坦。此处采用标准静态解(作为视觉近似省略了体积修正);隔膜作为独立液膜绘制,两个泡泡内部的球冠部分被裁剪。只有尺寸足够大、已自由漂浮片刻且缓慢接近的普通泡泡才能合并为双泡;高速碰撞则发生弹开。当任一泡泡破裂或触及表面时,另一半会伴随弹性回弹释放。 For unequal bubbles, the Young–Laplace pressure difference bulges the septum toward the larger bubble with curvature radius $r_{\text{cap}} = \frac{r_a r_b}{|r_a - r_b|}$, flattening as the radii approach each other. This is the standard static solution (volume corrections omitted as a visual approximation); the septum is drawn as a separate film, and the interior spherical caps of each bubble are clipped. Only ordinary bubbles that are large enough, have floated freely for a moment, and approach slowly can merge into a double bubble; faster impacts bounce. When either bubble pops or touches a surface, the other is released with an elastic rebound.
5.3 Rayleigh–Lamb 毛细标度与破裂动画5.3 Rayleigh–Lamb capillary scaling and the burst animation
根据 Rayleigh–Lamb 理论 [3, 4],取双界面有效表面张力 $\sigma_{\text{eff}} = 2\sigma$,第 $l$ 阶球谐模态的角频率为: By Rayleigh–Lamb theory [3, 4], with effective double-interface tension $\sigma_{\text{eff}} = 2\sigma$, the frequency of spherical-harmonic mode $l$ is:
$$\omega_l = \sqrt{\frac{l(l^2 - 1)(l + 2)\,\sigma_{\text{eff}}}{R^3 [(l + 1)\rho_i + l\rho_o]}}$$在无粘极限下,$R = 0.05\text{ m}$ 的泡泡有 $\omega_2 \approx 43.8\text{ rad/s}$(约 $7\text{ Hz}$),而 $R = 0.02\text{ m}$ 的泡泡约为 $27.6\text{ Hz}$,高于 30 fps 屏幕 $15\text{ Hz}$ 的奈奎斯特频率,会产生时间混叠。BubbleX 保留了理论的相对标度关系并调低绝对基频,从而避免闪烁并呈现更柔和的弹性响应。形变轮廓在顶点着色器中合成。 In the inviscid limit, a bubble with $R = 0.05\text{ m}$ has $\omega_2 \approx 43.8\text{ rad/s}$ (about $7\text{ Hz}$) and one with $R = 0.02\text{ m}$ about $27.6\text{ Hz}$, above the $15\text{ Hz}$ Nyquist frequency of a 30 fps display, which would cause temporal aliasing. BubbleX keeps the theoretical relative scaling and slows the absolute base frequency, avoiding flicker and giving a softer elastic response. Deformation profiles are synthesized in the vertex shader.
至于破裂过程,Taylor–Culick 回缩速度 $v = \sqrt{2\sigma / (\rho h)} \approx 10\text{--}35\text{ m/s}$ [5, 6] 意味着厘米级泡泡在不到一帧的时间内就会完全破裂。因此破裂动画被刻意拉伸至约一百毫秒,使扩张的液膜边缘与飞溅水雾能够被人眼清晰感知。 For rupture, the Taylor–Culick retraction speed $v = \sqrt{2\sigma / (\rho h)} \approx 10\text{--}35\text{ m/s}$ [5, 6] means a centimeter-scale bubble bursts in under one frame. The burst animation is deliberately stretched to roughly a hundred milliseconds so the expanding rim and spray remain perceptible.
6. 多物种唯象空气动力学6. Multi-Species Phenomenological Aerodynamics
泡泡破裂后释放的轻质 3D 物体采用受文献启发的唯象空气动力学模型。为每种物体设定目标终端沉降速度并据此标定二次阻力系数,以在近距离 AR 中提供舒适的观赏节奏。 Light 3D objects released by popped bubbles use phenomenological aerodynamic models inspired by the literature. A target terminal settling speed is chosen per species and the quadratic drag coefficient is calibrated from it, giving a comfortable viewing pace in close-up AR.
| 物体类别Object | 物理启发来源Physical inspiration | 姿态与耦合行为Orientation and coupling |
|---|---|---|
| 花瓣(扁平薄片)Petals (flat plates) | 受 Andersen 等 [9] 启发的各向异性二次阻力与周期扰动Anisotropic quadratic drag with periodic perturbation, inspired by Andersen et al. [9] | 扶正力矩与周期性摆动产生轻柔的“之”字形滑翔Righting torque and periodic sway produce a soft zig-zag glide |
| 整朵花(降落伞状)Whole flowers (parachute-like) | 碗状高阻力伞面Bowl-shaped high-drag canopy | 扶正力矩保持碗口朝上,并伴随缓慢稳定的自旋Righting torque keeps the bowl upward, with slow steady spin |
| 蒲公英(冠毛)Dandelions (pappus) | 受 Cummins 等 [10] 发现的分离涡环启发Inspired by the separated vortex ring of Cummins et al. [10] | 底部配重提供类似单摆的回复力矩;微风即可将其吹得很远Bottom ballast gives a pendulum-like restoring torque; a light breeze carries them far |
| 爱心(钝体)Hearts (bluff bodies) | 低阻力轻质钝体Low-drag light bluff body | 翻滚下落,触地时带有弹性回弹Tumbling descent with elastic bounce on landing |
| 其他轻质物体Other light objects | 主动浮力螺旋轨迹与偏心质量滚动Active-buoyancy spiral paths and off-center-mass rolling | 落地物体可被新的气流重新吹起;柔体形变在顶点着色器中执行Landed objects can be re-lofted by new airflow; soft deformation runs in the vertex shader |
7. 变帧率稳定性7. Variable Frame-Rate Stability
平台帧率会在 60、30 与 10 fps(空闲)之间切换,因此数值积分必须保证物理行为与帧率无关: Platform frame rate switches among 60, 30, and 10 fps (idle), so the numerics must keep behavior independent of frame rate:
- 上限子步进(Capped sub-stepping):每帧划分为有限个等长子步并设置硬上限,避免追赶帧率时的“死亡螺旋”。碰撞分离按物理时间换算为速率,使不同帧率下的泡泡间距保持一致。 Capped sub-stepping: each frame is split into a limited number of equal sub-steps with a hard cap, avoiding the catch-up “death spiral”. Collision separation is converted to a rate over physical time so bubble spacing stays consistent across frame rates.
- 解析一阶松弛:风场跟随与涡量驱动自旋使用精确解析更新,不引入额外的数值阻尼。 Analytic first-order relaxation: wind following and vorticity-driven spin use the exact analytic update, adding no numerical damping.
- 步长无关的终端速度:常见的“先指数阻尼、再叠加重力”分裂格式会导致稳态下落速度随步长漂移。以示例参数 $K = 240\text{ m}^{-1}$(目标值 $\approx 0.202\text{ m/s}$)为例,步长 $h = 10.5 / 16.7 / 20\text{ ms}$ 会分别给出 $0.232 / 0.255 / 0.270\text{ m/s}$,不同帧率下的飘落节奏将出现明显差异。BubbleX 采用半隐式阻尼格式,其离散稳态终端速度严格独立于步长,且阻尼更新永不超调。真机回归测试显示终端速度误差 $< 0.01\%$,跨帧率碰撞间距误差 $< 0.5\%$。 Step-independent terminal velocity: the common split of “exponential damping, then add gravity” makes steady fall speed drift with step size. With an illustrative $K = 240\text{ m}^{-1}$ (target $\approx 0.202\text{ m/s}$), steps of $h = 10.5 / 16.7 / 20\text{ ms}$ give $0.232 / 0.255 / 0.270\text{ m/s}$, so falling pace would differ across frame rates. BubbleX uses a semi-implicit damping scheme whose discrete steady-state terminal velocity is independent of step size and whose damping update never overshoots. On-device regression tests show terminal-velocity error $< 0.01\%$ and cross-frame-rate collision spacing error $< 0.5\%$.
8. 薄膜光学与 AR 合成8. Thin-Film Optics and AR Compositing
8.1 Airy 多光束干涉与光谱查找表8.1 Airy multi-beam interference and spectral LUT
对于空气–液膜($n_{\text{film}} = 1.33$)–空气三层结构,Born & Wolf [7] 给出了相位差与 Airy 反射率: For an air–film ($n_{\text{film}} = 1.33$)–air system, Born & Wolf [7] give the phase difference and Airy reflectance:
$$\delta(\lambda) = \frac{4\pi n_{\text{film}} h \cos\theta_t}{\lambda}, \qquad R(\lambda) = \frac{4 F \sin^2(\delta/2)}{(1 - F)^2 + 4 F \sin^2(\delta/2)}$$其中界面反射率 $F = F_0 + (1 - F_0)(1 - \cos\theta_i)^5$ 来自 Schlick 近似 [8](水膜取 $F_0 = 0.02$)。当 $h \to 0$ 时,$R(\lambda) \to 0$,表现为黑色透明窗口。渲染管线同时支持解析 RGB 三波长模式以及遵循 Iwasaki 等 [13] 的二维离线光谱查找表(LUT):在离线阶段将可见光谱对标准观察者函数积分并转换至显示色域,运行时仅需按光程差与入射角采样一次,从而消除厚膜区域三波长采样的伪彩色带效应。 with interface reflectance $F = F_0 + (1 - F_0)(1 - \cos\theta_i)^5$ from Schlick’s approximation [8] ($F_0 = 0.02$ for water). As $h \to 0$, $R(\lambda) \to 0$: a black, transparent window. Rendering supports analytic RGB three-wavelength mode and a 2D offline spectral LUT following Iwasaki et al. [13]: the visible spectrum is integrated offline against standard observer functions, converted to display gamut, and sampled once at runtime by optical path and incidence angle, removing the false color banding of three-wavelength sampling in thick-film regions.
8.2 唯象排液与牛顿黑膜8.2 Phenomenological drainage and Newton black film
不同于 Ishida 等 [16] 与 Huang 等 [15] 在表面网格上求解膜厚平流方程,BubbleX 直接在片元着色器中基于世界重力方向的归一化高度与归一化寿命构建唯象膜厚场:顶部比底部变薄更快,干涉条纹随泡泡生命周期向下滑移。域扭曲(domain-warped)3D 噪声用于刻画微涡旋,在高画质档位下还会模拟底部积液区上升的细丝流。生命周期后期,顶部会成核产生牛顿黑膜,以透明窗口形式扩展,并与破裂概率关联。 Unlike Ishida et al. [16] and Huang et al. [15], who solve film-thickness advection on a surface mesh, BubbleX builds a phenomenological thickness field directly in the fragment shader from normalized height along world gravity and normalized lifetime: the top thins faster than the bottom, and interference bands slide downward over the bubble’s life. Domain-warped 3D noise adds micro-vortices, and at high detail levels, rising liquid filaments in the pooled bottom region are simulated. Late in life, a Newton black film nucleates at the top, expands as a transparent window, and is linked to burst probability.
8.3 双通道反射与泡泡环空间锚定8.3 Two-pass reflection and wand-space anchoring
液膜内外壁各自反射环境光,形成泡泡标志性的正立加倒立双重影像。管线采用预乘 Alpha 混合,先开启反向面剔除绘制内壁,再绘制外壁。当液膜仍在泡泡环上吹胀时,着色器会在泡泡环局部坐标与脱离后的球面方向之间平滑过渡,避免大尺度花纹发生抖动。 The inner and outer walls each reflect the environment, producing the signature upright-plus-inverted double image. The pipeline first renders the inner wall with inverted face culling, then the outer wall, using premultiplied alpha. While the film is still inflating on the wand, the shader blends smoothly between wand-local coordinates and detached spherical directions to avoid large-scale pattern jitter.
8.4 AR 合成8.4 AR compositing
- 真实环境反射:依据平台能力,反射源取自环境探针(environment probe)、光照估计或拼接的相机帧,并统一为立方体贴图(cube map)。未覆盖方向会自动补全,并在掠射边缘提高反射增益,避免在明亮背景下出现黑边。 Real-world environment reflection: depending on platform capability, the source is an environment probe, light estimation, or stitched camera frames, always unified as a cube map. Uncovered directions are filled in and reflection gain is raised at grazing edges to avoid dark rims against bright backgrounds.
- 广角边缘畸变校正:为抵消竖屏广角镜头边缘的椭球拉伸,顶点阶段施加了弱透视校正,使轮廓保持圆形,同时反射与遮挡计算仍使用真实三维球体数值。 Wide-angle edge correction: to counter ellipsoidal stretching at the edges of a wide portrait view, the vertex stage applies a weak perspective correction that keeps outlines circular, while reflection and occlusion still use true 3D sphere values.
9. 性能治理与权衡9. Performance Governance and Trade-offs
9.1 合批与屏幕空间自适应 LOD9.1 Batching and screen-space adaptive LOD
- 每帧将数百个 3D 飘落物体及其软阴影合并为单一动态网格;薄雾、冰晶、雪花与干冰雾也各自使用独立的合批网格。 Hundreds of 3D falling objects and their soft shadows are merged each frame into a single dynamic mesh; mist, ice shards, snow, and dry-ice fog each use their own batched mesh.
- 在视图同步阶段,片元着色器细节会根据每个泡泡的投影像素半径与当前泡泡总数动态调整,对拥挤或远处的小泡泡降低着色复杂度,直接削减片元着色开销。 At view-sync time, fragment-shader detail is adjusted by each bubble’s projected pixel radius and the total bubble count, reducing shading detail on crowded or distant small bubbles and cutting fragment cost directly.
9.2 分平台帧率策略与功耗实测9.2 Per-platform frame rate and power measurements
在 iOS 上,自动模式默认为 60 fps。在 Android 上,常规渲染保持 60 fps,当系统热状态达到中度(moderate)等级时降至 30 fps,待温度稳定后恢复;空闲、暂停场景则以 10 fps 运行。在 Pixel 8 同场景实测中,整机电流在固定 60 fps 时约为 2.05 A,在固定 30 fps 时约为 1.27 A,降幅约 38%(单机对比测试;具体收益取决于设备相机帧率)。 On iOS, auto mode defaults to 60 fps. On Android, rendering normally stays at 60 fps and drops to 30 fps when the system thermal state reaches a moderate level, returning once temperatures stabilize; idle, paused scenes run at 10 fps. On a Pixel 8 in the same scene, whole-device current was about 2.05 A at a fixed 60 fps and about 1.27 A at a fixed 30 fps, a reduction of roughly 38% (a single-device comparison; the gain depends on the device’s camera frame rate).
9.3 同屏规模边界9.3 On-screen scale boundary
同屏泡泡数量被限制在百个量级以内:过多不仅会成倍增加半透明过绘制(overdraw),也会在窄小的手机屏幕上遮挡真实世界画面。数量上限通过先进先出(FIFO)淘汰(最老的泡泡先破裂)来维持,而非阻止玩家继续吹泡泡。 On-screen bubble count is capped within the hundred-bubble range: more would add translucent overdraw and block the real scene on a narrow screen. Count is governed by FIFO retirement (oldest bubbles pop first) rather than by blocking interaction.
9.4 技术方案对比9.4 Comparison of technical approaches
| 技术路线Approach | 真实感与流体能力Realism and fluid capability | 算力 / 填充率开销Compute / fill-rate cost | 移动 AR 权衡Mobile AR trade-off |
|---|---|---|---|
| 贴图粒子系统Textured particle systems | 低(线性运动,无双泡与干涉演化)Low (linear motion, no double bubbles or interference evolution) | 极低Very low | 开发迅速,但缺乏真实流体与光学质感Fast to build, but lacks real fluid and optical quality |
| PBD/XPBD 或低分辨率 GPU 流体PBD/XPBD or low-resolution GPU fluids | 中高(全局速度场,简单边界交互)Medium-high (global velocity field, simple boundary interaction) | 中等Medium | 需要跨平台纹理/计算带宽及双向耦合;是迈向壁面物理的合理路径Needs cross-platform texture/compute bandwidth and two-way coupling; a reasonable step toward wall physics |
| 全自由表面 CFD / SPHFull free-surface CFD / SPH | 极高(支持拓扑变化与泡沫)Very high (topology change and foam) | 极高Very high | 计算与发热过重,超出常规移动 AR 帧预算Too heavy in compute and heat for a normal mobile AR frame budget |
| BubbleX 解析与唯象降阶架构BubbleX analytic and phenomenological reduced-order architecture | 中高(涡旋、双泡、毛细振动、光谱干涉、飘落物空气动力学)Medium-high (vortices, double bubbles, capillary oscillation, spectrum, falling-object aerodynamics) | 低至中等(受百泡规模边界约束)Low-medium (bounded by the hundred-bubble scale) | 契合单设备休闲 AR 交互体验Fits a single-device casual AR experience |
10. 结语10. Conclusion
BubbleX 表明,在移动 AR 的算力与散热约束下,并不需要在全自由表面 CFD 与简单贴图粒子之间非此即彼。通过无量纲分析识别各交互阶段的主导物理机制,将解析力学和光学模型与面向移动端的视觉调优和唯象拟合相结合,再辅以规模边界、像素自适应 LOD 与热控制帧率策略,最终得到了一套兼顾功耗与交互节奏的工程方案。本文仅阐述设计依据;真实的体验感,仍待在游戏中亲自感受。 BubbleX shows that, under mobile AR compute and thermal limits, there is no need to choose between full free-surface CFD and simple textured particles. Dimensionless analysis identifies the dominant physics in each interaction phase; analytic mechanics and optics models are combined with mobile-oriented visual tuning and phenomenological fitting; and a scale boundary, pixel-adaptive LOD, and thermal frame-rate control yield an engineering solution that balances power and interaction pacing. This paper presents design rationale only; the realism itself is best judged by playing the game.
参考文献References
- Bridson, R., Hourihan, J., & Nordenstam, M. (2007). Curl-Noise for Procedural Fluid Flow. ACM Transactions on Graphics (SIGGRAPH), 26(3), Article 46.
- Plateau, J. A. F. (1873). Statique expérimentale et théorique des liquides soumis aux seules forces moléculaires. Gauthier-Villars, Paris.
- Rayleigh, Lord (1879). On the capillary phenomena of jets. Proceedings of the Royal Society of London, 29(196–199), 71–97.
- Lamb, H. (1932). Hydrodynamics (6th ed., §275 Oscillations of a spherical drop/bubble). Cambridge University Press.
- Taylor, G. I. (1959). The dynamics of thin sheets of fluid. III. Disintegration of fluid sheets. Proceedings of the Royal Society of London. Series A, 253(1274), 313–321.
- Culick, F. E. C. (1960). Comments on a ruptured soap film. Journal of Applied Physics, 31(6), 1128–1129.
- Born, M., & Wolf, E. (1999). Principles of Optics (7th ed.). Cambridge University Press.
- Schlick, C. (1994). An Inexpensive BRDF Model for Physically-based Rendering. Computer Graphics Forum, 13(3), 233–246.
- Andersen, A., Pesavento, U., & Wang, Z. J. (2005). Unsteady aerodynamics of fluttering and tumbling plates. Journal of Fluid Mechanics, 541, 65–90.
- Cummins, C., Seale, M., Macente, A., Certini, D., Mastropaolo, E., Viola, I. M., & Nakayama, N. (2018). A separated vortex ring underlies the flight of the dandelion. Nature, 562(7727), 414–418.
- Glassner, A. (2000). Soap Bubbles: Part 1 & Part 2. IEEE Computer Graphics and Applications, 20(5), 76–84 & 20(6), 99–109.
- Ďurikovič, R. (2001). Animation of Soap Bubble Dynamics, Cluster Formation and Collision. Computer Graphics Forum, 20(3), 67–76.
- Iwasaki, K., Matsuzawa, K., & Nishita, T. (2004). Real-time Rendering of Soap Bubbles Taking into Account Light Interference. Proceedings of Computer Graphics International (CGI), 344–348.
- Da, F., Batty, C., Wojtan, C., & Grinspun, E. (2015). Double Bubbles Sans Toil and Trouble: Discrete Circulation-Preserving Vortex Sheets for Soap Films and Foams. ACM Transactions on Graphics (SIGGRAPH), 34(4), Article 149.
- Huang, W., Iseringhausen, J., Kneiphof, T., Qu, Z., Jiang, C., & Hullin, M. B. (2020). Chemomechanical Simulation of Soap Film Flow on Spherical Bubbles. ACM Transactions on Graphics (SIGGRAPH), 39(4), Article 41, 41:1–41:13. (DOI: 10.1145/3386569.3392094)
- Ishida, S., Synak, P., Narita, F., Hachisuka, T., & Wojtan, C. (2020). A Model for Soap Film Dynamics with Evolving Thickness. ACM Transactions on Graphics (SIGGRAPH), 39(4), Article 31, 31:1–31:11. (DOI: 10.1145/3386569.3392405)