原文:Understanding Physically Based Rendering in Arnold
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.
雖然我們在設(shè)計(jì)材質(zhì)時(shí)不一定要完全還原現(xiàn)實(shí)藕咏,也不一定要百分百符合材質(zhì)的物理特性,但是基于物理定律設(shè)計(jì)材質(zhì)可以呈現(xiàn)更真實(shí)的光照和陰影秽五。通過理解和應(yīng)用一些物理學(xué)原則創(chuàng)建材質(zhì)孽查,可以使渲染出的圖像更真實(shí),并且能夠創(chuàng)建在不同照明設(shè)置下輕松預(yù)見其表現(xiàn)的材質(zhì)坦喘。
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.
在現(xiàn)代渲染器中盲再,基于物理的渲染通常是指——能量守恒、物理上合理的散射瓣铣、材料和線性色彩空間中的層次等概念答朋。阿諾德雖然是基于物理規(guī)則的渲染器,但是如果需要棠笑,它也允許打破規(guī)則梦碗,創(chuàng)建不符合物理定律的材質(zhì)和燈光。在本文中,我們將解釋阿諾德渲染的基本原理洪规,以及如何設(shè)置著色器來遵循這些法則印屁。
? 阿諾德支持各種第三方程序,如: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.
在渲染時(shí)斩例,我們模擬光子從光源發(fā)出库车,經(jīng)過空氣傳播,在表面和體積中彈起樱拴,最終落在攝像機(jī)傳感器上柠衍。數(shù)以百萬計(jì)的光子在攝影機(jī)傳感器上組合在一起,就形成了渲染圖像晶乔。
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.
從物理學(xué)角度來看的話珍坊,曲面著色器描述了曲面如何與光子相互作用。擊中物體的光子可能會被吸收正罢、在曲面發(fā)生反射阵漏、透過曲面發(fā)生折射,或者在物體內(nèi)部四處散射翻具。這些組件組合在一起履怯,就產(chǎn)生了種類眾多的材質(zhì)。
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.
除非物體是發(fā)射光子的光源裆泳,否則它返回的能量不能多于入射光所貢獻(xiàn)的能量叹洲。材質(zhì)要做到能量守恒,離開表面的光子數(shù)量就要小于或等于入射光子的數(shù)量工禾。如果材質(zhì)不是能量守恒运提,材質(zhì)將會顯得過亮并且會增加渲染時(shí)的噪點(diǎn),尤其是在使用全局光照時(shí)闻葵。
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.
為了保證材質(zhì)的能量守恒民泵,材質(zhì)組件的權(quán)重和顏色值絕不能超過1。此外槽畔,我們必須小心確保所有組件的組合都是能量守恒的栈妆,稍后會詳細(xì)解釋。
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.
在微觀層面上厢钧,物體表面的細(xì)節(jié)是錯(cuò)綜復(fù)雜的鳞尔。對于渲染,我們不使用幾何體來表現(xiàn)所有這些細(xì)節(jié)坏快,而是使用統(tǒng)計(jì)模型铅檩,這類模型具有更易于理解的參數(shù)。
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.
阿諾德的標(biāo)準(zhǔn)曲面著色器在為物體建模時(shí)會建立一個(gè)或兩個(gè)鏡面反射層莽鸿,以及一個(gè)漫反射或透明內(nèi)部。這種模型可以表現(xiàn)各種各樣的材質(zhì)。我們來看一下各個(gè)組件的具體介紹:
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.
首先來看漫反射內(nèi)部祥得。入射光子進(jìn)入物體兔沃,在內(nèi)部四處散射,然后被吸收或在另一位置離開物體级及。
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.
如果光子散射很多次乒疏,并且由于光子在不同的位置和方向離開曲面,我們就會得到一個(gè)漫反射外觀饮焦。對于像皮膚這樣的材質(zhì)怕吴,光子可以在曲面下散射的相對較遠(yuǎn),呈現(xiàn)出一個(gè)非常柔軟的外觀县踢,我們使用次表面散射進(jìn)行渲染转绷;對于像原木材料,光子不會散射的非常遠(yuǎn)硼啤,因此呈現(xiàn)出更堅(jiān)硬的外觀议经,這種效果使用漫反射進(jìn)行渲染;對于像葉子這樣的纖薄物體谴返,光子可以一直散射到另一面煞肾,這種效果以漫反射 SSS(啟用 thin_wall)形式進(jìn)行渲染。
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.
請注意嗓袱,盡管我們在著色器中為所有這些類型的材質(zhì)提供了單獨(dú)的控制選項(xiàng)籍救,但是所有這些材質(zhì)背后都具有相同的物理機(jī)制。
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.
漫反射內(nèi)部通常對材質(zhì)的整體顏色影響最大渠抹。 每個(gè)光子都有一個(gè)關(guān)聯(lián)的波長钧忽, 并且根據(jù)材料的特性,某些波長的光子比其他光子更有可能被吸收逼肯。反過來就意味著耸黑,某些波長的光子更容易離開曲面,從而使曲面呈現(xiàn)彩色外觀篮幢。
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.
單個(gè)光子只能參與漫反射缺菌、次表面散射或背面照明這幾個(gè)組件中的一個(gè),為了實(shí)現(xiàn)物理上的正確性搜锰,我們不希望離開表面的光子比進(jìn)入的光子多伴郁。對于標(biāo)準(zhǔn)曲面,會自動確保這些組件的總和不高于 1蛋叼。
Specular Scattering(鏡面散射)
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.
鏡面反射層使用微面分布進(jìn)行建模焊傅。我們假設(shè)曲面是由許多沿隨機(jī)方向排列的微小的面構(gòu)成剂陡。粗糙度低的曲面(如鏡面)上各個(gè)微面之間幾乎沒有變化,因此呈現(xiàn)清晰銳利的反射狐胎。粗糙度高的曲面存在很多變化鸭栖,因此呈現(xiàn)更柔和、富有光澤的反射握巢。
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.
要查看曲面高光的變化歌焦,應(yīng)將貼圖連接到鏡面反射的“粗糙度”(Roughness)飞几。這不僅會影響高光的亮度,還會影響其大小和環(huán)境反射的清晰度同规。
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).
光子不僅可以在曲面上發(fā)生反射循狰,還可以透過曲面發(fā)生折射。光子將穿過鏡面反射層券勺,通常在離開該層的另一面時(shí)改變方向绪钥,具體取決于折射率 (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.
如果曲面的內(nèi)部是透明的(如透明玻璃內(nèi)部)关炼,光子將可以穿過物體并從另一面射出程腹。如果為漫反射內(nèi)部,光子可以在物體內(nèi)部散射儒拂,然后被吸收或再次離開物體寸潦。鏡面反射層的折射率越高,下面的漫反射內(nèi)部越清晰可見社痛。對于金屬這樣的材質(zhì)见转,穿過鏡面反射層發(fā)生折射的光子往往會立即被吸收,因此我們看不到漫反射內(nèi)部蒜哀。
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.
鏡面反射層反射或折射的光子的百分比與視角有關(guān)斩箫。從正面觀察曲面時(shí),大多數(shù)光會發(fā)生折射撵儿;以一定掠射角觀察曲面時(shí)乘客,大多數(shù)光會發(fā)生反射。這種現(xiàn)象稱為“菲涅爾效應(yīng)”淀歇。折射率控制著此效應(yīng)具體如何隨視角發(fā)生變化易核。
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.
對不透明度最好的理解是:不透明度是一種使用紋理為曲面幾何體建模的方法。它不影響光子與曲面的相互作用浪默,而是指示哪個(gè)位置不存在曲面幾何體牡直、光子可以直接通過缀匕。
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.
不透明度的一個(gè)典型用途是創(chuàng)建精靈類型的效果,比如使用一張多邊形卡片裁切出樹葉形狀井氢,或者使發(fā)股末端變得透明弦追。但需要注意的是岳链,包含許多不透明度精靈(例如樹葉)的場景可能會使渲染速度顯著下降花竞。
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.
透射深度與此類似,但它控制的不是表面掸哑,而是物體內(nèi)部的密度约急。體積密度越高,在光子通過內(nèi)部時(shí)吸收的光子越多苗分,從而使物體越厚的地方亮度越暗厌蔽。
轉(zhuǎn)載請私信。
禁止私自轉(zhuǎn)載摔癣!