General概述

This tutorial shows how to use the various AOV options to generate a set of AOVs and then re-compose them back into the original beauty pass using Nuke.

這一篇指南說明了怎樣使用不同的AOV選項來產生一組AOV,然後通過NUKE來將這些AOV重新合成出原始的Beauty層。

For this tutorial, we』ll use a simple scene which is similar to the one used for the AOV document. This scene uses a combination of features such as diffuse lighting and GI, reflections, refractions, caustics, subsurface scattering and incandescence, so it covers all the shading-related AOVs.

在這篇教程中,我們使用與AOV文檔類似的一個簡單場景來舉例子。這個場景包含了Diffuse Lighting(漫反射光照)、GI(全局照明)、Reflection(反射)、Refractions(折射)、Caustics(焦散)、Subsurface Scattering(次表面散射)以及Incandescence(自發光)。因此可以說包含了著色光景AOV的各個方面。

Gamma Settings伽馬設定

For this tutorial, we desire gamma-corrected results. For this reason Redshift』s gamma settings are as follows:

在這個教程中,我們需要得到經過Gamma校正的結果。因此Redshift的Gamma設置如下:

  1. Display Gamma: 2.2 顯示伽瑪2.2
  2. File Gamma: 「Automatic」 紋理貼圖為自動
  3. Sampling Gamma: 「Use Display Gamma」 採樣伽瑪與顯示伽馬匹配

As will be explained below, we』ll use 16-bit OpenEXR files. As explained in this document, when the file gamma setting is set to 「Automatic」, any data written to a floating-point image file format (like EXR) will be written in Gamma 1.0 (linear) space. This simplifies the workflow of most compositing applications.

我們使用16-bit OpenEXR文件輸出,下面會進行解釋。與Gamma校正一節之前的幫助說明一樣,這一文件的Gamma被設為Automatic,所有數據寫入浮點文件格式(比如EXR)時,都使用線性方式(Linear,即Gamma1.0)。這能簡化合成的流程。

8-bit formats versus 16-/32-bit (half/float) image formats 8-bit格式與16/32bit格式(half/float)圖片格式

For maximum precision, we recommend that users prefer 16/32 bit (i.e. half/float)

image formats over 8-bit ones. While 8-bit formats can also work, the lower numerical precision means that adjustments in a comp package can produce color banding and other types of visual artifacts. Furthermore, inconsistencies between compositing applications means that some 8-bit formats like PNG and TGA might not work the same between applications.

要使用最精確的數值,我們推薦使用16/32bit(即Half/Float)圖片輸出格式取代8-bit格式。儘管8-bit格式也能工作,但由於其精確度不夠,使得後期調整起來餘地很小(會產生帶狀色塊以及其他問題)。不同合成工具對諸如PNG和TGA這亮種8-bit格式的不同解釋,還會造成合成結果不盡相同。

For most purposes, a half-precision 16-bit format such as OpenEXR is typically sufficient and provides a good balance between numerical precision and file size.

建議使用一種支持半精度16-bit的格式,諸如OpenEXR來輸出,因為這種格式能取得精度與文件大小方面很好的平衡。

For this tutorial, we』ll use the following AOVs, all of which are configured to use the 16-bit (half) OpenEXR file format:

在這個教程中,我們使用如下AOV,所以這些都用16-bit(half)OpenEXR文件格式:

  • Diffuse Filter 漫反射過濾
  • Diffuse Lighting Raw 原始漫反射照明
  • Global Illumination Raw 原始全局照明
  • Sub surface Scattering 次表面散射
  • Specular Lighting 高光照明
  • Reflections 反射
  • Refractions 折射
  • Emission 自發光
  • Caustics 焦散

How the AOVs should be recombined 怎樣合成這些AOV

Once we have rendered the above AOV image files, the final beauty pass can be

recombined with the following equation:

一旦我們將以上AOV渲染成圖片文件,可以按以下步驟重新合成出Beatuy層:

Beauty = DiffuseFilter*DiffuseLightingRaw + DiffuseFilter*GlobalIlluminationRaw+

DiffuseFilter*SubsurfaceScattering + SpecularLighting + Reflections + Refractions +

Emission + Caustics

Please note that if we were using 「Caustics Raw」 instead of 「Caustics」, these would have to also be multiplied by 「Diffuse Filter」.

請注意,如果使用的不是Caustics而是Caustics Raw,那這一層要先與Diffuse Filter做正片疊底(Multiply,相乘)合併。

In Nuke

All the EXR images were brought in Nuke. By default, Nuke uses a 「linear」 color space for EXRs – this is desirable. Using the correct color space is important, as an incorrect color space will produce wrong composition results!

所有EXR圖片都導入NUKE。NUKE默認為EXR文件使用Linear(線性)色彩空間,這也是我們希望的。正確使用色彩空間很重要。因為錯誤的色彩空間會導致錯誤的結果。

As can be seen in the next image, the DiffuseFilter AOV is multiplied by DiffuseLighingRaw (leftmost), GlobalIlluminationRaw (middle) and SubsurfaceScattering(rightmost). These three multiplications, along with

the remaining AOVs are all added together using a Merge (plus) node.

如下圖所示,Diffuse Filter AOV與Diffuse Lighting Raw(最左邊),Global Illumination Raw(中間)以及Sub surface Scattering(最右邊)以相乘的方式混合。將這三個乘積(Multiply)的輸出與剩餘的AOV通過Plus節點直接相加。

We』ve also connected the original beauty pass (also a linear EXR) to the viewer node. Using Nuke』s 「wipe」 tool we can compare it to our final comp and verify that the nodes are setup correctly.

我們也導入了Beauty通道( 同樣是Linear EXR)作為參考。可以使用NUKE的Wipe來對比合成結果與Beauty,看合成節點是否連接正確。

So, what if we had used PNGs instead of EXRs?

我們如果使用PNG文件來代替EXR文件將會是什麼情況呢?

Well, the combination math is identical. The only difference is the color space we have to choose for each imported image. By default, Nuke assumes that all PNGs are using the sRGB color space. But, because we rendered these PNG images with a gamma of 2.2, the correct color space is 「Gamma 2.2」. Please note that the Gamma 2.2 color space looks very similar to the sRGB color space. In fact, they can look nearly identical to the naked eye, but there are some differences between them. Selecting an sRGB color space instead of Gamma 2.2 will mean some subtle errors in the math which will

produce an image slightly (or not so slightly, depending on the case) different to the beauty image.

合成的數學方法完全一樣。唯一的區域是輸入文件的ColorSpace。NUKE讀取PNG默認的方式是SRGB。但由於我們渲染這些PNG圖片使用了Gamma2.2,因此正確的ColorSpace就是Gamma2.2。請注意,Gamma2.2色彩空間與SRGB非常接近。實際上肉眼觀察二者幾乎是等價的。當然,實際上二都還是有一些細微差別。選擇SRGB而不是Gamma2.2會導致數學上出現一些極其微小的錯誤,從而導致輸出結果與Beauty參考有些出入(有些情況下或許差別還是有一點明顯)。

From that point onwards, it』s possible to adjust the individual AOVs and tune the

look. Or, alternatively, use one or more of Redshift』s Puzzle Matte AOVs to mask parts of the image and perform per object (or per object group) or per-material adjustments.

按照我們的初衷,可以調整單獨的AOV來改變最終的輸出。或者,我們也可以使用一層或者多層Redshift輸出的Puzzle Matte AOV層來遮擋圖片的某些部分,針對某些物體或者某些材質的進行單獨的調整。

Jagged Edges (「Aliasing」) in the AOVs AOV中的邊緣抗鋸齒(Aliasing)

Some AOVs have options to disable antialiasing, such as then using 「center sample」 for depth or world position or disabling filtering for the motion vectors. However, most AOVs are generated with filtering (antialiasing) enabled by default.

一些AOV設置可以取消抗鋸齒,比如用Center Sample輸出Depth(深度),或者在輸出Motion Vector(運動矢量)時Disabling Filtering(取消過濾)。但是絕大多數AOV會默認開啟過濾(Antialiasing抗鋸齒)

Antialiasing in Redshift happens in an adaptive manner through unified sampling. In a nutshell, Redshift looks at the beauty pass colors and if it detects that a pixel is near a sudden color edge or around excessive noise, it refines that pixel by shooting more rays which, in turn, 『cleans』 that pixel.

有時,Redshift能通過Unified Sampling自適應調整抗鋸齒。簡而言之。Redshift在渲染時查詢Beauty層的顏色,如果發現某個像素與周邊顏色變化很劇烈,或者說在某個像素周圍發現了噪點,它會通過在這個像素中重新發射更多採樣射線來讓這個像素更乾淨。

Since Redshift uses the beauty pass to do refinement, this can create the following problem: a pixel might be 『clean』 for the beauty pass but it might not be for an AOV and, because it won』t get refined, it might look jagged or noisy in the AOV.

由於Redshift使用Beauty層來判斷,因此可能導致下列問題:某個像素可能在Beauty層中很乾凈,但在AOV中由於沒有經過重新強化採樣導致AOV中出現抗鋸齒或者噪點。

Note Examples of where the beauty is considered 『clean』 by the adaptive refinementalgorithm include areas with very dark lighting or no lighting at all (as in the following examples) or meshes using flat shaders such as 「constant」 or 「incandescent」.

注意:

當計算到某個區域光照很暗,或者根本沒有光照(就像下面的例子)或者多邊形使用了類似Constant、Incandescent這些較平的材質時,自適應採樣會將這種情況下的Beauty視為乾淨。

The solution to this problem is to use enough unified 「min samples」. Unified sampling settings like 「min samples: 4, max samples: 256」 should be avoided. 「Min samples」 settings like 32 or above should work for most cases.

對這一問題的處理辦法是提供足夠大的Min Samples。Unified Sampling設置中,類似於「Min Samples : 4 , Max Samples : 256」的設置應該避免。Min Samples設置為32能滿足絕大多數的情況。

The following images demonstrate the above points.

以下圖片可以說明上述情況。

Our example scene is lit by a single area light. This is the Depth AOV with 「Full」 filtering enabled. The unified sampling settings are min samples:2, max samples:128. The Depth AOV in this case is clean because the beauty pass has enough contrast around the edges to force the adaptive antialiasing to refine.

我們這個例子的照明是一個區域光源。這是使用了Full模式的Depth AOV。Unified Sampling為Min Sampling : 2,Max Samples:128。在這個例子中,Depth AOV已經非常乾淨,因為Beauty Pass在邊緣處理提供了足夠的對比以強化自適應採樣抗鋸齒。

However, once the area light multiplier is set to zero the beauty pass becomes totally black. This makes the adaptive antialiasing algorithm terminate early which affects the quality for the Depth AOV, producing jagged edges

但是,一旦區域光的Multilier參數降低到0,Beauty層將變成純黑。此時的自適應抗鋸齒將提前終止,造成Depth AOV產生了很多邊緣鋸齒。

Increasing the unified 「min samples」 to 32, improves the Depth AOV quality.

增加Min Samples到32,Depth AOV質量提升很多。

Noise In The AOVs AOV中的噪點

When Redshift generates the AOVs, it applies certain sampling optimizations that are based on how important that AOV is to the final image. For example, if a reflection is very dim, Redshift uses fewer rays to compute it.

在Redshift渲染AOV的時候,會自動根據這層AOV在最終圖片中起到的作用大小來優化採樣。此如當反射層非常弱時,Redshift會用非常少的採樣射線來計算它。

While this is perfectly fine for beauty renders, it means that AOVs can appear to be noisy when viewed on their own. If you intend on brightening up an AOV in a comp application, that noise can become particularly visible and ruin your final comp.

儘管在只輸出Beauty層時這樣作很好,但這將意味著如果單獨看某一層AOV,很可能會看到上面有很多噪點。如果你在合成軟體中提升這一層的亮度,那麼噪點會隨之出現在最終的合成畫面中。

The images below show an example of this.下面的圖片就是這樣一個例子。

While the final rendered scene shown in the images above appears to be pretty 『clean』 in terms of noise, if one looked at the Global Illumination Raw AOV by itself, they』d be able to see some noise:

儘管在第一幅圖畫面很乾凈,但如果單看 Global Illumination RAW AOV,噪點還是很明顯的。

Increasing the exposure of that AOV to 2 stops (i.e. 4 times brighter) makes the noise even more visible:

增加AOV的Exposure(曝光值)到2 stops(表示提高到4倍亮度),噪點還是很明顯。

The noise has now become more visible and, even worse, it』s not consistent throughout the image! Certain parts of the image were able to be cleaned faster than others by Redshift』s adaptive algorithms. As an example, look around the shadow area of the rightmost sphere. In this example, any place in the image that was most lit by direct lighting meant that indirect lighting (GI) didn』t have to work as hard, because in the grand scheme of things it wasn』t as important. Shadowed areas, on the other hand, have no strong direct lighting in them so GI is more visible and has to be cleaned more. This is the reason why areas under shadow appear to have cleaner GI.

現在噪點很明顯,更糟糕的是,現在整個圖片中的噪點的嚴重程度不一樣。使用自適應演算法去除圖片中的某些區域的噪點,要比其他區域容易。比如最右側球體的陰影區域。在這個例子中,圖片任何接受直接光照的區域都要比只接受間接光的區域採樣少,因為渲染器有強烈的直接光源照明,GI所佔亮度比例會很大,因而必須足夠乾淨。這也就表明了為什麼在陰影區域中,GI AOV中更少噪點。

This 『noisy AOV』 issue can be solved by disabling certain optimizations:

只要在Noisy AOV層中取消特定優化,就可以解決這個問題:

1. Make the unified sampling min and max samples the same. This disables unified adaptive sampling.

將Unified Sampling中的Min 和Max採樣設置為相同數值。這就取消了自適應採樣。

2. In the Output tab, under 「AOV Processing」 enable the 「Disable Importance-Based Optimizations」 option. This ensures that reflection/refraction AOVs are not going to be noisy because the mirror/glass was dark.

在AOV Processing中Output選項卡中開啟Disable Importance-Based Optimizations。這樣就能保證Reflection/Refraction AOV中不會出現噪點,因為鏡子和玻璃很暗。

Unfortunately disabling these optimizations does mean longer render times!

不幸的是如果你禁用這些優化,渲染時間會增加幾倍!

Please note that even if an AOV appears to be noisy by itself, this doesn』t necessarily mean that the noise will be visible on your final comp. AOV noise is typically an issue if something that used to be dark in the beauty was made significantly brighter in comp – as shown in the example above. This means that, in certain cases, you can get away without having to disable the above optimizations.

請注意,就算某個AOV中有噪點,這也並不意味著最終的輸出圖片就一定有噪點。通常只有當某一個原本很暗的層,在合成時被刻意加強時(就像上面的例子)噪點才會在最終合成中出現。也就是說,在這種情況下,才有必要取消那些優化選項。

OV Intensity Clamping AOV強度限制

Redshift supports intensity clamping for primary rays (「Max Subsample Intensity」) as well as secondary rays such as reflection/refraction/GI rays (「Max Secondary Ray Intensity」). These two controls limit the maximum allowed brightness of rays which helps with situations where very bright light sources produce visual artifacts known as

『fireflies』 and excessive noise. Please refer to this documentation page for more information about these controls.

Redshift支持Primary Rays設定Max Subsample Intensity(強度限制)。也支持Secondary Rays,比如折射/反射/間接光設置Max Secondary Ray Intensity(強度限制)。這兩個參數能限制採樣射線取得的最大採樣亮度。這能改善極強光源所造成的Fireflies(螢火)現象和噪點。請參考這兩個參數的相關章節來獲取更詳細的信息。

By default, the 『max subsample intensity』 clamp is only applied on the beauty pass. For Softimage and 3dsMax, the intensity clamping controls can be found in the 「AOV Processing」 parameter group in Redshift』s 「Output」 tab. In Maya, the controls are in Redshift』s 「AOV」 tab.

默認情況下Max Subsample intensity是在Beauty層上計算。對於Softimage和3dmax,這個控制可以在Redshift的Output選項卡,AOV Processing參數中找到。

In Maya

The following example demonstrates the effect of AOV clamping and its importance in matching the beauty pass, assuming that the beauty pass is also using clamping, of course.

以下例子說明了AOV Clamping(強度限制)的作用。同時,這也說明,只要Beauty層中也使用Clamping,它就能與Beauty層匹配。

The scene contains a series of self-illuminated dinosaur models on top of a plane using a glossy reflection shader.

這個場景中包含了平面上的一系列自發光的恐龍模型,平面使用了Glossy

Reflection Shader(模糊反射材質)

The test scene測試場景

For this test, we assume that we want to use a 『max subsample intensity』 of 1.0 forour beauty pass.

在這個例子中,我們假設Max Subsample Intensity在Beauty層中被設為1.0.

Scene rendered with a 『max subsample intensity』 of 1.0 場景中使用Max Subsample Intensity1.0渲染。

The Reflection AOV rendered with AOV clamping disabled. Notice how the reflections appear harder than our beauty image above.

Reflection AOV關閉了AOV Clamping(強度限制)。請注意,反射比之前在Beauty層中出現的更強了。

If we were to use the unclamped reflection AOV, the final comp wouldn』t match the beauty pass.

如果我們使用Unclamped(為打開強度限制)Reflection AOV做最終合成,結果將無法與Beauty層匹配。

Reflection AOV rendered with AOV clamping enabled. Notice how the reflections now match the beauty』s look.

Reflection AOV開啟AOV Clamping 注意現在的Reflections與Beauty層匹配了。

Please be aware that intensity clamping either on the beauty or AOVs can produce discrepancies between the two. The reason is that intensity clamping on the beauty pass is applied on the final pixel, while AOV intensity clamping happens on each AOVindividually. As a result, when the AOVs are recombined in a comp package, they can produce a result that differs in intensity compared to the beauty pass. Depending on the lighting scenario, this discrepancy can be small or large.

請記住,只要在Beauty層或者AOV中用了Clamping渲染與合成結果就不會不匹配其原因是對Beauty層的強度限制會應用到最終的輸出像素上,而AOV Clamping會發生在渲染每一層AOV時。這會最終導致AOV重新合成後的亮度與Beauty不一致。在不同的照明條件下,這種差別可大可小。


推薦閱讀:
相关文章