Introduction

Displacement mapping is a texture-based technique used to physically displace tessellated geometry. It can be controlled by either a vector texture or height map texture, which is used to perturb the surface geometry. Unlike its cheaper 『sister』 shader (Bump Map), displacement mapping affects shadows, since the geometry is actually perturbed.

Displacement置換貼圖是一種利用紋理的技術,用於空間上的扭曲經過細分的幾何體。Displacement貼圖可以是向量貼圖,也可以是高度(黑白)貼圖,它們用來扭曲曲面。與其「廉價」的「姐妹」節點(Bump貼圖)相比,使用Displacement貼圖產生產真正的陰影,因為幾何體在空間中被真正改變的形狀。

To chain displacement-maps together we supply a Displacement Blender shader node which has been optimized to efficiently blend resultant displacement vectors together.

為了同時使用幾個Displacement貼圖,我們提供了一個Displacement Blender節點。通過這個節點的優化之後,Displacement向量能更有效的融合到一起。

The output of this shader is a displacement vector, which when attached to the material displacement input will result in a perturbed surface position and normal.

該著色器輸出為置換矢量,只要連接到材質的Displacement Input即可讓物體的表面與法線扭曲。

Prerequisites先決條件

To make displacement mapping work, you』ll need to enable tessellation and displacement on your object.

要使displacement mapping 正常工作,您需要在對象上啟用細分和移位。

Please read this document for more information on how to do that.

請閱讀這個文件以獲得更多關於如何做到這一點。 Tessellation And Displacement

Displacement Parameters 置換參數

texMap紋理貼圖

Connect a texture sampling shader node here to set the displacement map input.

在此連接紋理節點,作為置換貼圖的輸入。

當Bump Mapping啟用時,該輸入對於Redshift而言存儲的只是明暗信息,而非RGBA顏色信息。如果在紋理節點與本節點之間還有其它節點(比如顏色調整節點),很難確保結果是正確的。請看下面的節點連接圖。

Scale縮放

This scales the displacement value that is read from the texture. A value of 0.0 effectively disables the technique, yielding the original surface. Greater values increase the displacement effect. Negative values invert the direction of the displacement. The default is 1.0.

該選項縮放從紋理讀到的置換值.0.0值禁用置換,保持原始表面不改變. 大於0.0的值增加置換效果。負值使位移方向反轉。默認值是1.0

Map Encoding 貼圖編碼

This determines the type of displacement to do, given the texture input type:

項用於根據紋理輸入,指定使用何種置換類型

  • Vector – a floating point displacement vector

Vector-浮點位移矢量

  • Height Field– a height-field/bump-map scale along the surface normal

Height Field-沿表面法線方向的高度場/凹凸

Space Type空間類型

When computing vector displacement, it can be done in the following geometry space:

在計算Vector Displacement時,可以在以下幾何空間中進行選擇:

  • Object – the displacement map is expected to fit onto the object geometry

Object-使用物體空間矢量計算置換

  • Tangent – the displacement map can be applied to any geometry, providing it has a known uv tangent space

使用UV切線空間矢量計算置換

Only applicable to Vector type Map Encoding.

僅適用於矢量類型Map編碼。

UV Set

Specify a UV Set other than the default here.

指定默認設置以外的UV設置。

Change Range變化範圍

Old Range Min / Max 舊範圍最小/最大值

The range of values that are read from the displacement/bump texture.

置換紋理中舊的取值範圍

New Range Min / Max新範圍最小/最大值

The new range the values will be mapped to.

數值將被映射到新的範圍。

The following 『hidden』 parameters define the displacement map.

下面這個被「隱藏」的參數連接置換貼圖

Displacement Example

Here is an example of how displacement mapping can enhance the detail of simple geometry.

下面示例說明瞭置換貼圖如何給簡單幾何形狀增加細節

The scene shows a plane that has been tessellated with the default mesh tessellation/displacement parameters. A displacement shader has been connected to the material displacement input and the displacement image is a vector map.

這個場景包含了一個使用默認Tessellated/Displacement參數做了細分的平面。Material(譯註:對應Maya中的ShadingEnginge)節點的Displacement Input以經與置換節點相連。Displacement Image使用Vector Map(矢量貼圖)。

The shader graph used to set this scene up.用於設置此場景的節點。

The displacement settings for this scene.這個場景的置換設置。

Notice how the Scale parameter of the displacement shader is very small - this is because displacement is applied in world units and in this particular example, the mesh is very small, so we only need a small amount of displacement to yield a dramatic change in the geometry shape.

注意Displacement 著色器的「比例」參數非常小 - 這是因為displacement 是以世界單位應用的,在這個特例中,網格非常小,所以我們只需要少量的displacement就可以產生巨大的變化在幾何形狀。

Here is the resultant render. See how the otherwise flat surface has geometric detail? The displacement vector map contains a different test in each quadrant. Top-left demonstrates fine perturbation high frequency detail coming out of the plane. Top-right demonstrates large perturbation low frequency detail coming out of the plane. Bottom-left demonstrates large detail, but as an indentation, going into the plane and bottom-right demonstrates fine detail going into the plane. More importantly, note how the top-right tower appears distorted and the lighting lookswrong - this is because the 『Max Displacement』 of the mesh is default to 1.0 and so the displacement is being capped to that.

下面是渲染結果,可以看到平面多出了很多細節。置換矢量貼圖在每個象限中包含了不同的信息。左上方象限上平面上展示了高頻細節。右上主象限在平面上展示了低頻細節。左下方展示了大位移的置換,凹向平面下方。右下方象限展示了凹的精細細節。重要的是,注意右上方突起結構出現了扭曲,而且光影信息似乎不正確----這是因為這個物體的Max Displacement默認為1,因此,置換的一部分被屏蔽了。

Here is the resultant render. See how the tower now stands in all its glory. At the bottom of the render you can also now see the indented tower.

下圖是渲染結果。突起的結構現在完全顯示出來了。左下部分的凹陷現在也能完全體現出來了

Here is the resultant render. See how the tower now stands in all its glory. At the bottom of the render you can also now see the indented tower.

The next image shows what the render would look like without 『Bump Mapping』 enabled. The low frequency detail towers don』t look any different, but the finer, high frequency detail parts now look blurry. Without 『Bump Mapping』, you would have to tessellate the mesh to a ridiculous level to get the same quality of detail, which of course, is not recommended.

下一圖像顯示了在沒有啟用Bump Mapping時渲染的狀態。低頻細節中突起結構看起來沒有什麼不同,但高頻細節部分現在看起來很模糊。如果沒有Bump Mapping,必須將網路細節分到非常誇張的程度纔可以得到相同的質量的細節,當然,我們不推薦這樣做。

This last image shows what the render would look like without Bump Mapping enabled.

Displacement Blender置換混合節點

General綜述

This shader allows you to blend the results of up to 4 Displacement mapping shader nodes. It is essentially a displacement equivalent of the Bump Blender shader.

通過該節點,最多可以混合四個置換節點結果。它本質上等價於凹凸融合節點。

Displacement - Redshift Documentation - Redshift Documentation

Bump Blender - Redshift Documentation - Redshift Documentation

The output of this shader is a displacement vector, which when attached to the

material displacement input will result in a perturbed surface and normal.

該節點輸入的是置換矢量,當連接到材質Displacement Input時會同時扭曲曲面和法線。

NOTE:

since this shader outputs a vector, but a material displacement shader connection in Softimage is a scalar, this node must be connected directly to the material. This means that no other math nodes can be placed after it, otherwise incorrect displacement will result.

註:由於該節點輸出向量,但Softimage中的材質置換節點為標量,因此該節點必須直接連接到材質(譯註:Maya中的Shading Engine)上。也就是說,不能將其他數學節點放在其後,否則會導致置換錯誤。

Shader Options著色器選項

Base基礎屬性

Input輸入

This is the displacement vector for the base layer of the material.

該屬性連接材質最底層的置換質量。

Layer 0, 1, 2

Input輸入

This is the displacement vector for a subsequent layer of the material.

該屬性連接其餘的置換矢量

Blend Weight混合權重

This is a scale that is applied to the displacement vector, to control the 『strength』

of the displacement.

該屬性用於縮放置換矢量,從而控制的置換強度

Additive Mode附加模式

By default the blending method for layers is that they 『take』 from the previous

layers and so on. For example, if Layer 0 had a 『Blend Weight』 of 1.0, the base layer would contribute nothing, leaving only Layer 0』s displacement contribution. This option allows you to disable that blending rule and just add the subsequent layers.

默認設置表示圖層混合方法是:用後面的層「取代」前面的層。例如,如果Layer0的Blend

weight將不再起作用,只剩下Layer0對置換施加影響。通過開啟該選項,你可以禁用這種混合規則,使得後面的Layer同樣起作用。


推薦閱讀:
相關文章