400 likes | 545 Views
Optical Models. Jian Huang, CS 594, Spring 2002 This set of slides are modified from slides used by Prof. Torsten Moeller, at Simon Fraser University, BC, Canada. Optical Models. Nelson Max, “Optical Models”, IEEE Transactions on Visualization and Computer Graphics, Vol. 1, No. 2, 1995.
E N D
Optical Models Jian Huang, CS 594, Spring 2002 This set of slides are modified from slides used by Prof. Torsten Moeller, at Simon Fraser University, BC, Canada.
Optical Models • Nelson Max, “Optical Models”, IEEE Transactions on Visualization and Computer Graphics, Vol. 1, No. 2, 1995. • Jim Blinn’s 1982 SIGGRAPH paper on scattering. • The mathematical framework for light transport in volume rendering.
Transport of Light • Determination of Intensity • Local - Diffuse and Specular • Global - Radiosity, Ray Tracing, Ultimate Physcial • Mechanisms in Ultimate Model • Emittance (+) • Absorption (-) • Scattering (+) (single vs. multiple)
Transport of Light • Typically based on - S. Chandrasekhar “Radiative Transfer”, Oxford Universtiy Press 1950 • Mathematically challenging • Approximate models required -Blinn et al to the rescue • Over Operator -only emission and absorption
Max - 1995 • Several cases: • Completely opaque or transparent voxels • Variable opacity correction • Self-emitting glow • Self-emitting glow with opacity along viewing ray • Single scattering of external illumination • Multiple scattering
Blinn - Assumptions • Assumptions: • N - surface normal • E - eye vector • L - light vector • T - surface thickness • e - angle btw. E and N • a - angle btw. E and Laka phase angle • I - angle btw. N and L
Blinn - Assumptions • Assumptions (contd.): • particles are little spheres with radius p • n - number density (number of particles per unit volume) • m - cosine of angle e, i.e. N.E • D - proportional volume of the cloud occupied by particles
Blinn – transparency (1) Cylindersmust be empty • Expected particles in a volume will be nV • Probability that there are no particles in the way can be modeled as a Poisson process: • Hence the probability that the light is making it through those tubes is:
Blinn – transparency (2) • Transparency through the cloud: • t is called the optical depth E T -E
Max - absorption only • I(s) = intensity at distance s along a ray • t(s) = extinction coefficient • T(s) = transparency between 0 and s
Max - absorption only • Linear variation of t:
Max - absorption only • On the opacity a: • assuming t to be constant in the interval
Max - cloud model • Using fractal structure (Perlin)
Max - self-emitting glow • Without extinction:
Max - self-emitting glow • Without extinction:
Max - self-emitting glow • With extinction:
Volume Ray Integral (1) • The continuous form: • In general case, can not compute analytically
Volume Ray Integration (2) • Practical Computation Method: • note: Dx can be Dxi (different everywhere) • which leads to the familiar BTF or FTB compositing …
g(s) • g(s) could be: • Self-emitting particle glow • Reflected color, obtained via illumination • The color is usually the sum of emitted color E and reflected color R
Max - self-emitting glow • Identical glowing spherical particles: • projected area a = pr2 • surface glow color =C • number per unit volume = N • extinction coefficient t = a N • added glow intensity per unit lengthg = C a N = C t
Max - self-emitting glow • Special Case g=Ct: (and C constant) • This is compositing color C on top of background I0
Max - self-emitting glow • For I0=0 and t: varying according to f:
Volume Ray Integration Equation • Self-emitting glow, none constant color
Max - reflection • i(x) = illumination reaching point x • w = unit reflection direction vector • w’ = unit illumination direction vector • r(x,w,w’): BRDF • for conventional surface shading effects
Max - reflection • For particle densities: • w(x) = albedo • Blinn: assuming that the primary effect is from interaction of light with one single particle • albedo - proportion of light reflected from a particle: in the range of 0..1 • p(w,w’) = phase function • still unrealistic external reflection of outside illumination
Blinn - Phase Function • “how” we see theparticles • depends on the angle ofeye E and light vector L • smooth drop off …
Blinn - Phase Function • Many different models possible • Constant function • size of particles much less then wavelength of the light • Anisotropic • more light forward then backward - essentially our diffuse shading • Lambert surfaces • spheres reflect according to Lamberts law • physically based
Blinn - Phase Function • Rayleigh Scattering • diffraction effects dominate • Henyey-Greenstein • general model with good fit to empirical data • Empirical Measurments • tabulated phase function • sums of functions • weighted sum of functions - model different effects in parallel
Max - shadows • Should account for transparency of volume between light source and point x: • those are the “shadow feelers” • e.g. Kajiya’s two pass algorithm
Max - multiple scattering • I(x,w): intensity at position x in direction w • g(x,w): source term (glow at x in direction w)
Max - multiple scattering • use radiosity ideas for the solution • simplified model - scattering is isotropic • i.e. g(x,w) does not depend on w: • then we can compute the total contribution of all voxels to the iso-tropic scattering: • where Fij are the “form factors” and ai are the albedo coefficients • do a first pass like Kayija and collect external illumination in E(xi)
Max - multiple scattering • Results in big equation system • we still need to solve the form factors • use an iterative solution method as in progressive radiosity
Max - multiple scattering • Different approach: Monte Carlo Method • Trace a large representative selection of rays from light sources and absorb them, with probability proportional to t, or scatter them, with probability proportional to r. Build up the distribution of light flux flowing through each voxel (in each direction).
Max - multiple scattering • In a view dependent rendering pass, do a final single scatter of this light distribution towards the eye:
Max - multiple scattering • albedo = 0.99 • 15 iterations were needed • cloud on a 24x24x18 volume • each iteration took15 minutes • final 512x384rendering took5 minutes
1.0 Volumetric Ray Integration color opacity object (color, opacity)
1.0 Ray-casting - revisited Interpolationkernel volumetric compositing color c = c s s(1 - ) + c opacity = s (1 - ) + object (color, opacity)
Acquired values Data Preparation Prepared values shading classification Voxel colors Voxel opacities Ray-tracing / resampling Ray-tracing / resampling Sample colors Sample opacities compositing Image Pixels Which one? Volume RenderingPipeline (Levoy’88)
Volume Rendering Pipeline (Wittenbrink et. al. 98) • FTB color: • BTF color: • Opacity: • The colors that are composited must be pre-weighted with opacity, i.e. associate color: • C’ = aC