• 沒有找到結果。

Rendering System

illumination. Their positions are vert close, and overall atmosphere of lighting is consistent between desired and resulting illumination.

3.5 Rendering System

The rendering system is responsible to evaluate the illumination of the scene S for a given lighting configuration p. It will be invoked hundreds of times during the optimization process.

Thus, it is essential to be able to evaluate the rendering function R(p, S) quickly.

Since our system support painting on object surface directly from different viewing, if we compute lighting effect at run-time, our system is impossible to achieve interactive time. This disobeys our original motivations and goals. Therefor, we adopt a simple way to cache lighting information.

We uniformly place many unity lights in the bounding volume of the scene, where a unity light means its intensity is (1, 1, 1) of RGB channel. We evaluate the illumination of the scene for each unity light R(xi, (1, 1, 1), S) and store these lighting information in the preprocess.

Since we have these lighting cache data, we can evaluate illumination of the scene for a arbitrary light placed anywhere by interpolation of nearby cached lights.

This method apply well to indirect illumination and is not well for direct illumination such as shadows or highlights because direct illumination changed rapidly. Thus, we place a lot of lights in the space to alleviate these artifact. Actually, our system can be conjunction with any vertex lighting algorithm for better lighting effect, including those that account for interreflection and shadows such as local radiance transfer [11].

C H A P T E R 4

Result

All experiments are performed on Intel core 2 duo CPU E6750 2.66GHz using NVIDIA Gefore 8600 GT graphics hardware. The program only use one thread without taking advantage of multi-core of the CPU.

Figure 4.1(a) shows fiveballs scene, whose illumination produced by five artificial lights specified by our. It can be considered as ground truth in order to comparison with our resulting illumination. This scene is not closed model and five diffuse balls in the scene, so it is conve-nient for testing, visualization, and evaluation error. We use ground truth as desired illumination and then generate the resulting illumination through our algorithm. Figure 4.1(b)(c)(d) show that different importance criterion will produce different sampling results. If we only consider geometry property for each vertex, more selected vertices are distributed in the region, where many occluders around them. If we only consider illumination property, we can observe more selected vertices near high illumination gradient region. Therefor, we combine advantages of both properties to do sampling.

Figure 4.2 shows the workflow of estimating initial lighting configuration and computing optimal lighting configuration. Figure 4.2(a)(b)(c) is first iteration, including spreading unity

26

27

(a) Ground truth (b) only geometry term (c) only illumination term (d) importance term

Figure 4.1: Illustration of choose important vertices. (a) is desired illumination simulated from 5 artificial lights. (b) considers only geometry term for important sampling. (c) considers only illumination term for important sampling. (d) is sampling result considered by both geometry term and illumination term

lights coarsely, solver, and deleting weak lights. Its goal is to approximate the locations and directions of lights. Next, we do second iteration just like as first iteration shown in figure 4.2(d)(e)(f). Only be attention to spreading unity lights finely around remaining lights in previ-ous iteration. Its goal is to locate light’s distribution, which help us determine lighting param-eters. When light’s distribution is known, we cluster lights to each group using segmentation methods shown in figure 4.2(g). Although segmentation find local maximal well, but it has a potential problem, over-segmentation ,so we sometimes observe that some lights should be clustered into the same group, but they are classified into different groups. In our application, over-segmentation is not a big problem because it can be solved by our light tree mechanisms.

After segmentation, we know light’s distribution and each light belonging to which clusters.

We use these information to build light tree. Figure 4.2(h) shows each leaf node in light tree.

In this figure, there are 7 lights which are leaf nodes in light tree. According to error threshold, we choose a lightcut which also imply a lighting parameters shown in figure 4.2(i). The light-ing parameters are adjusted globally uslight-ing simplex method and white balls are final resultlight-ing positions of lights shown in figure 4.2(j). Figure 4.2(k) is ground truth produced by our artifi-cial lights shown in red balls. Compare the positions of white balls with red balls. We hardly

28

observe difference between them.

Figure 4.3(a) is ground truth in fiveballs. We directly use it as system input. Figure 4.3(b) shows the resulting illumination generated by our system. We compare ground truth with the resulting illumination shown in figure 4.3(c). We found that human eye hardly distinguishes low illumination difference. Figure 4.3(d) is 8 times of illumination difference. Figure 4.5 is another example with a more complex scene. Illumination difference is still low.

Speed bottleneck of our algorithm is computation time of least-square solver. Using fewer important vertices can reduce computation time so we choose a balance between number of vertices and quality of resulting illumination. Table 4.1 summarizes detailed statistics for five-balls scene under 3 artificial lights with different number of important vertices. Table 4.2 shows statistics under the same environment except for 6 artificial lights. We observe that more artifi-cial lights usually have slightly higher error because more artifiartifi-cial lights exit in the same space and they produce more complexity illumination. It’s very hard to estimate accurate positions for each light, but we generate resulting illumination which is very close to ground truth. From observing tables, computation of least-square solver in estimating initial lighting configuration takes time much more than computation of simplex method in computing optimal lighting con-figuration. Therefor, choosing appropriate number of lights is very important to performance in our system. In general, the more complexity scene usually choose more vertices, which leads to better results.

important vertices lights guessed lights error total(s) initial(s) optimal(s)

100 3 3 8.34 1.016 1.001 0.015

500 3 3 2.62 1.547 1.515 0.032

1000 3 3 2.24 2.757 2.710 0.047

1500 3 3 2.03 3.228 3.171 0.057

2000 3 3 1.77 4.281 4.187 0.094

Table 4.1: fiveballs scene under 3 artificial lights with different important vertices

Table 4.3 shows the test case of fiveballs scene with different artificial lights. Fewer artificial

29

(a) Spread light coarsely (b) Solve (c) Delete weak light

(d) Spread light finely (e) Solve (f) Delete weak light

(g) Segmentation (h) Leaf nodes in light tree (i) A lightcut

(j) Simplex optimization (k) Ground truth

Figure 4.2: Illustration of initial lighting configuration and optimal lighting configuration

30

(a) Ground truth (b) Resulting illumi-nation

(c) Error (d) 8 x Error

Figure 4.3: Fiveballs scene with ground truth applied

important vertices lights guessed lights error total(s) initial(s) optimal(s)

100 6 7 8.34 3.297 3.234 0.063

500 6 7 4.49 5.578 5.141 0.437

1000 6 6 4.10 7.125 6.750 0.375

1500 6 6 4.01 10.757 10.203 0.552

2000 6 6 3.75 13.515 12.724 0.791

Table 4.2: fiveballs scene under 6 artificial lights with different important vertices lights produce more simple illumination so we can estimate accurate number of lights. However, more artificial lights are distributed in the small space, it will produce very high complexity of illumination and lead to overestimate or underestimate number of real lights. Experiments show that overall atmosphere of lighting is consistent between ground truth and resulting illumination.

Fugure 4.4 is an example in this situation.

Table 4.4 shows the test case of fiveballs scene with different lightcut. Each lightcut implies a lighting configuration. If we specify the number of guessed lights by manual setting, the results show the fact that overestimating number of lights won’t increase error between ground truth and resulting illumination. Underestimating number of lights will increase error very quickly.

Figure 4.6 test our system on a real case. A user paints some shadow and shading near balls shown in figure 4.6(a). Then, this illumination can be considered as desired illumination

31

important vertices lights guessed lights error total(s) initial(s) optimal(s)

1000 1 1 2.01 0.594 0.578 0.016

1000 3 3 2.24 2.757 2.710 0.047

1000 5 5 3.82 6.203 6.016 0.187

1000 7 7-8 5.51 9.805 9.188 0.617

1000 9 8-11 6.87 14.093 12.812 1.281

1000 11 9-13 8.77 18.422 15.078 3.344

Table 4.3: compare the number of artificial lights with guessed lights in five balls scene important vertices lights guessed lights error

Table 4.4: fiveballs scene with different number of guessed lights

and it is solved by our system. Finally, our system generates resulting illumination shown in figure 4.6(b). Both illumination have similar overall atmosphere. Figure 4.7 is a more complex illumination scene which is painted by a user. Our system generates two lights in the scene successfully.

32

(a) Ground truth (b) Resulting illumi-nation

(c) Error (d) 8 x Error

Figure 4.4: Fiveballs scene with ground truth applied

(a) Ground truth (b) Resulting illumi-nation

(c) Error (d) 8 x Error

Figure 4.5: Bedroom scene with ground truth applied

(a) painted by user (b) relighting by our system

Figure 4.6: Compare desired illumination painted by user with resulted illumination

33

(a) painted by user (b) relighting by our system

Figure 4.7: Compare desired illumination painted by user with resulted illumination

C H A P T E R 5

Summary

In this chapter, we give brief conclusion of the thesis, and suggest some direction of the future work.

5.1 Conclusion

We propose a framework where a user can paint desired illumination on 3D object surface directly in any viewing, and the system automatically finds the best lighting parameters, includ-ing number of lights, the positions and intensities for each light, to achieve the desired lightinclud-ing effect. This approach can be more intuitive for the user and easier to be used.

Our system achieves these goals by casting the problem as a high-dimensional nonlinear optimization. we propose an efficient algorithm to provide an effective initial estimation and then find optimal lighting parameters globally. Experiments show that our resulting illumination is very close to desired illumination. Our system focus on overall atmosphere but not thinking about one light at a time. Our system takes little time on optimization. This advantage avoids the user waiting for long time and reach a interactive system.

34

相關文件