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