---
# System prepended metadata

title: UE4_材質Material 課程筆記

---

# UE4_材質Material 課程筆記
2020.8.6
## 材質編輯器與相關設定
### 貼圖 Texture Editor
* Texture/Power of Two Mode/Pad to Power 將貼圖尺寸修正成2的次方
    - 但看起來問題很多，所以還是盡量做成2次方貼圖
* Browse 找到目前所選物件的位置
### 材質 Material Editor
* Material/Home 回到編輯器原點
* Live Node 即時顯示節點狀態(?)，消耗的是編輯器的效能，不影響專案
* 打開RealTime可以看到材質的即時變化。
    - Show State/FPS 顯示材質資訊/FPS
 ![](https://i.imgur.com/ElV6mW5.png)
* Physics Material 物理材質(阻力等)，也可以噴水噴花?
* 右鍵打關鍵字找節點
* 快捷鍵 + 左鍵 可以叫初一些常用節點
    - Color：3 + 左鍵 
    - Param：S + 左鍵
    - Add：A + 左鍵
    - Multiply：M + 左鍵
* 對Color右鍵Convert to Parameter可以把節點轉成參數
* 從外面拖Texture進來會直接生成Texture Sample節點
#### Material Domain 材質類型
* 如果Domain使用Decal，Blend Mode要用Translucent
* Light Function 燈光貼圖，可以放在燈光的Light Function上
* Volume Smoke 煙雲的運算，<font color="#f00">需要研究一下</font>
* postprocess 質量空間(濾鏡)，Camera進入空間時套用
    - 想要全域則要post processing material + Array放Material進去(跨謀，<font color="#f00">再研究看看。</font>
#### Mask
* Postprocessing與Stencil通道範例
    - 物件/Detail/Rendering擴展/Render CustomDepthPass打勾，設定CustomDepth Stencil Value(要被比較的值)
    - <font color="#f00">問題：Editor裡的Mask叫不出來</font>
  ![](https://i.imgur.com/Zc7RsSe.png)
#### 全域材質
* 在Content裡右鍵Material&Texture/Material Parameter Collection新增全域材質
* 點兩下開啟編輯視窗，設定全域變數
  ![](https://i.imgur.com/TsipoYY.png)
* 在Material Editor裡新增Material Collection節點，設定全域材質
* 全域材質範例
     - Desaturation 轉黑白
  ![](https://i.imgur.com/Ldv5Q66.png)
#### Material 其他
* 可以為節點設定Group與Sort，分類好的結果會再Parameter Default裡顯示
    - <font color="#f00">問題：目前這兩個在Detail裡都沒有看到，有特定條件嗎?</font>
    - Desc 描述，可以敘述節點功能
* emissive color是最高的顏色層級
* Texture Object可計算貼圖，要參數化 <font color="#f00">(不懂，再研究)</font>
* Alt + 線段可以斷掉連結(斷開!!!!!
* 材質參數化的原因
    - 統一管理材質
    - 能讓程式控制
    - 在material裡開放參數，BP裡就能找到這些參數，就能透過BP修改材質參數

## UE4介面與相關設定
### Modes
* Geometry裡的模型可以編輯(點或布林運算?)
* Player Start 玩家開始遊戲時會在的地方
### Game View
* 查看光源時使用Lit模式
* Exposure/Game Setting 畫面太暗可以開這個
    - 但也可能被Unreal當作就真的這麼亮，應用下去會出錯，沒事不要開。
* Convert to Static Mesh 將場上的模型儲存進資源堆放區
* 按G可以開關介面上的小圖案
### World Outliner
* Label盡量整理清楚，多使用Folder將物件分門別類(Unreal有空物件嗎?)
### GameObject Detail
* Transform Scale旁邊的鎖可以鎖定縮放比例
* 在這裡編輯物件的貼圖或其他資訊時，不會影響到BP裡的資料，編輯時要特別注意一下
* 參數旁的![](https://i.imgur.com/WcL7RQY.png)代表這個參數有被更動過，能按箭頭恢復預設值
### Level
* Window/Level 叫出Level視窗
* Level/Add Existing 加入現有Level
* Level/右鍵場景/Move to Select Actor to Level 搬移物件去別的Level
* 右鍵選中的Level/Change Streaming Method/選擇Always Enable 可以解決其他Level Play時沒有顯示物件的問題
* Level/Create New 新增Level到資源堆放欄，也順便加到目前的Level裡
### Content Browser
* Window/Content Browser開啟新的資源堆放區，最多可以開啟四個
* 每次搬移物件都要按Fix Up Redirector in Folder。<font color="#f00">為什麼?</font>
* Content Browser右下角View Option/Show Engine Content 顯示Unreal內建的資源
    - 不要編輯Unreal Engine的原生資源，如有需要使用Duplicate或Ctrl+W複製資源到Content區
* Window/Load Layout/Default 恢復到預設的介面編排
* 右鍵資料夾/Add Favorite 把資料夾加入Favorite，右鍵Remove From Favorite移除
* Fliter篩選器，可用資源型態篩選。
* 點擊最左邊的![](https://i.imgur.com/Ysgih5J.png)圖示開關樹狀結構
* View Option/Thumbnail/Scale 縮放Content Browser介面
* View Option/View Type 變更Content Browser檢視型態
* 空白處按"~"叫出CMD，輸入stat unit可以查看效能資訊
### Setting
#### World Setting 全域設定
* World / Kill Z 物件的Z值超過這個數值後會被自動銷毀
* Physics / override World Gravity 改變預設的世界重力
    - Physics / Global Gravity Z 指定新的世界重力
#### Project Setting/Rendering
* Culling
    - Occlusion Culling 遮擋剔除(只渲染攝影機照到的地方)
    - Min Screen Radius for Early Z Pass 物件與攝影機的距離小於此值不顯示
    - 設定各種邊界
* Texture
    - Texture Streaming 看起來跟MipMap有關，但老師說LOD會用到，但應該是省效能用的東西(待查)
* Virtual Textures
    - 新技術，關鍵字：巨大貼圖、陣列、搜尋編號、緩衝。最早由一個叫約翰湯瑪克(?)的人提出。<font color="#f00">查無此人，名字有誤?</font>
    - [網路上找到的Virtual Texture介紹文章，不過看完還是很茫然，可以再找找看相關資料。](https://zhuanlan.zhihu.com/p/66567332)
* Forward Renderer 正向渲染
    - Forward Shading (VR內一定要勾) <font color="#f00">為什麼?</font>
    - 與之相對的應該是Deferred Rendering(延遲渲染)
    - [Forward Rendering 和 Deferred Rendering的比較](https://www.cnblogs.com/polobymulberry/p/5126892.html)
    - [關於UE4 Forward Shaing的討論](https://forums.unrealengine.com/development-discussion/rendering/1548408-how-forward-rendering-affects-performance-and-appearance)
* Lighting
    - Allow Static light 是否燒光(要勾)
    - DBuffer Decel 延遲貼花 要勾
    - DBuffer是Unreal獨有的東西，Decel是貼花，多用於彈孔，血跡，塗鴉等效果
    - [關於Decal的簡介](https://iter01.com/457546.html)
* Tessellation 密鋪
    - 或稱平面填充、細分曲面，是指把一些較小的表面填滿一個較大的表面而不留任何空隙
    - 簡單的理解成面數細分(將目前已有的面細分成更多的面)
* Postprocessing 密鋪
    - Custom Depth-Stencil Pass 如果要用Stencil，要改成Enable with Stencil
* VR 
    - Instanced Stereo 將其中一眼的畫面複製給另外一眼，可以解決左右眼看到的畫面不同步的問題
    - [關於Instanced Stereo的官方說明文件](https://docs.unrealengine.com/en-US/Platforms/VR/DevelopVR/VRPerformance/index.html)
#### Engine scalability Setting
* Quality 效能與品質設定
### Build
* Lighting Quality 燒光品質，最好先選Preview看效果，正式輸出時再用Production
### Play
* 各種Play模式，建議選用Select Viewport比較不容易出錯

### 一些記下來之後不知道在說什麼的東西 ˊ<_ˋ
* Open Level Blueprint
* 搖桿圖示可以打開Label(哪裡有搖桿阿?)
* Cinematic 過場動畫?
* Trigger Box
* Material State 查看資訊
* Decal經過景深去運算?
* Material Function
* 材質參數化
* Material Attribute
* Linear Gradiant
* CurveColorAltas(承襲Substance，可以找看看這方面的資訊)





