OpenCascade Ray Tracing Rendering
摘要Abstract:OpenCascade6.7.0中引入了光線(xiàn)跟蹤算法的實(shí)現(xiàn)。使用光線(xiàn)跟蹤算法可實(shí)現(xiàn)高質(zhì)量的渲染效果,且可以使用GPU提升渲染效率。?
關(guān)鍵字Key Words:OpenCascade, Ray Tracing?
??
參考鏈接:Ray tracing as alternative rendering method for OCCT visualization component?
http://dev.opencascade.org/index.php?q=node/898
?
OpenCascade 6.7.0對(duì)顯示部分做了些重大改進(jìn),其中突破性的改變是使用OpenCL實(shí)現(xiàn)了光線(xiàn)跟蹤算法。作為庫(kù)TKOpenGl的一部分,光線(xiàn)跟蹤算法與標(biāo)準(zhǔn)的顯示模塊完全集成。從此,光線(xiàn)跟蹤也可以作為顯示的一種方法。與其他第三方庫(kù)的光線(xiàn)跟蹤庫(kù)的區(qū)別是,內(nèi)置的光線(xiàn)跟蹤算法確保了實(shí)時(shí)渲染時(shí)的性能,性能與OpenGL的性能相近,在有大量模型時(shí)性能比OpenGL的還要好。?
光線(xiàn)跟蹤功能如下:?
l High-quality shading by interpolating normal across the triangle pixels and using advanced illumination model (Phong shading);?
l Depth-correct order-independent transparency for any number of overlapped objects;?
l Sharp shadows from isotropic point and directional lights without any approximation – greatly improve visual appearance;?
l Specular reflections and environment mapping – for high-quality rendering of metallic surfaces;?
l Low-cost adaptive anti-aliasing allows to improve image quality by removing jagged edges from the image;?
l Based on cross-platform OpenCL framework – runs on GPUs of major vendors (NVIDIA and AMD/ATI);?
l Makes the most of the mid-/top-range GPUs but also runs successfully on low-end GPUs that support OpenCL。?
只要OpenCascade編譯時(shí)啟用OpenCL支持,光線(xiàn)跟蹤的使用是相當(dāng)簡(jiǎn)單,只需要調(diào)用函數(shù)V3d_View::SetRaytracingMode()就可以把3D view切換成光線(xiàn)跟蹤渲染啦。參考V3d_View和文檔或者Draw Test Harness的vraytrace和vsetraytracemode命令實(shí)現(xiàn)的源程序去詳細(xì)了解如何設(shè)置光線(xiàn)跟蹤的一些選項(xiàng)。?
最簡(jiǎn)單的測(cè)試光線(xiàn)跟蹤的方式是在Draw Test Harness中輸入如下命令:
生成效果如下圖所示:?
Figure 1.1 Render bottle and text with ray tracing?
Figure Render my email with Ray tracing
Figure 1.2 Render pipe and equipment models with ray tracing?
Figure 1.3 Render pipe and equipment models with ray tracing?
從上圖可知,使用光線(xiàn)跟蹤效果很不錯(cuò),可以看到鏡面效果,很Cool!
PDF Version: OpenCascade Ray Tracing Rendering
更多文章、技術(shù)交流、商務(wù)合作、聯(lián)系博主
微信掃碼或搜索:z360901061

微信掃一掃加我為好友
QQ號(hào)聯(lián)系: 360901061
您的支持是博主寫(xiě)作最大的動(dòng)力,如果您喜歡我的文章,感覺(jué)我的文章對(duì)您有幫助,請(qǐng)用微信掃描下面二維碼支持博主2元、5元、10元、20元等您想捐的金額吧,狠狠點(diǎn)擊下面給點(diǎn)支持吧,站長(zhǎng)非常感激您!手機(jī)微信長(zhǎng)按不能支付解決辦法:請(qǐng)將微信支付二維碼保存到相冊(cè),切換到微信,然后點(diǎn)擊微信右上角掃一掃功能,選擇支付二維碼完成支付。
【本文對(duì)您有幫助就好】元
