• 沒有找到結果。

input : A BVH node and vertices V inside the node output: A binary axis-aligned bounding box tree BVH

node.AABB ←ComputeAABB(V);

the true coefficient vector ~lp of the incident radiance function at every vertex p with a vector of coefficients ~lx sampled at some point x, the error introduced by such approximation ˜C(p) is

kC(p) − ˜C(p)k = k(~t(p) · ~l(p)) − (~t(p) · ~lx)k,

where the function ~t(p) is the vector function representing the coefficient vectors for the transfer function at p ∈ P , and in particular with L1 norm, we have and add more samples to the approximation, we get more accurate results. Previous works uniformly partition the domain using the ICP algorithm [SKS02] or uniform grid [GSHG98], here we can do it better. Since the error kC(p) − C0(p)k1 is defined on vertices rather than the entire R3, we can partition the set of all vertices P rather than uniformly partition R3. A useful partition on P is the bounding volume hierarchy.

We cannot apply Equation (3.1) to estimate the error of each hierarchy node, since it still involves computing ~l(p) at every vertex. Since it is impossible to know the exact value of

~l(p) unless all vertices p are sampled, our method tries to estimate them. The oracle can be seen as a partition strategy. We don’t care about the exact values of error. Only the relative errors between different hierarchy nodes need to be computed. With relative errors, our method decides whether or not a node should be partitioned.

3.3 Runtime Stage 32

(a) An 1D function (b) Replace with an constant

(c) Partition the domain and adding samples

(d) As samples increase, the error diminishes

Figure 3.3: Approximating an 1D function with discreet samples.

3.3.2 The Oracle Function

Since the transfer function coefficients ~t(p) is the combination of the visibility function and the surface BRDF, the outgoing radiance will never be larger than the incident radiance, as a result of the energy conservation law. The errors in Equation (3.1) are thus never greater than P

, which is further bounded by a looser bound as follows:

maxp∈P (|~lp|) ||P ||, (3.2) where ||P || is the number of vertices of the set P . The intuition behind Equation (3.2) is that we will partition a vertex set that has a higher value of |~l(p)|, since discreet sampling introduces larger errors at this region. Note that the norm of vector of spherical harmonic coefficients representing the incident radiance is less than or equal to√

i times the L2 norm of the incident radiance function. The magnitude of the incident radiance function at the sample point x can be obtained by computing the L2 norm of the incident radiance function:

kLx(ω)k2 = s

Z

S2

Lx(ω)2dω ,

and the norm of the vector |~lx| is

By applying the Cauchy inequality to the norm of the vector |~lx|, we can see that it is related to the norm of the incident radiance function and have

We can thus use the magnitude of the vector ~lx to adequately estimate the magnitude of the incident radiance function at point x. In addition to partitioning at brighter regions, vertex set P having a large number of vertices should also be partitioned first, since the error could be more appealing.

However, we must perform sampling to know |~l(p)| since ~l(p) is known only at run time. As a consequence, our oracle function is an a posteriori error estimator; that is, the error estimation is done after |~l(p)| is sampled. We made a few assumptions to further approximate the error.

One assumption is that ~l(p) does not vary too much around p so that we can take a single sample x inside set P and use it to approximate maxp∈P(|~l(p)|). Another assumption is that the points are evenly distributed on the object surface; so we can use the radius of the bounding volume of P to approximate ||P ||. Equation (3.2) can now be approximated by:

maxp∈P (|~lp|) ||P || ≈ r |~lx|, where r is the radius of the bounding volume of P .

Furthermore, we take the possibility of variations into account. The error is higher if there are more variations in ~l(p). We approximate the variation with the ratio of the radius of the bounding volume to the average distance to emitters. The intuition behind this choice is shown

3.3 Runtime Stage 34

Figure 3.4: If the blockers and the receiver are near, higher variations in irradiance oc-curs [Arv94].

in Fig. 3.4. If the emitters are far away from our receiver (object), the variation due to nearby blockers could be smaller, as the B curve in Fig. 3.4 shows. The blockers can be considered as a type of emitters with less emission. Also, the errors due to the variation are smaller if the receiver is very small compared to the distance to the emitters. One extreme case is a scene lit by infinitely far emitters; thereby no irradiance variations can occur. In the oracle, the variations are approximated by the ratio of the radius of the bounding box of the vertex set P to the harmonic mean of distances from the sample points to all emitters. The harmonic mean of a set of distances di, where i = 1...N , is [PH04],

Hd= N P

N 1 di

.

By using the harmonic mean we are able to detect the presence of nearby emitters, as a larger distance has a smaller effect on the harmonic mean. Now we can write our oracle as

r |~lx|

Hd2 , (3.3)

where ~lx is the vector of coefficients representing the incident radiance sampled at point x, r is the radius of the bounding box of the vertex set P computed in the preprocessing stage, and Hd is the harmonic mean of distances from x to emitters. The computation of ~lx and Hd will be described in section 3.3.

The oracle function in Equation (3.3) computes the estimated error between ˜C(p) and C(p).

Once the estimated error exceeds a user-specified bound, we must traverse to the next level and

相關文件