Parallax occlusion mapping
![](https://static.wixstatic.com/media/204c38_9bbf743d8b0c49e8b2b307d352d1adf1~mv2.png/v1/fill/w_980,h_548,al_c,q_90,usm_0.66_1.00_0.01,enc_auto/204c38_9bbf743d8b0c49e8b2b307d352d1adf1~mv2.png)
視差遮擋貼圖 Parallax Occlusion Mapping (POM)
視差遮擋貼圖 (POM) 是視差貼圖技術的增強。 視差遮擋貼圖 用於在紋理表面中按程式建立 3D 定義,使用Displacement map而不是透過產生新幾何體。 這使得3D 渲染應用程式的開發人員能夠在紋理中添加3D 複雜性,這些紋理會相對於透視正確地變化並即時進行自遮擋(另外還可以實現自陰影),而無需犧牲透過幾何計算創建相同效果所需的處理器週期.
From Wikipedia:
https://en.wikipedia.org/wiki/Parallax_occlusion_mapping
Normal Map VS Relief Map
從某些角度觀看時,法線貼圖的結果會顯得過於平坦。 即時渲染時必須始終考慮資料成本,因此擴展了 Relief Mapping(浮雕映射)。 然而,Relief Mapping 在特殊角度下仍然會存在一些缺陷。
The main steps of POM:
Height map 提供的高度信息,以及從像素深度和相機位置導出的向量。 從目前 UV 和高度圖執行線性碰撞檢測。 當偵測到碰撞時,返回目前的偏移量,並將採樣的UV添加到此Offset中,這意味著使用反向高度圖追蹤。 一般POM用於混凝土路面等平坦表面
Create Material
![](https://static.wixstatic.com/media/204c38_499257f85913407bb205eee4bd926d4f~mv2.png/v1/fill/w_553,h_312,al_c,q_85,enc_auto/204c38_499257f85913407bb205eee4bd926d4f~mv2.png)
Add Parallax Occlusion Mapping node
![](https://static.wixstatic.com/media/204c38_16e96570e0214ea7959dca8b6711a43b~mv2.png/v1/fill/w_553,h_312,al_c,q_85,enc_auto/204c38_16e96570e0214ea7959dca8b6711a43b~mv2.png)
Height Map into Material, 但無法連接上 Heightmap texture
![](https://static.wixstatic.com/media/204c38_1cd3fc65668742f9a70b6ea44f42564c~mv2.png/v1/fill/w_553,h_312,al_c,q_85,enc_auto/204c38_1cd3fc65668742f9a70b6ea44f42564c~mv2.png)
Must change to Texture object
Right click > Converts to Texture Object and connect it
![](https://static.wixstatic.com/media/204c38_70c868ebdf174c5593f05afb3e3bcbc4~mv2.png/v1/fill/w_553,h_312,al_c,q_85,enc_auto/204c38_70c868ebdf174c5593f05afb3e3bcbc4~mv2.png)
Scalar Parameter
有三種方法 得到 scalar parameter
方法 1:
![](https://static.wixstatic.com/media/204c38_1310e9a29c7340caa83607cb4250c4c5~mv2.png/v1/fill/w_264,h_140,al_c,q_85,enc_auto/204c38_1310e9a29c7340caa83607cb4250c4c5~mv2.png)
方法2:
1.鍵盤按1,並按下左鍵會生成一個節點
在節點按下右鍵,Convert to Parameter
![](https://static.wixstatic.com/media/204c38_390039a663bf424d9b697809212b3155~mv2.png/v1/fill/w_553,h_312,al_c,q_85,enc_auto/204c38_390039a663bf424d9b697809212b3155~mv2.png)
方法3:
鍵盤按S,並按下左鍵會生成一個節點
Default:
*Height rate: 0.04
*Min Stepts: 8
*Max Stepts: 16
*Ref Plane: 0.2
Heightmap channel (V4)
Search Constant4Vector
![](https://static.wixstatic.com/media/204c38_cddf8aa7044a46e7ad62e503c7e838f9~mv2.png/v1/fill/w_553,h_312,al_c,q_85,enc_auto/204c38_cddf8aa7044a46e7ad62e503c7e838f9~mv2.png)
Constant4Vector:
R:1, G:0 , B:0, A:0
![](https://static.wixstatic.com/media/204c38_04877d940da14b2a9a8eea86da5b88e7~mv2.png/v1/fill/w_553,h_254,al_c,q_85,enc_auto/204c38_04877d940da14b2a9a8eea86da5b88e7~mv2.png)
Render shadows (occlusion mapping) : StaticBool (True)
Light Vector: SkyAtmosphereLightDirection
Shadow stepts: 32
![](https://static.wixstatic.com/media/204c38_695bb695adef4cf180a764d85bf83380~mv2.png/v1/fill/w_554,h_445,al_c,q_85,enc_auto/204c38_695bb695adef4cf180a764d85bf83380~mv2.png)
分類
Group 輸入分類名字,將全部的 Parameter 放進這個Group
![](https://static.wixstatic.com/media/204c38_2094dbfb6f6f4e19a271ca926bae864d~mv2.png/v1/fill/w_410,h_296,al_c,q_85,enc_auto/204c38_2094dbfb6f6f4e19a271ca926bae864d~mv2.png)
將Basic Color, roughness, normal map放進來
因POM已經生成一個shadow mask 我們在Basic color 使用Lerp處理這張Mask
Pixel Depth offset 連上 Pixel Depth offset
![](https://static.wixstatic.com/media/204c38_10a658d0e3d144df9966c77a75145966~mv2.png/v1/fill/w_554,h_307,al_c,q_85,enc_auto/204c38_10a658d0e3d144df9966c77a75145966~mv2.png)
Final Material
![](https://static.wixstatic.com/media/204c38_3e2c18a000bf431c939f5a9cfe5503ce~mv2.png/v1/fill/w_553,h_260,al_c,q_85,enc_auto/204c38_3e2c18a000bf431c939f5a9cfe5503ce~mv2.png)
Material Instance: 調整屬性
Create Material Instance
Material > Right Click > Create Material Instance
![](https://static.wixstatic.com/media/204c38_ad3b57660bdb48f488ad3876a2137ec2~mv2.png/v1/fill/w_553,h_312,al_c,q_85,enc_auto/204c38_ad3b57660bdb48f488ad3876a2137ec2~mv2.png)
Material Instance: Adjust properties
![](https://static.wixstatic.com/media/204c38_02320916fcbb4b6297624ffe8423ce75~mv2.png/v1/fill/w_553,h_240,al_c,q_85,enc_auto/204c38_02320916fcbb4b6297624ffe8423ce75~mv2.png)
新增地板,材質放入,看效果,再去做材質屬性調整。
1.Create Plane
Shapes > Plane
2.Crabe Material Instance into plane
![](https://static.wixstatic.com/media/204c38_b445f57e5c4c42a986e951aa689ef080~mv2.png/v1/fill/w_553,h_312,al_c,q_85,enc_auto/204c38_b445f57e5c4c42a986e951aa689ef080~mv2.png)
Shadow:
Select plane > detials >cast shdow : Turn off
![](https://static.wixstatic.com/media/204c38_cd35e2d5564a41d1867d77a37b287e16~mv2.png/v1/fill/w_553,h_312,al_c,q_85,enc_auto/204c38_cd35e2d5564a41d1867d77a37b287e16~mv2.png)
Youtube Tutorial:
pebbles texture download:
教學材質球和文件下載 / Material and Document Download:
贊助 / Support Me
BuyMeAcoffee: https://www.buymeacoffee.com/lutopialab
Patreon: https://www.patreon.com/LutopiaLab/
Comments