1 / 17

3D Game Programming Lab5- Texture Mapping

3D Game Programming Lab5- Texture Mapping. Goal. 讀入材質並對應貼圖座標到幾何物體 設定材質中的各項參數 管理多個材質 自行製作能對應到模型的材質貼圖 了解各種貼圖的原理. 貼圖技術. Bump mapping(1978) Normal mapping (1996) Displacement mapping (1984) Parallax mapping (2001) Relief mapping(2005). Bump mapping. 凹凸貼圖背後的原理 - 表面起伏細節的加強 什麼是凹凸貼圖.

colt-hewitt
Download Presentation

3D Game Programming Lab5- Texture Mapping

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. 3D Game ProgrammingLab5-Texture Mapping

  2. Goal • 讀入材質並對應貼圖座標到幾何物體 • 設定材質中的各項參數 • 管理多個材質 • 自行製作能對應到模型的材質貼圖 • 了解各種貼圖的原理

  3. 貼圖技術 • Bump mapping(1978) • Normal mapping (1996) • Displacement mapping (1984) • Parallax mapping (2001) • Relief mapping(2005)

  4. Bump mapping • 凹凸貼圖背後的原理 -表面起伏細節的加強 • 什麼是凹凸貼圖

  5. Bump mapping • Bump Map技術 -(Phong Shading Technique)的一項擴展 -延伸技術

  6. Bump mapping • Bump map的缺陷 -Per-pixel的凹凸紋理以較低的花費增加了豐富的幾何細節。但該方法在側影輪廓處存在缺陷。這些地方,我們看到的還是光滑的輪廓線,而沒有任何凹凸感。 -凹凸紋理不會投下自身陰影,從而看起來不真實。

  7. Normal mapping • [Krishnamurthy 1996] normal mapping • 法向量資訊生成表面的細節 • Normal Map兩種主要形式 -世界空間Normal Map(不實用) -切空間的Normal Map(常見)

  8. 切空間(tangent space) • Z:原本表面的法向量方向 • XY:表面的UV座標兩個方向(切線和bitanget vector) • 以XYZ為基底的空間: tangent space

  9. Normal mapping • RGB表示法向量在切空間的向量 • 面臨取負值的問題 • 把XYZ每個軸上的法線投影長度進行N+1/2的運算。這樣就把所有的法線壓縮到了0和1的範圍裡

  10. Normal mapping • 缺點 -Normal Map帶來的優勢是遠大於它的缺​​點 -只有視點在垂直於平面的時候NormalMap才會發揮最好的作用

  11. Parallax mapping • NormalMapping的增強算法 • 真正具有實用價值的NormalMapping • 沒有明顯改善NormalMap的問題

  12. Displacement mapping • 由Cook提出,並在Renderman中得到了商業應用。 • 改變幾何,而不是一般凹凸貼圖中改變的法向量 Bump mapping Displacement mapping

  13. 圖:Relief mapping Relief mapping • [Fabio 2005] Real-Time Relief Mapping on Arbitrary Polygonal Surfaces • 計算光線與高度場相交

  14. 光線高度場相交演算法 1.計算從視點到多邊形表面上的3D 位置點的方向(VD),用向量來表示這個方向 2.把VD 轉換到切線空間(tangent space)(定義為切線、法線和次法線組成的向量)

  15. 3.從VD'(轉換過的VD)和A、貼圖坐標(s,t) ,直到計算到B,貼圖坐標(u,v),這個位置已經到了深度值是1.0 的地方 4.使用A 和B 之間的二分查找來計算VD' 和高度域表面的相交點 5.使用計算出來的相交點的貼圖坐標來渲染每一個fragment的屬性

  16. 使用A 和B 之間的二分查找來計算VD' 和高度域表面的相交點,數字表示計算中點的順序。

  17. 問題 • 如果視線與高度域表面相交不止一個點的時候,二分搜尋的方法就可能會帶來不正確的結果 • 線性搜尋

More Related