關于我們
書單推薦
新書推薦
|
創(chuàng)造高清3D虛擬世界:Unity引擎HDRP高清渲染管線實戰(zhàn) 讀者對象:掌握了Unity引擎的基礎知識,想要學習如何使用高清渲染管線HDRP的內容開發(fā)者。
全書共11章,不僅包含HDRP入門基礎,更通過剖析優(yōu)秀案例對高清渲染管線的主體框架和各種特性進行闡述,如完全基于物理的光照和材質系統(tǒng)、體積光與霧效設置、光照烘焙及實時后處理效果等。本書全方位講解如何使用Unity HDRP高清渲染技術來制作高質量畫面內容。讀者不管是在開發(fā)游戲、影視動畫,還是在開發(fā)VR游戲、互動應用,都可以從本書中找到所需的高畫質內容制作技術。本書進階部分包括HDRP在VR中的具體應用方法、Unity實時光線追蹤的具體用法,以及如何使用Debug系統(tǒng)和Custom Pass高級應用等。書中包含兩個完整的Unity項目及相關操作步驟,讀者一邊操作一邊閱讀,即可把書中學到的技術直接應用到自己的項目中。
楊棟目前擔任Unity大中華區(qū)平臺技術總監(jiān),負責管理技術講師團隊并參與Unity產品本地化等相關工作。他擁有豐富的Unity開發(fā)經驗,致力于將Unity的最新技術推廣給廣大開發(fā)者。有十余年的Web端和移動端項目研發(fā)經驗,多年的海外生活與工作經驗,曾參與完美世界北美分公司后臺數據平臺研發(fā),并作為技術項目經理主導了完美世界海外手游SDK研發(fā)工作。
第1章 HDRP入門......................................................................................................1
1.1 摘要 .................................................................................................................................1 1.2 離線渲染和實時渲染 .....................................................................................................8 1.2.1 建模功能(ProBuilder、ProGrid和PolyBrush套件).....................................8 1.2.2 Timeline(非線編工具)................................................................................9 1.2.3 Cinemachine(智能攝像機系統(tǒng))..................................................................9 1.2.4 HD.Post.Processing.Effect(HDRP專用后期特效模塊)...............................9 1.2.5 可視化著色器編程工具Shader.Graph. .............................................................9 1.2.6 高級特效開發(fā)工具Visual.Effect.Graph............................................................9 1.2.7 視頻和動畫輸出工具Unity.Recorder..............................................................9 1.2.8 HDRP針對不同材質的模擬......................................................................... 10 1.3 在DCC軟件中準備模型資產 .......................................................................................10 1.3.1 在DCC軟件中使用的尺寸單位要與Unity統(tǒng)一. ........................................... 10 1.3.2 只在需要的地方使用三角面......................................................................... 11 1.3.3 紋理制作........................................................................................................ 11 1.3.4 支持FBX、USD和Alembic格式的資產導入. ................................................ 11 1.3.5 Unity.Reflect支持導入Autodesk.Revit資產.................................................. 11 1.4 Unity HDRP項目設置 ..................................................................................................12 1.4.1 創(chuàng)建一個基于高清渲染管線(HDRP)的Unity項目................................. 12 1.4.2 通過示例項目了解HDRP相關的概念和模塊.............................................. 16 1.5 學習渠道 .......................................................................................................................52 1.6 本章總結 .......................................................................................................................53 XVI | 創(chuàng)造高清3D虛擬世界:Unity引擎HDRP高清渲染管線實戰(zhàn) 第2章 實現(xiàn)市政廳辦公室場景....................................................................................54 2.1 摘要 ...............................................................................................................................54 2.2 實戰(zhàn)項目詳解 ...............................................................................................................55 2.2.1 使用Volume框架設置環(huán)境............................................................................ 58 2.2.2 添加屏幕后處理效果.................................................................................... 62 2.2.3 添加光源、Light.Probe(光照探針)和Reflection.Probe(反射探針)..........64 2.2.4 烘焙光照貼圖................................................................................................ 69 2.3 本章總結 .......................................................................................................................74 第3章 HDRP配置文件和Volume框架詳解. .................................................................75 3.1 摘要 ...............................................................................................................................75 3.2 HDRP配置文件(HDRP Asset)介紹 ........................................................................75 3.2.1 Frame.Settings(幀設置)............................................................................. 75 3.2.2 Volume框架................................................................................................... 77 3.2.3 針對不同平臺使用不同的HDRP配置文件.................................................. 94 3.3 Volume框架詳解 ..........................................................................................................96 3.3.1 Exposure(曝光控制).................................................................................. 99 3.3.2 Fog(霧效制作).........................................................................................110 3.3.3 Lighting(光照)..........................................................................................121 3.3.4 Material(材質)..........................................................................................121 3.3.5 Shadowing(陰影處理)..............................................................................122 3.3.6 Sky(天空).................................................................................................122 3.3.7 Post-processing(后處理)..........................................................................126 3.3.8 Ray.Tracing(實時光線追蹤)....................................................................126 3.3.9 Local.Volume(本地Volume)使用示例.....................................................126 3.4 本章總結 .....................................................................................................................130 第4章 HDRP光照系統(tǒng)詳解.....................................................................................131 4.1 摘要 .............................................................................................................................131 4.2 Sponza_Day_Lighting場景打光步驟解析 .................................................................131 4.2.1 步驟1:啟用Scene.Settings.Volume..............................................................134 4.2.2 步驟2:啟用Directional.Light(平行光)...................................................136 目 錄 | XVII 4.2.3 步驟3:啟用Volume中的自動曝光控制......................................................138 4.2.4 步驟4:啟用所有燈籠模型和點光源..........................................................139 4.2.5 步驟5:啟用場景中所有反射探針(Reflection.Probe)............................140 4.2.6 步驟6:啟用場景中的光照探針組(Light.Probe.Group).........................143 4.2.7 步驟7:完成整個場景的光照烘焙..............................................................145 4.2.8 步驟8:增強間接光強度..............................................................................150 4.2.9 步驟9:處理陰影和環(huán)境光遮蔽..................................................................154 4.2.10 步驟10:添加霧效. .....................................................................................166 4.2.11 步驟11:畫面抗鋸齒處理..........................................................................168 4.2.12 步驟12:添加后處理Volume組件. .............................................................171 4.3 Sponza_Night_Lighting場景打光步驟解析 ..............................................................173 4.3.1 修改Directional.Light設置. ............................................................................173 4.3.2 修改Scene.Settings.Volume→HDRI.Sky設置...............................................174 4.3.3 修改Scene.Settings.Volume→Exposure(曝光)設置..................................174 4.3.4 修改Scene.Settings.Volume→Fog(霧效)設置..........................................175 4.3.5 修改Scene.Settings.Volume→Contact.Shadow(接觸陰影)設置...............175 4.3.6 修改Post.Processing.Volume→Color.Adjustment(顏色調整)設置...........175 4.3.7 修改Post.Processing.Volume→White.Balance(白平衡)設置....................176 4.4 光源類型和模式 .........................................................................................................177 4.4.1 Unity中的光源類型有哪幾種. ......................................................................177 4.4.2 Unity中的光照單位......................................................................................200 4.4.3 如何制作和使用Light.Cookie為燈光添加更多細節(jié)....................................201 4.4.4 光照相關的常見問題匯總............................................................................204 4.5 光源分層 .....................................................................................................................212 4.5.1 光源分層的作用...........................................................................................212 4.5.2 光源分層實例講解.......................................................................................212 4.6 使用光照探針 .............................................................................................................217 4.6.1 為什么要使用光照探針. ...............................................................................217 4.6.2 使用光照探針的基本步驟............................................................................218 4.6.3 Mesh.Renderer組件中的Probes選項詳解.....................................................223 4.6.4 如何使用Mesh.Renderer組件的Probes→Anchor.Override參數. ..................227 4.6.5 如果打開了Lighting窗口中Debug.Settings中的All.Probes.No.Cells選項,. 但是在Scene窗口看不到光照探針如何處理. ...............................................230 XVIII | 創(chuàng)造高清3D虛擬世界:Unity引擎HDRP高清渲染管線實戰(zhàn) 4.7 使用Reflection Probe為場景提供反射信息 ..............................................................231 4.7.1 Screen.Space.Reflection(屏幕空間反射)..................................................231 4.7.2 Reflection.Probe(反射探針).....................................................................233 4.7.3 Sky.reflection(天空反射)..........................................................................242 4.8 陰影 .............................................................................................................................242 4.8.1 陰影的種類和三種光照模式........................................................................242 4.8.2 兩種Shadowmask模式下的陰影表現(xiàn). ...........................................................244 4.8.3 陰影的最大投射距離設置............................................................................248 4.8.4 Distance.Shadowmask和Shadowmask兩種模式對性能的影響. .....................248 4.9 本章總結 .....................................................................................................................249 第5章 Lightmapping(光照烘焙)詳解. ...................................................................250 5.1 摘要 .............................................................................................................................250 5.2 漸進式光照貼圖烘焙對場景中的模型有什么要求 .................................................252 5.3 漸進式光照貼圖烘焙對硬件的要求是什么?支持Unity的哪些渲染管線 ............257 5.4 進行漸進式光照貼圖烘焙時烘焙出來的是什么 .....................................................257 5.5 漸進式光照貼圖烘焙的CPU版本和GPU版本有什么區(qū)別 .....................................261 5.6 光照貼圖烘焙界面參數詳解 .....................................................................................261 5.7 不同顯卡對GPU版本的烘焙效率有什么影響 .........................................................275 5.8 相同場景使用CPU烘焙需要多長時間 .....................................................................279 5.9 為什么GPU版本在烘焙的過程中,有時會自動切換成CPU版本 .........................279 5.10 如何避免GPU烘焙自動切換成CPU烘焙 ...............................................................280 5.11 如何解決光照貼圖接縫問題 ...................................................................................282 5.12 如何整體地查看光照貼圖的不同組成部分 ...........................................................283 5.13 如何查看場景中的模型在光照貼圖中的位置? 如何調整模型在光照貼圖中的占比大小 ...............................................................284 5.14 本章總結 ...................................................................................................................288 第6章 HDRP材質詳解...........................................................................................289 6.1 摘要 .............................................................................................................................289 6.2 使用Lit著色器制作典型材質 ....................................................................................290 6.2.1 木頭材質.......................................................................................................290 目 錄 | XIX 6.2.2 冰箱材質.......................................................................................................298 6.2.3 陶瓷材質.......................................................................................................300 6.2.4。ㄆ胀ǎ┎AР馁|.......................................................................................306 6.2.5。◣д凵涞模┎AР馁|. ...............................................................................312 6.2.6 半透明材質和次表面散射材質....................................................................317 6.2.7 自發(fā)光材質...................................................................................................327 6.2.8 Decal(貼花)的具體使用方法...................................................................330 6.3 渲染器和材質優(yōu)先級 .................................................................................................339 6.4 使用HDRP自帶的示例材質庫 ..................................................................................340 6.4.1 金屬箔材質...................................................................................................342 6.4.2 肥皂泡材質...................................................................................................345 6.5 本章總結 .....................................................................................................................348 第7章 Post.Processing后處理詳解. ........................................................................350 7.1 摘要 .............................................................................................................................350 7.2 為場景添加后處理效果的步驟 .................................................................................351 7.3 后處理效果應用順序和效果組合 .............................................................................351 7.4 HDRP中的后處理效果 ..............................................................................................352 7.4.1 Tonemapping(色調映射).........................................................................353 7.4.2 White.Balance(白平衡)............................................................................354 7.4.3 Bloom(泛光)............................................................................................354 7.4.4 Film.Grain(膠片顆粒)..............................................................................356 7.4.5 Depth.of.Field(景深)................................................................................357 7.4.6 Panini.Projection(帕尼尼投影)................................................................359 7.4.7 Lens.Distortion(鏡頭畸變).......................................................................360 7.4.8 Motion.Blur(運動模糊). ...........................................................................360 7.4.9 Chromatic.Aberration(色差).....................................................................362 7.4.10 Vignette(暈映)........................................................................................363 7.4.11 Lift、Gamma和Gain(顏色分級).............................................................364 7.4.12 Channel.Mixer(通道混合)......................................................................365 7.4.13 Color.Curve(顏色曲線).........................................................................366 7.4.14 Color.Adjustment(顏色調整).................................................................367 7.4.15 Split.Toning(分離調色)..........................................................................368 XX | 創(chuàng)造高清3D虛擬世界:Unity引擎HDRP高清渲染管線實戰(zhàn) 7.4.16 Shadow、Midtones、Highlights(陰影、中間調、高光).......................369 7.5 本章總結 .....................................................................................................................370 第8章 HDRP.Debug窗口介紹................................................................................371 8.1 摘要 .............................................................................................................................371 8.2 Material(材質)相關的Debug窗口 .........................................................................372 8.3 Lighting(光照)相關的Debug窗口 ........................................................................374 8.4 Camera(相機)相關的Debug窗口 ..........................................................................376 8.5 MatCap顯示模式的使用方法 ....................................................................................378 8.6 本章總結 .....................................................................................................................380 第9章 HDRP在VR中的應用...................................................................................381 9.1 摘要 .............................................................................................................................381 9.2 HDRP VR支持的平臺 ................................................................................................381 9.2.1 系統(tǒng)要求.......................................................................................................381 9.2.2 支持的平臺...................................................................................................382 9.3 配置HDRP項目以支持VR .........................................................................................382 9.4 可以應用到VR中的HDRP功能 .................................................................................387 9.5 將市政廳辦公室場景轉換成HDRP VR ....................................................................388 9.5.1 配置HDRP+VR...........................................................................................388 9.5.2 配置XR.Plug-in.Management......................................................................388 9.5.3 添加XR.Interaction.Toolkit..........................................................................388 9.5.4 創(chuàng)建XR.Rig、控制器和瞬移區(qū)域...............................................................389 9.5.5 創(chuàng)建轉向系統(tǒng)...............................................................................................395 9.5.6 創(chuàng)建可交互物體...........................................................................................396 9.5.7 構建項目到設備...........................................................................................397 9.6 在VR設備中進行Debug .............................................................................................398 9.7 本章總結 .....................................................................................................................400 第10章 HDRP.Custom.Pass應用..........................................................................401 10.1 摘要 ...........................................................................................................................401 10.2 Custom Pass實例解析 ..............................................................................................401 目 錄 | XXI 10.2.1 實例講解1...................................................................................................402 10.2.2 實例講解2...................................................................................................407 10.3 如何查看Custom Pass的渲染階段 ..........................................................................408 10.4 本章總結 ...................................................................................................................409 第11章 HDRP實時光線追蹤項目應用......................................................................410 11.1 摘要 ...........................................................................................................................410 11.1.1 運行光追應用所需的軟硬件......................................................................411 11.1.2 Unity光追功能在編輯器中的位置.............................................................411 11.2 配置HDRP光追項目 ................................................................................................414 11.2.1 將普通HDRP項目升級到支持光追的HDRP項目....................................414 11.2.2 進一步設置HDRP配置文件(HDRP.Asset)啟用相關的光追功能. .......417 11.2.3 在HDRP.Default.Settings界面啟用相機的Frame.Settings中的光追功能.....421 11.2.4 在Scene窗口打開相機的抗鋸齒功能和啟用刷新設置..............................422 11.3 光追功能的使用方法 ...............................................................................................423 11.3.1 環(huán)境光遮蔽.................................................................................................424 11.3.2 屏幕空間反射.............................................................................................427 11.3.3 屏幕空間全局光.........................................................................................431 11.3.4 Light.Cluster的使用.....................................................................................433 11.3.5 屏幕空間陰影.............................................................................................439 11.3.6 次表面散射.................................................................................................443 11.3.7 遞歸式渲染.................................................................................................450 11.3.8 路徑追蹤.....................................................................................................453 11.4 本章總結 ...................................................................................................................457 附錄A 基于物理的光照單位和參考數值(參考自Unity.HDRP官方文檔).....................458 附錄B 色溫(Color.Temperature).......................................................................463 附錄C 在Unity中制作高質量的光照效果...................................................................464
你還可能感興趣
我要評論
|