張鈞法Chun Fa Chang林郁凱Yu Kai Lin2019-09-052014-8-72019-09-052014http://etds.lib.ntnu.edu.tw/cgi-bin/gs32/gsweb.cgi?o=dstdcdr&s=id=%22GN060147015S%22.&%22.id.&http://rportal.lib.ntnu.edu.tw:80/handle/20.500.12235/106592近年來圖形處理器運算能力大幅增加,其應用紛紛走向通用圖形處理器的發展模式,藉由圖形處理器多個計算單元平行化計算的能力,可使運算效率顯著的提升,在各家廠商的支持下亦發展了開放式計算語言平台,使得在圖形處理器上設計程式的功能便利許多,並能夠有效率地處理 3D 圖學所需的大量運算。 為了使 3D 場景的繪製達到更逼真的畫質,至今已經發展了許多不同的演算法以模擬真實環境的光照情形,其中,光線追蹤方法擁有數學運算的正確性並能夠直覺性地計算光照效果,若搭配光子映射所具備的環境照明資訊,則具備繪製出擬真畫質的潛力,但是,由於需要非常龐大的計算量,使用傳統的架構都有速度上的限制,因而必須對畫面品質與渲染速度做出抉擇。幸運地是,光線追蹤演算法具有容易平行化計算的特性,可對所渲染畫面中的每一個像素平行地計算出光照色彩,利用此一特性,配合最近蓬勃發展的通用圖形處理器之能力,可得到大幅度的效能提升。 本研究渲染的對象為靜態場景,利用 OpenCL 能夠在異質系統架構中平行且良好地運作之特性,我們在現今常用的裝置實現光線追蹤以及光子映射演算法,並將重點著重於可行性的探討與提升程式效能,針對所使用的平台進行實驗結果比較以及影響效能的相關探討,最後,我們將因應平台特性將演算法與之結合,試圖找出在多核心平行化架構下提升各平台程式效能的實驗依據,並且針對光子映射演算法進行改良,使其能更加符合平行化架構特性,快速渲染出具備全域照明品質的畫面。In recent years, the computing power of graphics processor has increasedgradually, and the GPGPU application model is more popular now. The ability of parallelcomputing in graphics processors can significantly enhance computing efficiency. Andthe support of various vendors to open computing language (OpenCL) platform, leadsto convenient features and the ability to handle memory using multiple layers withdifferent bandwidth. Also, OpenCL is a good interface for the heterogeneous systemarchitecture (HSA) implementations because it naturally supports cross-platform andparallel programming of modern processors. In order to improve the image quality, a number of different algorithms have beendeveloped to simulate real-world ighting situations in 3D rendering, where the math correctness of ray tracing and the ability to calculate various lighting effects have been proved. By using the information of the illumination environment such as photon map, the image quality will get more close to photo-realistic image. However, we must make a choice between render speed and image quality on traditional architecture because the huge amount of calculation. Fortunately, the ray tracing algorithms have parallel computing feature, which can render each pixel on the screen in parallel. We take advantage of this feature to obtain a significant performance boost on GPGPU platforms. In this research, we render static scene and focus on fast rendering and global illumination effects. We implement ray tracing and photon mapping algorithms on today's commonly used devices in OpenCL and analysis the characteristics of the algorithms to adjust to OpenCL platform. We also focus on the feasibility to enhancing program performance by some experimental results and try different way to make improvements for the photon mapping algorithm.光線追蹤光子映射全域照明平行運算OpenCL異質系統架構Ray TracingPhoton MappingGlobal IlluminationParallel ComputingOpenCLHeterogeneous System Architecture使用OpenCL實現互動式光子映射Interactive Photon Mapping in OpenCL