天天看點

Smoothness 平滑度 Standard Shader系列9Smoothness 平滑度

Smoothness 平滑度

本文檔主要是對Unity官方手冊的個人了解與總結(其實以翻譯記錄為主:>)

僅作為個人學習使用,不得作為商業用途,歡迎轉載,并請注明出處。

文章中涉及到的操作都是基于Unity2018.3版本

參考連結:https://docs.unity3d.com/Manual/StandardShaderMaterialParameterSmoothness.html

Smoothness 平滑度 Standard Shader系列9Smoothness 平滑度

The smoothness parameter, shown in both Metallic & Specular shader modes.

平滑參數,顯示在金屬和高光着色模式。

The concept of Smoothness applies to both the Specular workflow and the Metallic workflow, and works in very much the same way in both. By default, without a Metallic or Specular texture map assigned, the smoothness of the material is controlled by a slider. This slider allows you to control the “microsurface detail” or smoothness across a surface.

平滑的概念既适用于高光工作流,也适用于金屬工作流,兩者的工作方式非常相似。預設情況下,沒有指定金屬或高光紋理貼圖,材質的平滑度由滑塊控制。這個滑塊允許你控制“微表面細節”或表面的平滑度。

Both shader modes are shown above, because if you choose to use a texture map for the Metallic or Specular parameter, the moothness values are taken from that same map. This is explained in further detail down the page.

這兩種渲染模式都顯示在上面,因為如果你選擇使用紋理貼圖作為金屬或高光參數,平滑值是從相同的貼圖中擷取的。這将在後面的頁面中詳細解釋。

Smoothness 平滑度 Standard Shader系列9Smoothness 平滑度

A range of smoothness values from 0 to 1

The “microsurface detail” is not something directly visible in Unity. It is a concept used in the lighting calculations. You can, however, see the effect of this microsurface detail represented by the amount the light that is diffused as it bounces off the object. With a smooth surface, all light rays tend to bounce off at predictable and consistent angles. Taken to its extreme, a perfectly smooth surface reflects light like a mirror. Less smooth surfaces reflect light over a wider range of angles (as the light hits the bumps in the microsurface), and therefore the reflections have less detail and are spread across the surface in a more diffuse way.

“微表面細節”在Unity中不是直接可見的。這是一個用于照明計算的概念。然而,你可以看到這個微表面細節的效果,它是由物體反彈的光線量來表示的。由于表面光滑,所有的光線都傾向于以可預測且固定的角度反彈。極端情況下,一個完美光滑的表面像鏡子一樣反射光線。不光滑的表面反射光線的角度在一個更大的範圍(像光線照射到微表面的凹凸不平處時),是以反射的細節更少,以一種更分散的方式分布在表面上。

Smoothness 平滑度 Standard Shader系列9Smoothness 平滑度

A comparison of low, medium and high values for smoothness (left to right), as a diagram of the theoretical microsurface detail of a material. The yellow lines represent light rays hitting the surface and reflecting off the angles encountered at varying levels of smoothness.

平滑度的低值、中值和高值的比較(從左到右),作為材質的理論微觀表面細節圖。黃色的線表示光線撞擊表面,反射出不同平滑程度的角度。

A smooth surface has very low microsurface detail, or none at all, so light bounces off in uniform ways, creating clear reflections. A rough surface has high peaks and troughs in its microsurface detail, so light bounces off in a wide range of angles which, when averaged out, create a diffuse colour with no clear reflections.

光滑的表面具有非常低的微表面細節,或者根本沒有,是以光線以均勻的方式反彈,産生清晰的反射。粗糙的表面在其微觀表面細節上有高峰和低谷,是以光線會以大範圍的角度反彈,當取平均值時,就會産生漫反射的顔色,沒有清晰的反射。

Smoothness 平滑度 Standard Shader系列9Smoothness 平滑度

A comparison of low, medium and high values for smoothness (top to bottom).

平滑度的低值、中值和高值的比較(從上到下)。

At low smoothness levels, the reflected light at each point on the surface comes from a wide area, because the microsurface detail is bumpy and scatters light. At high values of smoothness, the light at each point comes from a narrowly focused area, giving a much clearer reflection of the object’s environment.

在低光滑度的情況下,由于微表面的細節凹凸不平的、分散光線,是以表面上每個點的反射光來自一個很大的區域。在平滑度較高的情況下,每一點的光線都來自于一個聚焦較窄的區域,進而更清晰地反映出物體所處的環境。

Using a Smoothness Texture Map 使用平滑紋理貼圖

In a similar way to many of the other parameters, you can assign a texture map instead of using a single slider value. This allows you greater control over the strength and colour of the specular light reflections across the surface of the material.

與許多其他參數類似,您可以指派紋理映射,而不是使用單個滑塊值。這可以讓你更好的控制材質表面高光反射的強度和顔色。

Using a map instead of a slider means you can create materials which include a variety of smoothness levels across the surface (usually designed to match what is shown in the albedo texture).

使用貼圖而不是滑塊意味着你可以建立包含各種平滑度的材質(通常設計成與反照率紋理中顯示的相比對)。

Property Function
Smoothness source Select the texture channel where the smoothness value is stored.
平滑源 選擇存儲平滑度值的紋理通道。
Specular/Metallic Alpha Because the smoothness of each point on the surface is a single value, only a single channel of an image texture is required for the data. Therefore the smoothness data is assumed to be stored in the Alpha Channel of the same image texture used for the Metallic or Specular texture map (depending which of these two modes you are using).
高光/金屬 Alpha 因為表面上每個點的平滑度都是一個值,是以資料隻需要圖像紋理的一個通道。是以,平滑度資料被假定存儲在用于金屬紋理或高光紋理貼圖的同樣圖像紋理的Alpha通道中(取決于您正在使用這兩種模式中的哪一種)。
Albedo Alpha This lets you reduce the total number of textures, or use textures of different resolutions for Smoothness and Specular/Metallic.
反照率 Alpha 這讓你減少紋理的總數,或使平滑和高光/金屬紋理可以用不同于反照率的不同分辨率。
Highlights Check this box to disable highlights. This is an optional performance optimization for mobile. It removes the calculation of highlights from the Standard Shader. How this affects the appearance mainly depends on the Specular/Metallic value and the Smoothness.
高亮顯示 選中此框以禁用高亮顯示。這是一種可選的移動性能優化。它從标準着色器中移除高光的計算。這如何影響效果主要取決于鏡面/金屬值和平滑度。
Reflections Check this box to disable environment reflections. This is an optional performance optimization for mobile. It removes the calculation of highlights from the Standard Shader. Instead of sampling the environment map, an approximation is used. How this affects the appearance depends on the smoothness.
反射 選中此框以禁用環境反射。這是一種可選的移動性能優化。它從标準着色器中移除反射(應該寫錯了)的計算。使用近似值來代替環境貼圖的采樣。這如何影響外觀取決于平滑度。

Smoother surfaces are more reflective and have smaller, more tightly-focused specular highlights. Less smooth surfaces do not reflect as much, so specular highlights are less noticable and spread wider across the surface. By matching the specular and smoothness maps to the content in your albedo map, you can begin to create very realistic-looking textures.

越光滑的表面,反射性更多,具有更小、更緊密聚焦的高光。不太光滑的表面反射不那麼多,是以高光不太容易被注意到,并在表面上擴散得更廣。通過比對高光和平滑貼圖到你的反照率貼圖的内容,你可以開始建立非常逼真的紋理。

繼續閱讀