Illumination Under Trees Nelson Max University of Tokyo, and University of California, Davis
Topics Hierarchical image based rendering for trees Atmospheric illumination and shadows Shadow penumbras with fast Fourier transforms Penumbras using image based rendering Plane parallel radiance transport in forests
Image Based Rendering (IBR) Pre-compute multilayer (A-buffer) RGBZ images from a number of viewpoints. Reconstruct an image for a new viewpoint by using the pixel locations and the Z values to get 3D colored points to project to the new view. Relight using a similar N x N y N z Z A-buffer. Re-project to light source view for z-buffer shadow algorithm.
Hierarchical IBR Build a hierarchy of tree part objects, defined in terms of subobjects. Struct object { bounding_sphere; list of polygons; list of subobjects with positioning matrices; }
decide (object K, matrix Q) { if (K.bounding_sphere intersects view volume) if (projected size of closest pixel < threshold) reproject(k, Q); else { for all polygons P in K render P using matrix Q; for all subobjects S in K decide (S, Q*S.matrix); } }
Hierarchical IBR in Hardware Alpha test for IBR reprojection (Schauffler) Store single layer RGBZ image as an RGBA texture, with Z in Alpha channel. Draw several textured polygons perpendicular to the original viewing direction, using the alpha test to select the appropriate parts of the texture.
Color matrix for shading (Westermann and Ertl) Use the color matrix to rotate N x N y N x texture by the current viewing matrix time the inverse of the viewing matrix of the original image. Adjust the color matrix to put the dot product of the normal with the light source in all three RGB components. Reproject N x N y N x Z images with this matrix. Multiply resulting B&W shading image by unshaded color image, using glblendfunc.
Minimizing texture switching Reorganize decide (K, Q) code to save a list of matrices Q for each object K, but not reproject. In the unshaded color pass for each object K load RGBZ textures for object K for all matrices Q in list for K reproject (k, Q); In the shading pass, do the same for the N x N y N x Ztextures.
Atmospheric illumination The shadow polygon algorithm of Frank Crow can compute the regions of light and shade along a viewing ray, but the shadow polygons for all the edges of all the leaves will cross scan lines in the lower part of the image. Therefore, use scan planes that pass though the viewpoint and the sun. The needed shadow polygons are only those generated by polygon edges intersecting that scan plane.
Process viewing rays from the sun direction outwards, so that all polygons that cast shadows on a viewing ray have been seen first.
These slanted scan plane intersect the view plane in slanted scan lines which must be resampled onto a standard raster.
Penumbras and Sky Illumination Assume the shadows are cast by a tree canopy mask, lying on a plane parallel to the ground. Assume the sky illumination is an image on an infinitely high plane, so that the color depends only on the viewing direction, and not the viewpoint position. Then the image of the visible part of the sky is the result of translating the tree canopy mask image across the sky illumination image.
Irradiance Computation Pre-multiply sky image by cos 4 θ, to account for solid angle per pixel and Lambert s Law. Assume the sky, mask, and ground images have resolution n by n. For each ground pixel, translate the mask image, multiply by the sky image, and sum. Cost: O(n 2 ) per ground pixel. Total cost for all ground pixels: O(n 4 ).
Fast Fourier Transform Method The ground image is a correlation of the sky and mask images, or a convolution of the sky image and the ground image rotated by 2π. Compute the Fourier transforms of the sky and rotated mask images, in time O(n 2 log n). Multiply these Fourier transforms in time O(n 2 ). Take inverse Fourier transform in time O(n 2 log n). Total cost is O(n 2 log n) instead of O(n 4 ).
Penumbras by image based rendering (by Brett Keating) Store object in an A buffer, with multiple depths at each pixel. Trace shadow rays through A buffer. Round depths both up and down to 32 discrete levels to reduce storage, speed up ray tracing, and reduce light leaks. Uses 32 bit logical operations for ray tracing.
Deterministic Random
Plane Parallel Radiance Transport Represent leaves and branches by tiny oriented semi-transparent surface flakes, whose density depends only on the height z above the ground and the surface normal of the flake. Solve transport differential equations for red, green, and blue direction-dependent radiance. Subtract attenuated direct sunlight from solution. Add back direct sunlight with z-buffer shadow algorithm. Use radiance solution for shading.
Equation of radiance transport di( X, ω) = κ ( X, ω) I( X, ω) + κ( X, ω) a r( X, ω, ω) I( X, ω ) dω' ds X is 3D position ω and ω are ray directions on the unit sphere I(X,ω) is radiance at X flowing in direction ω s is length along the ray in direction ω κ(x,ω) is the extinction coefficient, and depends on ω r(x,ω,ω) is the scattering phase function from ω to ω a, the albedo, is the scattered fraction of the extinction 4π
Simplifying assumptions Orientation isotropy: the distribution d(θ N,z) of surface normals depends only on z and θ N, not on φ N. Compute it from area of clipped polygons. BRDF and BRTF isotropy: invariant under rotation of the surface about the surface normal. Volume isotropy: r(x, ω, ω) depends only on z, θ, θ, and φ φ, not on φ and φ separately. Plane parallel: I(X, ω) depends on ω and z, but not on x and y.
Computation of phase function Divide sphere into a number of direction bins. Separately for specular reflection, diffuse reflection and diffuse transmission, precompute square bin-to-bin scattering matrices for each θ N, by integrating analytically over φ N, and sampling in the direction bins. For each z, find r ij (z) = κ(x,ω) a r(x, ω, ω) by summing over θ N the bin to bin scattering matrix elements multiplied by d(θ N,z) and the reflection and transmission coefficients for each color.
Matrix version of transport equations Represent I(X,ω) by I i (z), for direction bins i. Replace ds by dz/µ i, where µ i = cos θ i. Subtract the extinction term κ(x,ω i ) from r ij (z). Then the integral-differential transport equation becomes the system of differential equations ' d X I X r a X X I X ds X di ω ω ω ω ω κ ω ω κ ω π ), ( ),, ( ), ( ), ( ), ( ), ( 4 + = ) ( ) ( ) ( z r z I dz z di ij j j i i = µ
Two point boundary conditions Split the vector I(z) into upward flowing I u (z) and downward flowing I d (z). I d (h) is known when z = h at the top of the trees. I u (0) = F(0) I d (0), where F(0) is the BRDF matrix for the ground at z = 0. Let F(z) be the BRDF of the ground and the vegetation up to height z, so I u (z) = F(z) I d (z). Write and solve a differential equation for F(z).
The volume isotropy assumption causes the differential equation for F(z) to split up into a collection of smaller systems. Shading is pre-integrated as a function of normal. For details see Plane Parallel Radiance Transport for Global Illumination in Vegetation, Nelson Max, Curtis Mobley, Brett Keating, and En-Hua Wu, EGWR 1997, (published by Springer as Rendering 97 ) pp. 239 250, preprint version at http://www.llnl.gov/tid/lof/documents/pdf/232348.pdf
http://www.llnl.gov/tid/lof/documents/pdf/232348.pdf