Light and Matter-The theory of Physically-Based Rendering and Shading

Light and Matter
光照和物质
The theory of Physically-Based Rendering and Shading
基于物理渲染和着色的原理

Light is a complex phenomenon as it can exhibit properties of both a wave and a particle. As a result, different models have been created to describe the behavior of light. As texture artists, we are interested in the Light Ray Model as it describes the interaction of light and matter. It’s important for us to understand how light rays interact with surface matter because our job is to create textures that describe a surface. The textures and materials we author interact with light in our virtual worlds and the more we understand about how light behaves, the better our textures will look.
光照是一种复杂的现象,因为它能够展示出波粒二象性。结果是,不同的(光照)模型(K:不是Max里面的模型)被创建出来描述光照的行为。作为贴图艺术师,我们对Light Ray模型感兴趣,因为它能够描述光线和物质的交互。理解光线与物质表面的交互是很重要的,因为我们的工作是创建贴图来描述一个表面。我们创建的纹理和材质会在我们的虚拟世界中与光照进行交互,我们对光照的行为理解得越多,我们就能够创建出更好的贴图。

In this guide, we will discuss the theory behind the physics through which physically-based rendering models are based upon. We will start with a light ray and work up to defining the key factors for PBR.
在这个指南中,我们将会讨论隐藏在背后中的物理原理,这个原理是基于物理渲染(PBR)模型所依赖的。我们将会从一个光线(light ray)开始,逐步建立那些定义PBR的关键因素。

Light Rays

The Light Ray Model states that a light ray has the trajectory of a straight line in homogeneous transparent media such as air. The Light Ray Model also says that the ray will behave in a predictable manner when encountering surfaces such as opaque objects or passing through a different medium such as air to water. This makes it possible to visualize the path the light ray will follow as it moves from a starting point to where it eventually changes into another form of energy such as heat.
Light Ray模型说明,一个光线在均匀透明的介质中(如空气)是直线传播的。Light Ray模型也表示,一束光线当遇到像不透明物体时会表现出一种能够预期的行为或者会穿过不同的介质,就如从空气到水中。这使得(我们)能够看到这束光线变化的过程,这过程就如从开始点到最终变化为另一种形式的能量,例如热。

The light ray that hits a surface is called the Incident Ray and the angle that at which it hits is called the Angle of Incidence as shown in figure 01.
一束撞击到表面上的光线被称为入射光线,光线与表面碰撞产生的角度被称为入射角,如图01所示。

When a light ray hits a surface, either or possibly both of these things can happen:
当一束光线撞击到表面上时,下面描述的其中之一或者两者都可能发生:

1.The light ray is reflected off the surface and travels in a different direction. It follows the Law of Reflection, which states that the Angle of Reflection is equal to the Angle of Incidence (Reflected Light).
1.这束光线从表面上反射并且往不同的方向。它遵循反射定律,这个定律表示反射角与入射角是相等的(反射光)。

2.The light ray passes from one medium to another in the trajectory of a straight line (Refracted Light).
2.这束光线以直线形式从一种介质传递到另一种介质(折射光)。

At this point, we can state that light rays split into two directions: reflection and refraction. At the surface, the ray is either reflected or refracted and it can be eventually absorbed by either medium. However, absorption doesn't occur at the surface.
到目前为止,我们能够认为,光线分成两个方向:反射和折射。在(物体)表面上,这束光线要不反射或者折射并且它最终会被其他介质吸收。然而,吸收并不是发生在表面上的。


A light ray is incident on a plane interface between two media.
一束光线在被平面间开的两种媒介上入射


Figure 01

Absorption and Scattering (Transparency and Translucency)
吸收和散射(透明和半透明)

When traveling in an inhomogeneous medium or translucent material, light can be absorbed or scattered:
当在均匀或者半透明的媒介中传播时,光会被吸收或者散射:

1.With absorption, the light intensity decreases as it is changed into another form of energy (usually heat), and its color changes as the amount of light absorbed depends on the wavelength, but the direction of the ray doesn't change.
1.对于吸收,光的强度会减低,因为它会改变为另一种形式的能量(通常是热),并且它的颜色会改变,因为光被吸收的量会依赖于(光的)波长,但光线传播的方向不会变化。

2.With scattering, the ray direction is changed randomly, the amount of deviation depending on the material. Scattering randomizes light direction but the intensity doesn't change. An ear is a good example. The ear is thin (absorption is low), so you can see the scattered light penetrating out of the back of the ear. If there is no scattering and the absorption is low, rays can pass directly through the surface such as with glass. For example, if you are swimming in a pool, which is hopefully clean, you can open your eyes and see at a fairly good distance through the clear water. However, let’s imagine that same pool hasn't been cleaned in a while and the water is dirty. The dirt particles scatter the light and thus make the clarity of the water much lower.
2.对于散射,光线的方向会随机地改变,偏离的量依赖于对应的材质。散射会随机改变光照的方向,但强度不会改变。耳朵是一个很好的例子。耳朵是薄的(吸收低),所以你能够看到散射光渗透出耳朵的背面。如果没有散射并且吸收低,光线能够直接穿过表面,就如玻璃一样。例如,如果你在泳池游泳,假设泳池是很干净的,你能够睁开你的眼睛,透过清澈的水,看到相当远的距离。然而,想像一下在相同的泳池里,水是邋遢的、不干净的。这些灰层粒子散射了光线,因此导致水中的清晰度降低。

The further light travels in such a medium/material, the more it is absorbed and/or scattered. Therefore, object thickness plays a large role in how much the light is absorbed or scattered. A thickness map can be used to describe object thickness to the shader as shown in figure 02.
光在这种媒介/材质中传播越久,它被散射或者被吸收得就会越多。因此,物体的厚度在光线被吸收和散射多少中,扮演着一个重要的角色。一个厚度贴图能够在着色器中,被用来描述物体的厚度。如图02。

Object thickness plays a large role in how much the light is absorbed or scattered
对于光线被吸收和散射多少,物体的厚度扮演着一个重要的角色

Figure 02



Diffuse and Specular Reflection
Diffuse和Specular反射

Specular reflection is light that has been reflected at the surface, as we discussed above in the Light Ray section. The light ray is reflected off the surface and travels in a different direction. It follows the Law of Reflection, which states that on a perfectly planar surface the Angle of Reflection is equal to the Angle of Incidence. However, it is important to note that most surfaces are irregular and that the reflected direction will therefore vary randomly based on the surface roughness. This changes light direction, but the light intensity remains constant.
高光反射是光在表面上的反射,就如我们在上面Light Ray部分讨论的一样。光线被反射出表面并沿不同的方向传播。这遵循反射定律,它表明,在一个完美的平面上,反射角等于入射角。然而,大部分的表面都是不规则的,因此反射的方向会基于表面的粗糙度随机地变化。不规则的表面会改变光的方向,但光的强度仍然是不变的。

Rougher surfaces will have larger and dimmer looking highlights. Smoother surfaces will keep specular reflections focused, which can appear to look brighter or more intense when looked at from the proper angle. However, the same total amount of light is reflected in both cases as shown in figure 03.
粗糙的表面能看到更大更暗的高光。平滑的表面能够保持高光的聚焦反射,这会看上去更亮或者在合适的角度上观察时,(光照会)更强。然而,两种情况所反射的光量都是相同的,如图3所示。

Diffuse reflection is light that has been refracted. The light ray passes from one medium to another and is scattered multiple times inside the object. Then it is refracted again out of the object making its way back to the original medium at approximately the same point where it went through the first time as shown in figure 04.
漫反射是由于光的折射产生的。光线从一种媒介进入到另一种媒介,并且会在物体的内部经过多次散射。然后,它(在物体内部)会在接近相同的入射点处,再一次折射出物体回到原来的媒介中。如图4所示。

Diffuse materials are fairly absorbent, meaning that if the refracted light travels for too long in that material, it has a good chance of being completely absorbed. This means that if the light ever comes out of that material, it has probably not traveled very far from the point of entry. That's why the distance between the entry and exit points can be neglected. The Lambertian model, which is usually used for diffuse reflection in a traditional shading sense, does not take surface roughness into account, but there are diffuse reflection models that do such as Oren-Nayar.
漫射材质是很容易吸收(光的能量)的,意味着,如果折射光在这个材质中传播很久,折射的光有很大的可能会被完全吸收,折射光线在距离入射点处,很可能并不会传播得很远。这是为什么入射点和出射点位置的距离能够被忽略的原因。在传统的着色场景中,朗伯模型(K:模型指的是数学上的模型)经常被用作漫反射(的计算公式),它并不会考虑表面的粗糙度,但还有其他的数学模型会考虑漫反射的粗糙度,例如Oren-Nayar。

Materials that have both high scattering but low absorption are sometimes referred to as "participating media" or "translucent materials". Examples of these are smoke, milk, skin, jade and marble. Rendering of the latter three may be possible with the additional modeling of subsurface scattering where the difference between the ingoing and outgoing point of the light ray is no longer neglected. Accurate rendering of medium with highly varying and very low scattering and absorption like smoke or fog may require even more expensive methods such as Monte Carlo simulations.
具有高散射但低吸收性的材质,有时候被称为"参与媒介"或者"半透明材质"。具体的例子为:眼,牛奶,皮肤,翡翠和大理石。对于后面提到的三种材质,能够通过添加额外的子表面散射(subsurface scattering)模型来进行渲染,这种子表面散射模型中,光的入射和出射位置将不再能够被忽略。对于精确渲染烟或者雾这种高度变化并且低散射和吸收的材质,甚至要求更昂贵的(计算)方法,例如蒙特卡洛模拟。

Rougher surfaces will have larger and dimmer looking highlights
粗糙表面的高光将会更大并且更暗


Figure 03


Figure 04

Microfacet Theory
微面元理论

In theory, both diffuse and specular reflection are dependent on the surface irregularities where the light rays intersect. In practice though, the effect of roughness on diffuse reflection is much less visible because of the scattering happening inside the material. As a result, the outgoing direction of the ray is fairly independent of surface roughness and the incident direction. The most common model for diffuse reflection (Lambertian) completely neglects it.
理论上,漫射和高光反射都是依赖于与光线相交的表面的不规则性质。然而,在实践上,粗糙度对于漫反射的效果并不明显,因为散射都在材质的内部发生。结果是,离开表面的光线几乎是独立于表面的粗糙度和入射光线的方向。最常用的漫反射模型(郎伯模型)完全忽略了它。

In this document, we have referred to these surface irregularities as surface roughness. Actually, it is often referred to by several names such as roughness, smoothness, glossiness or micro-surface, depending on the PBR workflow in use, but they describe the same aspect of a surface, which is sub-texel geometric detail.
在这个文档中,我们会将表面的粗糙度表示为这些表面的不规则属性。事实上,这种不规则属性通常被叫做粗糙度,平滑度,光泽度或者微表面,这依赖于使用到的PBR的工作流程,但他们描述的都是表面相同的属性,这是接近于一个子纹像(纹理像素)级别的几何细节(K:不知道有没有翻译错)。

These surface irregularities are authored in the roughness or glossiness map depending on the workflow you are using. A physically-based BRDF is based on the microfacet theory which supposes that a surface is composed of small-scaled planar detail surfaces of varying orientation called microfacets. Each of these small planes reflects light in a single direction based on its normal as shown in figure 05.
这些表面的不规则属性都是使用粗糙度或者光泽度贴图制作,这视乎于你正在使用的工作流程(K:使用粗糙度还是光泽度)。一个基于物理的BRDF会基于微表面理论,这个BRDF会假设一个表面是由很少的、朝向不一样的平面细节表面组成,这被称为微表面。每种细微的平面会基于其法线,在一个单独的方向上反射出光线,如图05所示。

Figure 05
Micro-facets whose surface normal is oriented exactly halfway between the light direction and view direction will reflect visible light. However, not all microfacets where the microsurface normal and the half normal are equal will contribute as some will be blocked by shadowing (light direction) or masking (view direction) as is illustrated in figure 05.
微表面的表面法线正好朝向光线和观察方向之间的一半位置,并且会在这个方向上反射出可见光(K:图5上面的图)。然而,并不是所有的微表面的表面法线与半法线都是相等的,其中一些可能会在被遮挡(基于光线)或者产生遮罩(基于观察方向),如图5下图所示(K:橙色的是光线,深橙色的是被遮挡的光线,亮绿色的是观察方向,深绿色的是所谓的遮罩,即不被看到的方向).

The surface irregularities at a microscopic level cause light diffusion. For example, blurred reflections are due to scattered light rays. The rays are not reflected in parallel so we perceive the specular reflection as blurred as shown in figure 06.
在微观层面下,表面的不规则属性会导致光的漫射。例如,模糊的反射是因为光线被散射的结果。光线没有被并行地(K:描述的是所有的反射出来的光线方向)反射,让我们观察高光的反射有点模糊,如图06所示。

The surface irregularities at a microscopic level cause light diffusion
在微观层面下,表面的不规则属性会导致光的漫射。


Figure 06

Color
颜色

The color of a surface (which is to say the color that we see) is due to which wavelengths are emitted by the light source, which are absorbed by the object and which others are reflected both specularly and diffusely. The remaining reflected wavelengths are what we see as color.
表面的颜色是由于光源发射出的不同波长的光线,一部分被物体吸收而另一部分被反射,其表现出高光和漫射的属性。剩下被发射出的对应波长的光就是我们看到的颜色。

For example, the skin of an apple mostly reflects red light. Only the red wavelengths are scattered back outside the apple skin and the others are absorbed by it as shown in figure 07.
例如,苹果的皮肤大部分发射出红光。只有红色波长(的光)被散射出苹果的皮肤上,并且其他波长的光都被吸收了,如图07所示。

It also has bright specular highlights the same color as the light source because with materials like the skin of an apple that are not electrical conductors (dielectrics), specular reflection is almost independent of wavelength. Therefore, for such materials the specular reflection is never colored. We will discuss more about the different type of materials (metals and dielectrics) in later sections.
它也有很亮的高光,颜色和光源颜色一样,因为像苹果这种皮肤的材质不是导电体(电介质),高光反射几乎与波长没有关系。因此,对于这种材质来讲,高光反射从来都不会出现颜色(K:但会高亮)。在后续章节中,我们将会讨论更多不同类型的材质。

Substance PBR shaders use the GGX microfacet distribution
Substance PBR着色使用GGC微表面分布。


Figure 07

BRDF

A Bidirectional Reflectance Distribution Function (BRDF) simply put is a function that describes the reflectance properties of a surface. In computer graphics, there are different BRDF models some of which are not physically plausible. For a BRDF to be physically plausible, it must be energy conserving and exhibit reciprocity. For reciprocity, I am referring to the Helmholtz Reciprocity principle, which states that incoming and outgoing light rays can be considered as reversals of each other without affecting the outcome of the BRDF.
一个双向反射分布函数(BRDF)简单地使用一个函数来描述一个表面的反射属性。在计算机图形学中,有不同的BRDF模型,一些并不是物理上可信的(K:即不是基于物理的)。对于一个物理上可信的BRDF,它必须是能量守恒的并且表现出相互作用的属性。对于相互作用,我将会引用赫尔姆霍兹互反律定律,它描述了入射和出射的光线能够被认为是彼此之间可以逆转的,并且不会影响到BRDF的结果(K:即交换入射和出射光线,得到的BRDF的结果是一样的)。

The BRDF used by Substance's PBR shaders is based on Disney's "principled" reflectance model, which is based on the GGX microfacet distribution. GGX provides one of the better solutions in terms of specular distribution in that it has a shorter peak in the highlight and a longer tail in the falloff, which is to say that it looks more realistic as shown in figure 08.
BRDF在Substance中的PBR着色是基于Disney的"principled"反射模型的,它基于GGX微表面分布。GGX提供了其中一个较好的解决方案,这个方案以高光分布的形式,在高亮区中具有较低的峰值和较长的尾部衰减,也就是说它看起来更加真实,如图08所示。

Object GGX provides one of the better solutions in terms of specular distribution

Figure 08

Energy Conservation
能量守恒

Energy Conservation plays a vital role in physically-based rendering solutions. It states that the total amount of light re-emitted by a surface (reflected and scattered back) is less than the total amount it received. In other words, the light reflected off the surface will never be more intense than it was before it hit the surface. As artists, we don't have to worry about controlling Energy Conservation. This is one of the nice aspects of PBR in that energy conservation is always enforced by the shader. It’s part of the physically-based model and it allows us to focus more on art rather than physics.
在基于物理渲染的解决方案中,能量守恒扮演着一个重要的角色。它描述了被表面再一次发射出光量(反射和散射出表面)会比它接收到的总的光量要少。也就是说,从表面上反射的光将总不会比它之前击中表面时候的强度要强。作为艺术师,我们不需要担心如何控制能量守恒。在能量守恒中,这是PBR其中之一的优点,它(K:能量守恒)会被着色器强制执行。

Fresnel Effect
菲涅耳效应

The Fresnel reflection factor also plays a vital role in physically-based shading as a coefficient of the BRDF. The Fresnel Effect as observed by French physicist Augustin-Jean Fresnel states that the amount of light you see reflected from a surface depends on the viewing angle at which you perceive it.
菲涅耳反射因素在基于物理的着色中,作为BRDF的系数扮演着一个重要的角色。菲涅耳效应被法国的科学家Augustin-Jean Fresnel观察到,并表示为从一个表面上看到的光的反射量依赖于你观察的角度。

For example, think of a pool of water. If you look straight down, perpendicular to the water surface, you can see down to the bottom. Viewing the water surface in this manner would be at zero degrees or normal incidence, normal being the surface normal. Now, if you look at the pool of water at a grazing incidence, more parallel to the water surface, you will see that the specular reflections on the water surface become more intense and you may not be able to see below the surface of the water at all.
举个例子,想象一个泳池中的水。如果你直接往下看,垂直于水面,你能够看到泳池的底部。以这种形式观察水的表面就如入射角是零度或者正入射,该法线就是水面的法线了。现在,如果你在临界入射(方向)观察泳池中的水,越与水面平行,你将会在水面上看到的高光反射会变得越强,并且你可能完全看不到水面以下(的物体)。

Fresnel is not something that we control in PBR as we did in traditional shading. Again, this is another physics aspect that is handled for us by the PBR shader. When it comes to viewing a surface at a grazing incidence, all smoothed surfaces will become a nearly 100% reflector at a 90 degree angle of incidence.
菲涅耳并不是我们能够在PBR中,像传统的着色方式那种控制的参数。再一次,这是另一种物理现象,是由PBR着色器所控制的。当它在临界入射角中被观察时,所有光滑的表面将会变成接近100%的反射,就如在90度的入射角中观察一样。

For rough surfaces, reflectance will become increasingly specular but we won't approach 100% specular reflection. What matters then is the angle between the normal of each microfacet and the light, not the angle between the normal of the "macrosurface" and the light. Because the light rays are dispersed into different directions, the reflection appears softer or dimmer. What you get at a macroscopic level is a bit like the average of all the Fresnel effect you would have for the microfacets.
对于粗糙的表面,反射率将会逐渐变得如高光一样,但我们并不会达到100%的高光反射。这种现象就如每一个微表面的法线与光之间的夹角,而不是宏观表面的法线与光之间的夹角。因为光线(在这样的表面下)会分散为不同的方法,反射会变得更柔软或者更暗。你在一个宏观层面上看到的所有的菲涅耳效果的平均值,就如在微表面上你看到的效果一样。

For rough surfaces, reflectance will become increasingly specular but we won't approach 100% specular reflection
(K:看上面那段的第一句,是一样的)


Figure 09

F0 (Fresnel Reflectance at 0 Degrees)
F0(在0度下的菲涅耳反射)

When light hits a surface straight on or perpendicularly (0 degree angle), there is a percentage of that light that is reflected back as specular. Using the Index of Refraction (IOR) for a surface, you can derive the amount that is reflected back and this is referred to as F0 (Fresnel 0) as shown in figure 09. The amount of light that is refracted into the surface is referred to a 1-F0.
当光正面地或者垂直地(入射角为0度)击中一个表面时,这个光有一定概率会以高光的形式反射回来。对于一个表面来讲,使用折射率(IOR)你能够获得它反射的量,并且如图09中描述的F0(菲涅耳 0)。那么,折射到表面内的光量就是:1-F0。

The F0 range for most common dielectrics will be from 0.02 - 0.05 and for conductors the F0 range will be 0.5-1.0. Thus, the reflectivity of a surface is determined by the refractive index as shown in the following equation from Sebastien Lagarde's "Feeding a Physically-based Shading Model" blog post as shown in figure 10.
最常用见的电介质的F0的范围在[0.02, 0.05]之间,对于导体来讲,F0的范围将会在[0.5, 1.0]之间。因此,一个表面的反射度是由折射系数来决定的,就如接下来的公式中展示那样,这个公式来自于Sebastien Lagarde的"满足一个基于物理的着色模型"的博客文章,如图10所示。

It is the F0 reflectance value that we are concerned with in regards to authoring our textures. Non-metals (dielectrics/insulators) will have a greyscale value and metals (conductors) will have an RGB value. With regards to PBR and from an artistic interpretation of reflectance, we can state that for a common smooth dielectric surface, F0 will reflect between 2% and 5% of light and 100% at grazing angles as was shown in figure 09.
我们关心的F0反射值对于我们制作我们的贴图是有关联的。非金属(电介质/绝缘体)只会有一个灰度值,并且金属(导体)将会有一个RGB值(K:因为不同波长的光的反射率是不一样的)。对于PBR和反射的艺术解析来讲,对于常见的平滑的电介质表面来讲,我们能够讲,F0将会反射2%到5%的光线,在临界角上能够反射100%,就如图9所示。

The dielectric (non-metal) reflectance values don't actually change very drastically. In fact, when altered by roughness the actual changes in value can be hard to see. However, there is a difference in the values. In figure 11, you can see a chart that shows the F0 ranges for both metal and non-metal materials.
电介质(非金属)反射值并不会剧烈地变化(K:即不同的电介质的反射值是差不多的)。事实上,当使用粗糙度来改变相应的值也是难以看出(差别的)。然而,这些值是有区别的,如图11,你能够看到一个图标,它显示了对于金属和非金属材质中的F0的范围。


Figure 10

Notice that the ranges for non-metals do not deviate from each other drastically. Gemstones are an exception as they have higher values. We will discuss F0 as it specifically relates to conductors and insulators a bit later.
注意,对于非金属的范围,彼此之间不会变化得很剧烈。宝石是一个例外,因为他们有一个很高的值。我们将会在稍后讨论F0,因为它与导体和绝缘体有很特殊的关系。



Figure 11

Conductors and Insulators (Metals and Non-Metals)
导体和绝缘体(金属和非金属)

When creating materials for PBR, I find it helpful to think in terms of metal or non-metal. I simply ask myself if the surface is metal or not. If it is, I follow one set of guidelines and if it’s not, I follow another. This can be a rather simplistic approach as some materials may not fall into these categories such as metalloids, but in the overall process of creating materials, distinguishing between metal and non-metal is a good approach and metalloids are an exception. To set up guidelines for materials, we first must understand what we are trying to create. With PBR, we can look at the properties of metals (conductors) and non-metals (insulators) to derive this set of guidelines.
当创建PBR的材质时,我发现以金属和非金属的形式来思考,会很有帮助。我简单的问自己,如果表面是金属还是非金属。如果它是的话,我会遵照一系列的指引,如果它不是,我会遵照另一些。这是一个相对简单的方法,因为一些材质可能不会在这种分类中,例如准金属,但是在整个创建材质的过程中,区分金属和非金属是一个好的办法,而准金属是一个例外。对于材质设定一个指引,我们首先必须要理解,我们将要尝试创建的是什么。对于PBR来讲,我们能够观察金属(导体)和非金属(绝缘体)的属性来获取这些指引。


Refracted light is absorbed, the color tint of metals come from the reflected light and thus in our maps, we don't give metals a diffuse color
折射的光线会被吸收,金属的颜色来自于反射的光线,因为在我们的贴图中,我们不会给金属对应的颜色。

Figure 12

Metals
金属

Metals (conductors) are good conductors of heat and electricity. Simply put, the electric field in conducting metals is zero and when an incoming light wave made of electric and magnetic fields hits the surface, it is partially reflected and all the refracted light is absorbed. The reflectance value for polished metal is going to be high at a range of about 70-100% reflective as shown in figure 12.
金属(导体)是热和电的良好的导体。简单来讲,电磁在导电金属的含量是零,并且当入射的由电子和磁场组成的光波击中表面时,它会部分地反射,并且所有的折射光会并吸收。对于光滑金属的反射值相对较高,在70~100%之间,如图12所示。

Some metals absorb light at different wavelengths. For example, gold absorbs blue light at the high-frequency end of the visible spectrum so it appears yellow as a result. However, since the refracted light is absorbed, the color tint of metals come from the reflected light and thus in our maps, we don't give metals a diffuse color. For example, in the specular/ gloss workflow, raw metal is set to black in the diffuse map and the reflectance value is a tinted color value in the specular map. With metals, the reflectance value will be RGB and can be tinted. Since we are working within a physically-based model, we need to use real-world measured values for the metal reflectance in our maps.
某些金属只吸收不同的波长的光。例如,黄金吸收可视频谱高频末端的蓝光,所以,结果它出现黄色。然而,因为折射光被吸收,金属的颜色来自于被反射的光线,因此,我们不会在我们的贴图中给予金属一种漫射颜色。例如,在高光/光泽的工作流中,纯金属在漫射贴图中被设置为黑色并且,在高光贴图中,反射值是带色彩的颜色值(K:RGB值)。对于金属来讲,反射值将是RGB值并且能够带有色彩的。由于我们使用基于物理的模型,在我们的贴图中,对于金属的反射,我们需要使用真实世界的测量值。

Another important aspect with metals in terms of texturing is that metal can corrode. This means that weathering elements can play a large role in the reflective state of metal. If the metal rusts for example, this changes the reflective state of the metal and the corroded areas are then treated as a dielectric material as shown in figure 13.
金属的贴图形式的另一个总要的部分是,金属能够被侵蚀。这意味着,风化作用的元素能够在金属的反射状态中起着巨大的作用。举个例子,如果金属生锈,这会改变金属的反射状态,并且侵蚀区域会被认为是一种电介质的材质(K:绝缘体),如图13所示。

Also, metal that is painted is not treated like a metal but rather a dielectric as well. The paint acts as a layer on top of the raw metal. Only the raw metal exposed from chipped away paint is treated as metal. The same goes for dirt on the metal or any matter that obscures the raw metal.
然后,金属在(K:上述描述的侵蚀的情况下)绘制的时候,并不会以纯金属的形式被处理,但更多的是一种电介质的形式。这种绘制就如在纯金属面上添加一层。只有纯金属暴露在被凿开的位置处,绘制时才会被认为人是一种金属形式(K:没有被侵蚀的位置处的金属,才会以金属的形式被绘制,或者说在侵蚀面下的金属才会以金属的形式被绘制)。对于被尘土覆盖或者任何其他物质遮挡着纯金属表面,处理方法都是一样的。

I stated above that I always ask myself if a material is a metal or not. However, to be more precise, the question should also inquire the state of the metal such as is it painted, rusted or covered in dirt/grease. The material will be treated as dielectric if it is not raw metal and there could be some blending between metal and non-metal depending on the weathering.
在前面的内容中我说过,我总会问自己,这种材质是否为金属。然后,为了更精确,这个问题应该询问金属的状态,例如它是否被图绘过,生锈或者覆盖这尘土/优质。这个材质将会被认为是一种电介质,如果它不是一种纯粹的金属,并且在金属与非金属之间可能会有混合的现象,这依赖于风化作用。


Weathering elements can play a large role in the reflective state of metal
风化作用的元素在金属反射的状态上起着仲要作用


Figure 13

Non-Metals
非金属

Non-metals (insulators/dielectrics) are poor conductors of electricity. The refracted light is scattered and/ or absorbed (often re-emerging from the surface) and thus they reflect a much smaller amount of light than metals and will have an albedo color. We stated earlier that the value for common dielectrics would be around 2-5% based on the F0 as computed by the index of refraction. These values are contained within the linear range of 0.017-0.067 (40-75 sRGB) as shown in figure 14. With Figure 14 the exception of gemstones, most dielectrics will not be greater than 4%.
非金属(绝缘体/电介质)在导电性方面很差。折射光通常会被散射并且有可能会被吸收(散射光通常会在表面上"浮现"出来),因此,相对于金属来讲,他们会反射出相对较少的光量并且将会有一个反射度颜色(K:albedo描述的是,折射光中,被散射出表面的光与被吸收的光的比值)。前面我们讲到,常见电介质使用折射系数计算出的F0值介于2~5%之间。这些值包含在一个线性范围[0.017, 0.067](在sRGB区域中是[40, 75])之间,如图14所示。对于图14,除了宝石是例外,大部分的电介质不会超过4%。

Just as with metals, we need to use real-world measured values, but it can be difficult to find an IOR for other materials that are not transparent. However, the value between most common dielectric materials doesn't change drastically, so we can utilize a few guidelines to follow in terms of reflectance values, which we will cover in volume two.
对于金属,我们需要使用真实世界测量出的值,但对于其他其他不透明的材质来讲,是很难找到其IOR值的。然而,大部分常见的电介质材质的值都不会彼此之间都不会有很大的变化,所以我们能够利用一些指引,去遵循反射值的形式,这种指引方法我们会在第二卷中提到。

The value for common dielectrics is around 2-5% based on the F0 as computed by the Index of Refraction (IOR)
常见电介质使用折射系数(IOR)计算出的F0值介于2~5%之间


Figure 14
Linear Space Rendering
线性空间渲染

Linear space rendering can take up an entire article all on its own. So, we won't go in-depth into the specifics. However, the important takeaway is that computations are calculated in linear space.
线性空间渲染能够占用整个文章来讨论。所以,我们不会深入其中的细节。然而,重要的是,计算必须要在线性空间中。

Simply put, linear space rendering provides correct math for lighting calculations. It’s about creating an environment that allows light to behave as it does in the real world. In linear space, the gamma is 1.0. However, for this to look correct to our eyes, the linear gamma needs to be shifted. Gamma-encoded space (sRGB) compensates for images that are displayed on a computer screen. The value of the image is adjusted for display.
简单来讲,线性空间渲染提供了在光照计算时正确的数学方法。这是关于创建一个环境,它能够允许光的行为就如在真实世界中的一样。在线性空间中,伽马值是1.0。然而,对于我们的眼睛能够观察到正确的颜色,线性的伽马需要被调整。但在电脑屏幕上显示时,伽马编码空间(sRGB)会对图像进行补偿。图像显示的值将会被调整。

When computing color values and performing operations on colors, all computations should be performed in linear space. A simple way to look at it is that if an image is to be displayed in the render such as base color or diffuse, then these maps need to be set as sRGB. What happens in Substance is that if the image is tagged as sRGB, it will be converted to linear for calculations and then set back to sRGB for display. However, when you store mathematical values that purely denote surface attributes in a texture such as roughness or metallic, then these maps must be set as linear.
当计算颜色值并且操控颜色值时,所有计算都应该在线性空间中执行。一个简单的方法去检查它是否正确,如果一张图像在渲染时候被显示,例如基础颜色或者漫射颜色,那么这些贴图必须被设置为sRGB。在Substance上,如果图像被加上sRGB的标签,它将会转换为线性来计算(K:去掉sRGB标签),并且在显示的时候再设置回sRGB的标签。然而,当你储存的数学值只是单纯用于表示表面的属性,如粗糙度或者金属度贴图,那么,这些值必须设置为线性。

Substance handles the conversion between linear/sRGB space for inputs automatically as well gamma-correction on the computed result in the rendered viewport. As the artist, you don't need to worry about the internal working of linear-space computations and conversions in the Substance pipeline. When using Substance materials via the Substance Integration plugin, the conversions for linear space are also handled automatically.
Substance会自动地处理线性和sRGB空间的转换,也会在渲染视口中,在计算结果时执行伽马矫正。对于美术师来讲,在Substance管线中,你不需要担心线性空间的计算和转换的内部工作流程。当通过使用Substance集成插件时,使用Substance材质,线性空间转换也会被自动处理。

However, it’s important to understand the process, as when Substance maps are utilized as exported bitmaps and not Substance materials, you may need to manually handle the conversions depending on the renderer you are using. You need to know that base color/diffuse maps are sRGB and the rest are linear.
然而,理解这个过程是很重要的,就如当Substance贴图被用在输出的位图和不使用Substance材质时,你可能需要手动处理这种转换,这基于你所使用的渲染器。你需要知道基础颜色(base color)/漫射颜色(diffuse)贴图在sRGB空间中,并且其余的都在线性空间中。

When using Substance materials via the Substance Integration plugin, the conversions for linear space are also handled automatically.

Key Factors
关键因素

Now that we have explored the basic theory behind the physics, we can derive some key factors for PBR.
现在,我们已经讲述了其中的物理原理,对于PBR来讲,我们得到以下关键点:
  1. Energy Conservation. A reflected ray is never brighter than the value it had when it first hit the surface. Energy Conservation is handled by the shader.
  2. Fresnel. The BRDF is handled by the shader. The F0 reflectance value has minimal change for most common dielectrics and falls within a range of 2% - 5%. The F0 for metals is a high value ranging from 70-100%.
  3. Specular intensity is controlled through the BRDF, roughness or glossiness map and the F0 reflectance value.
  4. Lighting calculations are computed in linear space. All maps that have gamma-encoded values such as base color or diffuse are usually converted by the shader to linear, but you may have to make sure that the conversion is properly done by checking the appropriate option when importing the image in your game engine or renderer. Maps that describe surface attributes such as roughness, glossiness, metallic and height should be set to be interpreted as linear.

  1. 能量守恒。一束反射光线不会比第一次击中表面的时候更亮。能量守恒在着色器中被处理。
  2. 菲涅耳。BRDF被着色器处理。F0反射值对于大部分常见的电介质之间只有很少的变化并且会在2~5%之间。F0对于金属有很高的范围,在70~100%之间。
  3. 高光强度通过BRDF、粗糙度或者光泽度贴图和F0反射值来控制。
  4. 光照计算是在线性空间中计算的。所有贴图都有一个伽马编码的值,例如基础颜色和漫射颜色通常会在着色器中被转换为线性,但你可能需要确保这个转换被正确地执行,在载入贴图到你的引擎或者渲染器时,通过检查合适的选项来确保载入是正确的。贴图描述表面属性的,例如粗糙度、光泽度、金属度和高度应该被设定为以线性形式来解析。

References

1. Physically-Based Shading at Disney Brent Burley, Walt Disney Animation Studios. https://disney-animation.s3.amazonaws.com/library/s2012_pbs_disney_brdf_notes_v2.pdf

2.Microfacet Models for Refraction through Rough Surfaces http://www.cs.cornell.edu/~srm/publications/EGSR07-btdf.pdf

3.Feeding a Physically-Based Shading Model by Sebastien Lagarde http://seblagarde.wordpress.com/2011/08/17/feeding-a-physical-based-lighting-mode/

4.An Introduction to BRDF Models by Daniël Jimenez Kwast http://hmi.ewi.utwente.nl/verslagen/capita-selecta/CS-Jimenez-Kwast-Daniel.pdf

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 1
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值