阿诺德渲染器中的物理学原理

原文:Understanding Physically Based Rendering in Arnold

阿诺德渲染器中的物理学原理_第1张图片

Designing materials based on physical laws can tremendously simplify shading and lighting, even when we do not necessarily strive for realism or physical accuracy. By understanding and applying a few principles, we can make images that are more believable, and create materials that behave more predictably in different lighting setups.

虽然我们在设计材质时不一定要完全还原现实,也不一定要百分百符合材质的物理特性,但是基于物理定律设计材质可以呈现更真实的光照和阴影。通过理解和应用一些物理学原则创建材质,可以使渲染出的图像更真实,并且能够创建在不同照明设置下轻松预见其表现的材质。

In modern renderers, physically based rendering refers to concepts like energy conservation, physically plausible scattering and layering in materials and linear color spaces. Arnold is a physically based renderer, but it also lets you break the rules and create materials and lights that do not obey the laws of physics if you wish. In this document, we'll explain the underlying theory and how to set up your shaders to follow these principles.

在现代渲染器中,基于物理的渲染通常是指——能量守恒、物理上合理的散射、材料和线性色彩空间中的层次等概念。阿诺德虽然是基于物理规则的渲染器,但是如果需要,它也允许打破规则,创建不符合物理定律的材质和灯光。在本文中,我们将解释阿诺德渲染的基本原理,以及如何设置着色器来遵循这些法则。

阿诺德渲染器中的物理学原理_第2张图片

▶ 阿诺德支持各种第三方程序,如:Substance Painter

Photons and Scattering(光子和散射)

In rendering we simulate photons emitted from lights, traveling through the air and bouncing off surfaces and through volumes, eventually ending up on a camera sensor. The combination of millions of photons on the camera sensor then forms the rendered image.

在渲染时,我们模拟光子从光源发出,经过空气传播,在表面和体积中弹起,最终落在摄像机传感器上。数以百万计的光子在摄影机传感器上组合在一起,就形成了渲染图像。

This means that from a physics point of view, surface shaders describe how the surface interacts with photons. Photons hitting an object can be absorbed, reflect off the surface, refract through the surface, or scatter around inside the object. The combination of these components results in a wide variety of materials.

从物理学角度来看的话,曲面着色器描述了曲面如何与光子相互作用。击中物体的光子可能会被吸收、在曲面发生反射、透过曲面发生折射,或者在物体内部四处散射。这些组件组合在一起,就产生了种类众多的材质。

Energy Conservation(能量守恒)

Unless an object is a light source that emits photons, it can't return more energy than is being contributed by the incoming light. For a material to be energy conserving the number of photons leaving the surface should be smaller or equal to the number of incoming photons. If a material is not energy conserving, materials will appear overly bright and render with increased noise, especially when using global illumination.

除非物体是发射光子的光源,否则它返回的能量不能多于入射光所贡献的能量。材质要做到能量守恒,离开表面的光子数量就要小于或等于入射光子的数量。如果材质不是能量守恒,材质将会显得过亮并且会增加渲染时的噪点,尤其是在使用全局光照时。

To keep materials energy conserving, the weight and color of material components should never exceed 1. Further, we must be careful to ensure that the combination of all components is energy conserving, which we'll explain in detail later.

为了保证材质的能量守恒,材质组件的权重和颜色值绝不能超过1。此外,我们必须小心确保所有组件的组合都是能量守恒的,稍后会详细解释。

Materials(材料)

At the microscopic level, object surfaces are intricately detailed. For rendering, we do not use geometry to represent all of this detail, but rather use statistical models than having easy to understand parameters.

在微观层面上,物体表面的细节是错综复杂的。对于渲染,我们不使用几何体来表现所有这些细节,而是使用统计模型,这类模型具有更易于理解的参数。

Arnold's Standard Surface shader model objects with one or two specular layers, and a diffuse or transparent interior. This model can represent a wide variety of materials. Let's look at the individual components.

阿诺德的标准曲面着色器在为物体建模时会建立一个或两个镜面反射层,以及一个漫反射或透明内部。这种模型可以表现各种各样的材质。我们来看一下各个组件的具体介绍:

Diffuse and Subsurface Scattering(漫反射和次表面散射)

First, consider the diffuse interior. Incoming photons will enter the object, scatter around inside and either get absorbed or leave the object at another location.

首先来看漫反射内部。入射光子进入物体,在内部四处散射,然后被吸收或在另一位置离开物体。

If photons scatter many times, we get a diffuse appearance, due to photons leaving the surface in many different locations and directions. For materials like skin, photons can scatter relatively far under the surface giving a very soft appearance, which we render with subsurface scattering. For materials like unfinished wood, photons do not scatter very far which gives a harder appearance, and we render these as diffuse. For thin objects like leaves, the photons can scatter all the way to the other side of the object, which we render as diffuse SSS with thin_wall enabled.

如果光子散射很多次,并且由于光子在不同的位置和方向离开曲面,我们就会得到一个漫反射外观。对于像皮肤这样的材质,光子可以在曲面下散射的相对较远,呈现出一个非常柔软的外观,我们使用次表面散射进行渲染;对于像原木材料,光子不会散射的非常远,因此呈现出更坚硬的外观,这种效果使用漫反射进行渲染;对于像叶子这样的纤薄物体,光子可以一直散射到另一面,这种效果以漫反射 SSS(启用 thin_wall)形式进行渲染。

Note that fundamentally all of these types of materials have the same underlying physical mechanism, even though we provide separate controls for them in the shader.

请注意,尽管我们在着色器中为所有这些类型的材质提供了单独的控制选项,但是所有这些材质背后都具有相同的物理机制。

The diffuse interior also typically has the biggest influence on the overall color of the material. Each photon has an associated wavelength, and depending on the properties of the material some photons with some wavelengths are more likely to be absorbed than others. This, in turn, means that photons with some wavelengths are more likely to leave the surface, which will give it a colored appearance.

漫反射内部通常对材质的整体颜色影响最大。 每个光子都有一个关联的波长, 并且根据材料的特性,某些波长的光子比其他光子更有可能被吸收。反过来就意味着,某些波长的光子更容易离开曲面,从而使曲面呈现彩色外观。

阿诺德渲染器中的物理学原理_第3张图片
The skin of a red apple mostly reflects red light. Only the red wavelengths are scattered back outside the apple skin, and the others are absorbed by it. 红苹果的表皮主要反射红色光线,只有红色波长的光才会散射在苹果皮外面,其它的光则被吸收。
Energy Conservation(能量守恒)

A single photon can only participate in one of the diffuse, subsurface scattering and backlighting components, for physical correctness we do not want more photons leaving the surface than entering. For Standard Surface, it is automatically ensured that the sum of these components is not higher than 1.

单个光子只能参与漫反射、次表面散射或背面照明这几个组件中的一个,为了实现物理上的正确性,我们不希望离开表面的光子比进入的光子多。对于标准曲面,会自动确保这些组件的总和不高于 1。

Specular Scattering(镜面散射)
阿诺德渲染器中的物理学原理_第4张图片
Specular Roughness 0 to 1 粗糙度从0到1
Roughness(粗糙度)

The specular layer is modeled using a microfacet distribution. We assume that the surface consists of microscopic faces oriented in random directions. A surface with low roughness such as a mirror will have little variation between the faces, resulting in sharp reflections. With high roughness, there will be a lot of variation resulting in softer, glossy reflections.

镜面反射层使用微面分布进行建模。我们假设曲面是由许多沿随机方向排列的微小的面构成。粗糙度低的曲面(如镜面)上各个微面之间几乎没有变化,因此呈现清晰锐利的反射。粗糙度高的曲面存在很多变化,因此呈现更柔和、富有光泽的反射。

阿诺德渲染器中的物理学原理_第5张图片
A strong Specular highlight is visible on the apple. Note the table's specular reflection which is broad and dull (high Specular Roughness value). 苹果上可见强烈的镜面反射高光。注意,桌子的镜面反射宽泛而暗淡(因为镜面反射粗糙度值较高)。
阿诺德渲染器中的物理学原理_第6张图片
Rough reflections caused by scattered light rays 散射光线引起的粗糙反射
阿诺德渲染器中的物理学原理_第7张图片
Glossy surface. The angle of incidence and reflection are equal. 光泽曲面:入射角和反射角相等。
阿诺德渲染器中的物理学原理_第8张图片
Diffuse surface. Ray direction varies randomly. 漫反射曲面:光线方向随机变化。
Roughness Map(粗糙度贴图)

To get variation in the highlights of the surface, a map should be connected to the Specular Roughness. This will influence not only the brightness of the highlight but also its size and the sharpness of the environmental reflection.

要查看曲面高光的变化,应将贴图连接到镜面反射的“粗糙度”(Roughness)。这不仅会影响高光的亮度,还会影响其大小和环境反射的清晰度。

阿诺德渲染器中的物理学原理_第9张图片
Low Specular Roughness & High Specular Roughness ('Scratches' texture connected to Specular Roughness) 低镜面反射粗糙度 / 高镜面反射粗糙度(“划痕”(Scratches)纹理连接到镜面反射的“粗糙度”(Roughness))
阿诺德渲染器中的物理学原理_第10张图片
Transmission(透射)

Photons can not only be reflected off the surface but can refract through it as well. Photons will pass through the specular layer, typically changing direction when exiting on the other side of the layer, controlled by the index of refraction (IOR).

光子不仅可以在曲面上发生反射,还可以透过曲面发生折射。光子将穿过镜面反射层,通常在离开该层的另一面时改变方向,具体取决于折射率 (IOR)

If the interior of the surface is transparent, such as for clear glass, then photons can pass through the object and exit on the other side. If there is a diffuse interior, the photon can scatter inside the object and get absorbed or exit the object again. The more refractive the specular layer, the more the underlying diffuse interior will be visible. For materials like metals, photons refracting through the specular are often immediately absorbed, and so the diffuse interior is not visible.

如果曲面的内部是透明的(如透明玻璃内部),光子将可以穿过物体并从另一面射出。如果为漫反射内部,光子可以在物体内部散射,然后被吸收或再次离开物体。镜面反射层的折射率越高,下面的漫反射内部越清晰可见。对于金属这样的材质,穿过镜面反射层发生折射的光子往往会立即被吸收,因此我们看不到漫反射内部。

Fresnel(菲涅尔)

The percentage of photons reflected or refracted by the specular layer is view dependent. When looking at surfaces head on, most light is refracted, while at grazing angles most light is reflected. This is called the Fresnel effect. The index of refraction controls exactly how this effect varies with the viewing angle.

镜面反射层反射或折射的光子的百分比与视角有关。从正面观察曲面时,大多数光会发生折射;以一定掠射角观察曲面时,大多数光会发生反射。这种现象称为“菲涅尔效应”。折射率控制着此效应具体如何随视角发生变化。

Opacity and Transmission(不透明度和透射)

Opacity is best understood as a way to model surface geometry using textures. It does not affect how photons interact with the surface, but rather indicates where the surface's geometry is absent and the photons can pass straight through.

不透明度最好的理解是:不透明度是一种使用纹理为曲面几何体建模的方法。它不影响光子与曲面的相互作用,而是指示哪个位置不存在曲面几何体、光子可以直接通过。

阿诺德渲染器中的物理学原理_第11张图片
Ramp texture connected to the opacity 渐变纹理连接到不透明度

阿诺德渲染器中的物理学原理_第12张图片
Variation of a Specular BRDF with respect to the view direction 镜面反射 BRDF 相对于视角方向发生的变化

A typical use for opacity would be a sprite type of effect, such as cutting out the shape of a leaf from a polygon card or making the tips of hair strands transparent. Be warned however that scenes containing many opacity sprites (for example tree leaves) can slow down rendering considerably.

不透明度的一个典型用途是创建精灵类型的效果,比如使用一张多边形卡片裁切出树叶形状,或者使发股末端变得透明。但需要注意的是,包含许多不透明度精灵(例如树叶)的场景可能会使渲染速度显著下降。

阿诺德渲染器中的物理学原理_第13张图片
叶片不透明度:禁用 / 叶片不透明度:启用 / Alpha贴图链接到“不透明度”(Opacity)

Transmission depth is similar, but rather than the surface it controls the density of the object interior. Denser volumes will absorb more photons as they pass through the interior, making the object darker where it is thicker.

透射深度与此类似,但它控制的不是表面,而是物体内部的密度。体积密度越高,在光子通过内部时吸收的光子越多,从而使物体越厚的地方亮度越暗。

阿诺德渲染器中的物理学原理_第14张图片
透射颜色:白色 / 投射颜色:浅蓝色
阿诺德渲染器中的物理学原理_第15张图片
Pepe model by Daniel M. Lara (Pepeland) 由 Daniel M. Lara 制作的 Pepe 模型 (Pepeland)

转载请私信。
禁止私自转载!

你可能感兴趣的:(阿诺德渲染器中的物理学原理)