• 沒有找到結果。

Compute Optimal Lighting Configuration

mean different clusters. The resulting clusters are initial lighting configuration p0.

3.4 Compute Optimal Lighting Configuration

When a initial lighting configuration p0 is given, lights can be organized into a light tree for efficient partition finding. When building the light tree, similarity is a criterion for merging two clusters. Simultaneously, we also find a new light to replace the contribution of two children.

In order to choosing a cut from the light tree, we start with a very coarse cut (e.g., the root of the light tree) and then progressively refine it until our error threshold met. We call such a cut, a lightcut. When we decide a cut from the light tree, it means our system generates appropriate number of representative lights. Certainly, this lightcut can be adjusted by user if they want to add more lights or delete some lights.

The lightcut imply a lighting configuration p, which is not optimal solution. Our system tunes lighting parameters using simplex method and it generates optimal lighting configuration p.

3.4.1 Build Light Tree

The light tree groups lights together into clusters. Ideally, we want to maximize the quality of the clusters it creates. Light tree is built using a greedy, bottom-up approach by progressively combining pairs of clusters.

We choose the pair that will create the smallest cluster according to similarity metric. if one light’s contribution to the rendering can be faithfully represented by another light, we say that those two lights have similar lighting behavior. Thus, we define our similarity metric as D(I(p1), I(p2)), where first cluster imply lighting configuration p1 and second cluster imply another one. Be attention to this similarity metric, before measurement similarity, we must set the intensities of p1 and p2 as unity because we care about only their replacement, not their intensities. Figure 3.8 (a) show several clusters after watershed segmentation. Figure 3.8 (b) is a corresponding light tree, where leaf nodes are clusters described above.

3.4 Compute Optimal Lighting Configuration 22

(a) Clusters after segmentation (b) Light tree (c) a lightcut

(d) Lighting parameters deter-mined by lightcut

(e) Simplex optimization (f) Desired illumination

Figure 3.8: Optimal lighting configuration workfolk

3.4 Compute Optimal Lighting Configuration 23

Schoeneman et al. use L2-norm[22] or Pellacini et al. use importance-weighted L2-norm[19]

to measure the difference between the desired illumination Ψ and the resulting illumination I(p) on 2D image plane.

But, our system provide brushes to paint lighitng effect into the 3D scene directly so that our error metric is defined on 3D space. we implement L2-norm of the difference between the desired illumination Ψ and the resulting illumination I(p) on each vertex, normalized by L2-norm of the desired illumination Ψ:

D(I(p), Ψ) = k I(p) − Ψ k where k.k is L2-norm notation, I(p, vi) is color of i-th vertex under lighting configuration p and Ψ(vi) is color of i-th vertex in the desired illumination Ψ. In addition to comparison with contribution of I(p) and Ψ, difference measurement also apply for comparison with contribution of p1and p2, where p1 is a llighting configuration and p2is another one.

Beside merging two clusters, we also find a new cluster to replace contribution of two chil-dren. We apply weighted average for generating new position by this formula

xnew= xi k liφi k +xj k ljφj k

k liφi k + k ljφj k (3.7)

and new intensity by this formular

lnew= li+ lj (3.8)

3.4.2 Choose a Lightcut

When light tree is built using bottom-up approach, we want to decide a lightcut to determine the number of representative lights and acquire a lighting configuration p. Using a relative similarity metric assists us in deciding the cut. We start from the root of the tree and then progressively refine it until our error threshold met shown in figure 3.8 (c). Figure 3.8 (d) is a lighting parameters retrieved from light tree according to selected lightcut.

3.4 Compute Optimal Lighting Configuration 24

3.4.3 Optimization

At the heart of our system is an optimization algorithm whose purpose is to unburden the de-signer from having to optimize the light parameters manually. The goal function D(I(p), Ψ) for the optimization is illumination difference between the desired illumination Ψ and the resulting illumination I(p).

Several factors make this a difficult function to optimize analyzed by Pellacini07 et al [19]. First, it is nonlinear in the parameters of the lights. Second, to evaluate Goal function D(I(p), Ψ), we render illumination of the scene under p and compare illumination difference between I(p) and Ψ, which can be expensive in the inner loop of an optimization. Third, if we are optimizing many parameters or many lights, the search takes place in high-dimension.

Fourth, there is no general strategy (other than sampling) to determine the local gradients of the goal function. Fifth, our search space has large plateaus in which the optimizer can get lost.

Our system is designed to work with any optimization algorithm, but, as a practical matter, we found that the nonlinear simplex method of Nelder et al.[15] and Press et al.[21] works well provided that (1) the search space is parameterized well, and (2) it starts with a decent configuration. For a search in n dimensions, this method stores a set of n + 1 configurations representing a simplex in the search space. At every step, the optimizer considers a set of possible configuration changes for the worst vertex (the one with the worst value in the goal function), such as reflecting the vertex through the opposite face in the simplex. Each considered change requires one evaluation of the goal function. If no possible improvements are found, the simplex shrinks by uniform scaling toward the best vertex. When the simplex has collapsed to a very small size, it has found a local minimum.

This solution is typically good enough for tuning lighting parameters. Inputs of this com-ponent is a lighting configuration p, including n lights and six parameters, three for position xi, and three for intensities li, for each light. Simplex optimizer p0 = Simplex(p) adjusts lighting parameters, where p0 is a tuned lighting configuration. Figure 3.8 (e) is the optimal lighting configuration generated by our system. we can compare the resulting illumination with desired

相關文件