漫反射和鏡面反射的區別是基於物理的?


34

實時計算機圖形中對錶面進行著色的經典方法是將(Lambertian)擴散項和鏡面項(最可能是Phong或Blinn-Phong)組合在一起。

Image from Wikipedia

現在,隨著趨勢向基於物理的渲染以及因此在諸如FrostbiteUnreal EngineUnity 3D之類的引擎中的材質模型發展,這些BRDF已經發生了變化。例如(當時相當通用),最新的虛幻引擎仍使用Lambertian漫反射,但結合了Cook-Torrance微面模型進行鏡面反射(特別是使用GGX / Trowbridge-Reitz和經過修正的Slick近似菲涅耳術語))。此外,"金屬"值用於區分導體和電介質。

對於電介質,漫反射是使用材料的反照率進行著色的,而鏡面反射始終是無色的。對於金屬,不使用漫反射,鏡面項與材料的反照率相乘。

關於現實世界的物理材料,漫反射和鏡面反射之間是否存在嚴格的分隔,如果存在,分隔是從何而來的?為什麼一個是彩色的而另一種卻沒有呢?為什麼導體的行為不同?

30

To start, I highly suggest reading Naty Hoffman's Siggraph presentation covering the physics of rendering. That said, I will try to answer your specific questions, borrowing images from his presentation.

Looking at a single light particle hitting a point on the surface of a material, it can do 2 things: reflect, or refract. Reflected light will bounce away from the surface, similar to a mirror. Refracted light bounces around inside the material, and may exit the material some distance away from where it entered. Finally, every time the light interacts with the molecules of the material, it loses some energy. If it loses enough of its energy, we consider it to be fully absorbed.

To quote Naty, "Light is composed of electromagnetic waves. So the optical properties of a substance are closely linked to its electric properties." This is why we group materials as metals or non-metals.

Non metals will exhibit both reflection and refraction. Non-Metals

Metallic materials only have reflection. All refracted light is absorbed. Metals

It would be prohibitively expensive to try to model the light particle's interaction with the molecules of the material. We instead, make some assumptions and simplifications.

Simplifying refraction

If the pixel size or shading area is large compared to the entry-exit distances, we can make the assumption that the distances are effectively zero. For convenience, we split the light interactions into two different terms. We call the surface reflection term "specular" and the term resulting from refraction, absorption, scattering, and re-refraction we call "diffuse". Splitting into diffuse and specular

However, this is a pretty large assumption. For most opaque materials, this assumption is ok and doesn't differ too much from real-life. However, for materials with any kind of transparency, the assumption fails. For example, milk, skin, soap, etc.

A material's observed color is the light that is not absorbed. This is a combination of both the reflected light, as well as any refracted light that exits the material. For example, a pure green material will absorb all light that is not green, so the only light to reach our eyes is the green light.

Therefore an artist models the color of a material by giving us the attenuation function for the material, ie how the light will be absorbed by the material. In our simplified diffuse/specular model, this can be represented by two colors, the diffuse color, and the specular color. Back before physically-based materials were used, the artist would arbitrarily choose each of these colors. However, it should seem obvious that these two colors should be related. This is where the albedo color comes in. For example, in UE4, they calculate diffuse and specular color as follows:

DiffuseColor = AlbedoColor - AlbedoColor * Metallic;
SpecColor = lerp(0.08 * Specular.xxx, AlbedoColor, Metallic)

where Metallic is 0 for non-metals and 1 for metals. The 'Specular' parameter controls the specularity of an object (but it's usually a constant 0.5 for 99% of materials)


25

I was actually wondering about exactly this a few days ago. Not finding any resources within the graphics community, I actually walked over to the Physics department at my university and asked.

It turns out that there are a lot of lies we graphics people believe.


First, when light hits a surface, the Fresnel equations apply. The proportions of reflected/refracted light depend on them. You probably knew this.

There's no such thing as a "specular color"

What you might not have known is that the Fresnel equations vary based on wavelength, because the refractive index varies based on wavelength. The variation is relatively small for dielectrics (dispersion, anyone?), but can be enormous for metals (I presume this has to do with these materials' differing electric structures).

Therefore, the Fresnel reflection term varies by wavelength, and therefore different wavelengths are reflected preferentially. Seen under broad-spectrum illumination, this is what leads to specular color. But in particular, there is no absorption that magically happens at the surface (the other colors are just refracted).

There's no such thing as "diffuse reflection"

As Naty Hoffman says in the talk linked in the other answer, this is really an approximation to outscattered subsurface scattering.

Metals DO transmit light

Naty Hoffman is wrong (more precisely, simplifying). Light does not get absorbed immediately by metals. In fact, it will pass quite handily through materials several nanometers thick. (For example, for gold, it takes 11.6633nm to attenuate 587.6nm light (yellow) by half.)

Absorption, as in dielectrics, is due to the Beer-Lambert Law. For metals, the absorption coefficient is just much larger (α=4πκ/λ, where κ is the imaginary component of the refractive index (for metals ~0.5 and up), and λ is given in meters).

This transmission (or more accurately the SSS it produces) is actually responsible for a significant portion of metals' colors (although it is true that metals' appearances are dominated by their specular).