490 likes | 642 Views
FOGSHOP: Real-time Design and Rendering of Inhomogeneous, Single-Scattering Media. Kun Zhou, MSRA Qiming Hou, Tsinghua Univ. Minmin Gong, MSRA John Snyder, MSR Baining Guo, MSRA Heung-Yeung Shum, MSRA. Previous Real-Time Techniques. homogeneous fog no spatial variation
E N D
FOGSHOP: Real-time Design and Rendering of Inhomogeneous, Single-Scattering Media Kun Zhou, MSRA Qiming Hou, Tsinghua Univ. Minmin Gong, MSRA John Snyder, MSR Baining Guo, MSRA Heung-Yeung Shum, MSRA
Previous Real-Time Techniques homogeneous fog no spatial variation layered fog using textures vertical variation only immersed lights/objects volume rendering ignores halos/shadows from [Sun05] from DX10 volume fog demo
RBF model supports large fog banks immersed viewer point lighting effects: media’s appearance and shadows environmental lighting effects: media’s appearance, approx. shadows surface reflectance effects due to immersion in media noise addition easy-to-use media design system Fogshop Features
Modeling Inhomogeneous Media with RBFs optical density = sum of n 3D Gaussian blobs + constant: easy-to-control model compatible with particle systems analytic line integral viaerf(x) [Stam93] bi ci ai
T(a,b) is optical depth between 3D points a and b: light from ab attenuated by exp(-T(a,b)) Attenuation by Inhomogeneous Fog integrate density along path ab
Computing Optical Depth via RBF Splatting single RBF splat multiple splats integrate optical depth draw bounding box for each RBF integrate analytically in pixel shader accumulate over n blobs using alpha blending
airlight models lighted media’s direct appearance due to light scatter by fog particles includes self-shadowing and haloing Fog scatters, not just attenuates, light! fogshop (single scattering) volumetric blending (attenuation only)
light scatters once off fog particle at x path consists of two segments exponential attenuation along each segment accurate for thin media, plausible for denser Single-Scattering Model for Airlight
Single-Scattering Integral x(t): scattering location along view ray
Single-Scattering Integral (x): optical density atx
Single-Scattering Integral k() : phase function [constant]
Single-Scattering Integral I0: light source intensity
Single-Scattering Integral radiance reaching x, neglecting attenuation
Single-Scattering Integral T(v,x), T(s,x): optical depths
Single-Scattering Integral total attenuation along path
Brute Force Numerical Integration • need manysamples xi along every view ray • each needs two optical depth integrals • too expensive for real-time!
… and compute Li with a single sample. • projected center is point of max densityalong view ray • assumes f (x) smoothwrt blob’s width • i integrated analytically
use red light path through for blobi[per-ray varying] use blue light path through bi for other blobsj≠i[ray invariant] Computing Li : Separate Light Paths Reuse optical depth integrals over many view rays.
Computing the constant term L0 • use similar light path separation trick • apply analytic method of [Sun05] • see paper for details
Accuracy of Our Approximation ray traced fogshop
Inaccuracy of Our Approximation not smooth when small (looking right at light) T(x,s) discontinuous (light shafts) ray traced fogshop
Handling Environmental Airlight L : environment lighting in SH basis Tr : optical depth along view ray r from v∞ PSF : point spread function (for convolving environment) = * L*PSF (after scatter) L (before scatter) PSF
Environmental Airlight: Results environment airlight point airlight
Standard Slide without subtitle surfaces immersed in medium incident radiance affected by scattering subtle yet noticeable effects: softened shading blurred highlight media’s shadow can get away with lots of approximation Surface Reflectance: Why?
Standard Slide without subtitle assume homogeneous medium of average density average varies at each pixel, creating inhomogeneous effects point light: average in single direction sp environment light: average all aroundp use SH lighting and PSF[Sun05] Surface Reflectance: How?
Standard Slide without subtitle Surface Reflectance: Results point light environment light
Standard Slide without subtitle break up RBF’s circular shape perturb view rays, indexed by be consistent when camera rotates add noise in world space Adding Noise with noise without noise
Standard Slide without subtitle preliminary steps render depth maps from camera & lights (immersed) surface rendering airlight rendering Rendering Summary
Standard Slide without subtitle compute T(s,p) for each point light s using RBF splatting to cube map compute average optical depth at object centers if using environmental lighting shade per-vertex render to scene target Surface Rendering
Standard Slide without subtitle compute T(v,bi), T(s,v), T(s,bi) plane sweep algorithm on CPU accumulate airlight and screen optical depth T(v,p) perturb view rays if noise enabled computed on GPU attenuate scene target and add airlight Airlight Rendering ( ) scene target airlight optical depth + = result
Standard Slide without subtitle brush/eraser copy/paste particle emitter airbrush real-time light and camera change Interactive Media Design
Standard Slide without subtitle scripted using a simple language parabolic path default Interactive Media Design: Particle Emitter
Standard Slide without subtitle particles bounce off scene surfaces collision detection using kd-tree ray tracer Interactive Media Design: Airbrush
Performance 3.75 Ghz PC, 2GB memory, Nvidia 8800GTX
Contributions • analytical model of single scattering for spatially-varying media • enables visually accurate, real-time rendering • easy-to-use tools for interactive media design • main new ideas: • decompose scattering integral, one term per RBF • sample term at peak of its RBF along view ray • optical depth integrals for other RBFs: • sampled at RBF center • precomputed and reused for multiple view rays
Limitations • inaccurate approximation near lights • light shafts ignored • environmental lighting: • low-frequency and distant • very approximate shadows (averages in all directions) • use PRT for self-shadows on scene objects
Future Work • light shafts • multiple scattering • mixed surface-surface and media-surface shadowing