PBR最佳實踐(Best Practices For Physically Based Content Creation)
該視訊是Anton Hand在Unite 大會上做的分享,比較老的視訊了,但是PBR理論及最佳實踐永遠不會過時。Anton Hand在Youtube上還有一個頻道 (需科學上網),每隔一段時間會上傳一個開發日誌,演示他做的VR專案進展,有興趣的可以看一下,是關於他的VR槍戰遊戲,目前已上架Steam。本文為個人導讀兼筆記。
Best Practices For Physically Based Content Creation
03:36 首先,PBR是一個行業標準,但是不要拿著錘子看到的都是釘子,PBR工作流程是使用Unity製作內容的一個選項,但是並不是所有專案都需要引入PBR流程,PBR可以用在寫實級別場景中(對於VR場景,如果是結合傳統行業,竊以為引入PBR會有比較大的優勢,因為虛擬現實,一分為二,虛擬+現實,現實即真實,真實即寫實)。
04:28 PBR的優勢一:Anton Hand說到,他使用PBR技術,是為了一個標準的流程。演示了Roughness和Metallic的變化,對於物體材質的動態變化,比較直觀的展示了這兩個屬性作用的影響。提到了能量守恆定律,個人認為在操作層面,不用考慮太多。
![1199677-24cff2ef363ea25b.png](https://upload-images.jianshu.io/upload_images/1199677-24cff2ef363ea25b.png)
07:00 PBR的優勢二:展示了四個不同光照環境下的四張圖,類似Marmoset展示的經典鏡頭在四中光照環境中的表現。如下圖。
![1199677-f3557dc4b0596af9.png](https://upload-images.jianshu.io/upload_images/1199677-f3557dc4b0596af9.png)
你不用為了某個光照環境去進行材質的調整,只要設定了相關的物理屬性,它就會根據不同的光照環境做出相應正確的變化。
12:21 學習資料。如下圖,看過Marmoset官網Blog,值得推薦。
![1199677-40ae4822cbbd4ea6.png](https://upload-images.jianshu.io/upload_images/1199677-40ae4822cbbd4ea6.png)
09:03 PBR的必要條件:必須進行HDR和Linear Space的設定。攝像機設定為HDR,Color Space改為Linear。非必要條件:多數是Post-Processing,如Bloom、Toon Mapping、Grading以及光照。
![1199677-313314fba5c181e2.png](https://upload-images.jianshu.io/upload_images/1199677-313314fba5c181e2.png)
13:46 儘可能為一個材質提供更多的資料,這包括顏色(貼圖)、法線(貼圖)、光澤度(貼圖)、高度(貼圖)等,總之,類似描述一個事物,給的細節越多,描述越準確,即真實。
![1199677-a0c4a2e7840dcac2.png](https://upload-images.jianshu.io/upload_images/1199677-a0c4a2e7840dcac2.png)
16:29 目前有兩種常用的構建PBR材質的工作流程,一種是Spec-Gloss流程,如下圖。
![1199677-fd327f8a2a58dde4.png](https://upload-images.jianshu.io/upload_images/1199677-fd327f8a2a58dde4.png)
一種是Metal-Rough流程,來自迪士尼離線渲染解決方案,也是我常用的一套流程,PBR裡講究通道的概念,(類似PS中的通道,各位可以看一下PS中的通道概念)。
![1199677-fd99e61ece0c4ab4.png](https://upload-images.jianshu.io/upload_images/1199677-fd99e61ece0c4ab4.png)
18:33 Spec-Gloss流程的優缺點:
![1199677-10a7620b329357c3.png](https://upload-images.jianshu.io/upload_images/1199677-10a7620b329357c3.png)
21:02 Metal-Rough流程的優缺點:
![1199677-4424024c892afcda.png](https://upload-images.jianshu.io/upload_images/1199677-4424024c892afcda.png)
26:07 各種貼圖的介紹——其實現在你需要使用通道的思維來看這些貼圖了。首先是顏色貼圖,unity中成為Albedo,某些軟體如Substance中稱之為Basecolor,指的是同一種貼圖。需要注意的是,顏色貼圖中不要有光照和高光資訊。
![1199677-1d852fc028382838.png](https://upload-images.jianshu.io/upload_images/1199677-1d852fc028382838.png)
26:42 遮蔽貼圖(Occlusion Map)介紹
![1199677-e289fa46b0301f6b.png](https://upload-images.jianshu.io/upload_images/1199677-e289fa46b0301f6b.png)
28:36 Specular貼圖介紹(僅用於Spec-Gloss流程)
![1199677-164bf32a6dbc4c06.png](https://upload-images.jianshu.io/upload_images/1199677-164bf32a6dbc4c06.png)
29:35 Glossiness和Roughness貼圖,這兩個貼圖描述了同一種屬性,即微表面,不是兩個的資料是互為相反,即“光滑”和“粗糙”的區別——一個物體的表面,你可以說是粗糙的,也可以說是不光滑的。如下圖右側,兩張貼圖互為反相。
![1199677-31df7a4e8ea57a4a.png](https://upload-images.jianshu.io/upload_images/1199677-31df7a4e8ea57a4a.png)
31:33 法線貼圖介紹。市面上已經有比較多的軟體來製作法線貼圖了,3ds max、maya、blender自不必說,專業的如xNromal,Substance Designer、Substance Painter亦可烘焙法線貼圖。每家演算法不一樣,所以一定要注意設定,以確保匯入unity中不出現瑕疵。比較常見的問題是接縫。同時作者給出瞭解決方案。
![1199677-7da8222e8a3c0e8a.png](https://upload-images.jianshu.io/upload_images/1199677-7da8222e8a3c0e8a.png)
35:24 沒有自反射的物體,需要藉助預計算的反射,unity中使用Reflection Probe,IBL等。
36:19 關於SSR(Screen-Space Reflection),基於螢幕的反射。畫質優美但是耗能,尤其是在VR中,因為要渲染兩次,不建議使用。
![1199677-02519e5889090a9b.png](https://upload-images.jianshu.io/upload_images/1199677-02519e5889090a9b.png)
37:40 螢幕特效,關於Bloom,慎用,作者演示使用Bloom特效以後緩慢移動的效果,模型上某些點會有閃光,這並不是我們希望看到的。如果非要使用Bloom的話,作者推薦使用Sonic Ether's Bloom外掛。
![1199677-f161909aef18661f.png](https://upload-images.jianshu.io/upload_images/1199677-f161909aef18661f.png)
38:21 Color Grading
![1199677-cfe3e80ded17770a.png](https://upload-images.jianshu.io/upload_images/1199677-cfe3e80ded17770a.png)
38:56 SSAO/SSAOc/SSBO——螢幕遮蔽
![1199677-ca0f1141689a3292.png](https://upload-images.jianshu.io/upload_images/1199677-ca0f1141689a3292.png)
39:45 總結。
![1199677-775159674d6be6e0.png](https://upload-images.jianshu.io/upload_images/1199677-775159674d6be6e0.png)
![1199677-0831b401b479fb2f.png](https://upload-images.jianshu.io/upload_images/1199677-0831b401b479fb2f.png)