Layered EXRs 分層EXR

Typically each AOV is written to its own image file. When working with animations, this can create file management issues. If each frame produces (say) 5 AOV images and there are thousands of frames, then there will be that many more image files on disk.

通常每個AOV都被保存到單獨的圖像文件中。在動畫製作過程中,這可能帶來文件管理上的麻煩。如果每一幀面畫都生成5個AOV,那麼幾千幀的動畫需要在磁碟上保存太多的圖片文件。

Layered EXRs alleviate file management issues by allowing the combination of multiple EXRs into one.

只要使用分層EXR文件(Layered EXRs)將這些單獨的EXR文件合併成1個,就能減輕這一問題。

Creating layered EXRs is very easy in Redshift. All you need to do is make your AOVs point to the same file. Redshift will detect this and automatically produce a single layered EXR containing all the participating AOVs.

在Redshift中生成分層EXR很容易。只要將所有的AOV指定為相同文件即可。Redshift將自動探測並將所有AOV合併到一個單獨的EXR文件中。

Once rendered, you can ensure your EXR contains all the necessary layers using utilities like imf_disp:

渲染完成後,可以使用imf_disp工具來檢查EXR文件是否包含了所有需要的層。

…or in your comp package (Nuke shown here) 也可以使用合成軟體比如說NUKE

Deep EXRs 深度瞭解EXRs

Introduction簡介

While AOVs can be powerful tools for compositing, they suffer from the fact that each pixel in a typical image can only store a single value.

儘管AOV是合成上強有力的工具,但他們受限於一幅圖片內的一個像素通常只能存儲一種信息。

This introduces a variety of issues such as:這還帶來一系列的問題

  • Object silhouettes can produce pixelated artifacts during the comp process. This is because the silhouette pixels are shared between multiple objects (the current object and any objects behind it).

物體的邊緣輪廓可能在合成時產生像素方面的問題。這是由於邊緣輪廓像素內可能同時存在很多個物體信息(當前物體的部分,以及背景中的其它物體的部分)

  • Depth of field and motion blur produce compositing issues because the blurred pixels are shared between multiple objects (the blurred object and any objects behind it)

景深和運動模糊也產生合成方面的問題,因為被模糊之後的像素中也同時包含多個物體的信息(被模糊的物體以及任何其他在其後面的物體)

  • Transparencies produce issues because the final pixel is a combination of all the

    transparencies that contributed to that pixel. So, once again, it』s a problem of multiple objects/depths contributing to the same pixel.

透明也會產生問題,因為最終的像素是所有這個像素內的透明信息的綜合。因此這一問題再次出現,即由於一個像素要同時包含多個物體的信息在裡面。

As it can be seen, the main issue with all these problematic cases is the fact that multiple different objects (or depths) are all affecting the same pixel. And, because non-deep images can only store a single value per pixel, significant information is lost because of this limitation.

綜上所述,所有這些問題的來源都是一個:由於很多不同物體(或者景深)同時影響一個像素的信息。因此不含深度信息的圖片只能在一個像素內存儲單個的一個值。許多重要的信息都因此被丟棄了。

Traditionally, artists solve these issues by rendering the frame in different passes in order to generate multiple images at different depth or transparency levels. This requires advance knowledge about how these passes will be used/combined and canbe both laborious and wasteful in terms of rendering resources.

傳統上,藝術家為瞭解決這一問題必須在每一幀渲染許多通道,從而在不同深度或者不同的透明級別上產生多張圖片。這需要我們在處理這些通道上有豐富的經驗,同時,既浪費渲染資源,又占人工成本。

Deep EXRs were introduced in the industry-standard EXR 2.0 specification and were

designed to hold multiple values at each pixel. They, therefore, allow a wide variety of compoperations without worrying about usage of depth of field, motion blur and transparency or issues around object silhouettes.

在工業標準EXR2.0中引入了Deep EXRs,這一技術是針對處理單個像素存儲多個信息的。因此有了它,大量圍繞物體邊緣輪廓的合成問題,包括使用深度、運動模糊以及透明度問題可以得到解決。

The main drawback with deep EXRs is their increased file size and subsequent storage needs. The increased file size stems from the fact that multiple values (「samples」) are stored for each pixel. Redshift tries to keep deep EXR files sizes as small as possible via a small set of controls discussed below.

使用DeepEXR所帶來的最大缺點是存儲空間開銷很大。由於每個像素現在包含了很多個值(多次採樣信息),使得文件變得很大。Redshift通過利用一些小的技術,力圖保持文件儘可能的小。下面我們來討論這個問題。

Important Limitation Currently, Redshift can only store beauty, depth and objectID in deep EXR files. The remaining AOV types will be supported at a later stage.Because of this limitation,when rendering with Deep Output enabled, any AOVs(other than ObjectID) will be disabled.

當前版本的重要侷限

當前的Redshift只能在Deep EXR中存儲Beauty,Depth和Object ID。剩下的AOV類型將在未來的版本獲得支持。

由於這個侷限,在開啟Deep Output渲染時,任何AOV(除了Object ID)都將被禁止。

  • Enabling Deep Output in Maya 在Maya中開啟Deep Output

To enable Deep Output rendering in Maya, you need to enable the「Enable Deep Output」 option in the AOV tab. The remaining Deep Merge options will then become available.

要在Maya中開啟Deep Output渲染,只需要在AOV選項卡中勾選Enable Deep Output即可。然後Deep Merge將變成可用狀態。

Then, ensure that your beauty pass is using the EXR image format

接下來確保Beauty Pass正在使用EXR輸出方式。

  • The Merge Sample Options 合併採樣選項

As mentioned above, deep EXRs can produce large files. For this reason, most

renderers contain options for merging together the multiple values of eachpixel so that the file sizes can be reduced.

前面提到,Deep EXR會導致文件很大。因此很多渲染器會包含一個選項,使得很多數值被合併到存儲到一個像素中。這能幫助降低文件大小。

The following options explain the different merging modes supported by Redshift and

how they could be used in your scene.

接下來,我們介紹一下Redshift所支持的幾種不同的合併方式,以及怎麼使用它們。

Important Note重要提示 Please note that too much merging means that not enough

information will be preserved on the final pixels and the benefits of deep EXRs

will be lost.

請注意,如果太多信息被合併,也就意味著損失了最終像素中的信息,從而失去了使用Deep EXR的意義。

On the other hand, too little merging means that the deep EXR files can be verylarge, especially for scenes using high geometrical complexity, transparency,depth of field or motion blur.

另一方面,合併太少,Deep EXR文件就會很大,特別是在場景中包含了大量複雜的幾何體、透明信息、深度信息或者運動模糊。

Learning how to effectively use these parameters is very important in order to

bring the EXR file sizes under control!

學習如何有效地使用參數很有必要,這能幫助用戶合理的控制文件大小。

Redshift currently supports two Deep Merge modes: Z and ObjectID.

Redshift當前支持兩種Depp Merge模式:Z和Object ID。

  • Z Mode Z模式

The 「Z」 mode means that, for each pixel, depth samples that are close to each other will be merged together. The 「Deep Merge Z Threshold」 parameter controls how close the samples will need to be in order for them to be merged together.

Z模式表示,對於每個像素,當採樣到的深度非常接近時,將其合併到一起。Deep Merge Z Threshold參數控制合併到閾值,即當這些採樣的距離小於多少時,會合併到一起。

To explain how this works, let』s look at this simple scene containing a few motion

blurred spheres.

要解釋這一過程如何進行,請看如下包含兩個帶有運動模糊球的簡單場景。

The following image shows how samples are collected by Redshift as rays are shot

for a pixel. The arrow denotes a single ray shot from the camera (a 『primaryray』) and the X』s are the gathered samples. Each sample has its own Z whichdenotes how far away it is from the camera. The samples of the red sphere arethe closest to the camera while the blue sphere samples are the farthest ones.

下面的圖片顯示了在每個像素髮射採樣射線時,Redshift是如何收集採樣信息的。箭頭表示一條從攝像機發射出的採樣射線(一條一級採樣射線),X用來表示收集採樣信息的位置。每個採樣都有它自己的Z信息,用來記錄此時它與攝像機的距離。對紅色球體的採樣與攝像機記錄最近,對藍色球體的採樣與攝像機距離最遠。

As the ray goes through the motion-blurred trails, it gathers several samples

隨著採樣射線穿過運動模糊的拖尾,它會採樣很多次。

Using the Z Deep Merge mode, samples that are close to each other (in Z)are merged together. This reduces the total number of samples stored for that pixel and, subsequently, reduces the final EXR file size.

使用Z Deep Merge模式時,如果各次採樣這間的距離很接近(通過Z來算出距離),就會被合併到一起。這較少了單個像素內總的保存的採樣數量,因而能減少最終EXR文件的大小。

Note注意 The smaller the 「Deep Merge Z Threshold」, the fewer samples willget merged together. In this case, each pixel will have to store lots ofindividual samples and the final EXR file will be large.

Deep Merge Z Threshold越小,合併的採樣就越小。在這個例子中的最終EXR文件裏,每個像素將保存很多次採樣信息。

To see this effect in a more practical manner, let』s inspect an actual deep EXR image in Nuke. We』ll use the 「DeepSample」 Nuke node to inspect one of the pixels.

想要在實例中看到更直接的效果,讓我們看一個實際在Nuke中合成Deep EXR的例子。我們將使用「Deep Sample」Nuke節點看查看每個像素。

Looking at the deep data in Nuke, we realize that some pixels contain many samples in them! This is because, for this scene, the default 「Deep Merge Z threshold」

(0.01) was too small.

通過Nuke的深度數據,我們可以看到一些像素中包含了很多採樣信息。這是因為這個場景中使用的Deep Merge Z Threshold(0.01)太小了。

If we increase the Z threshold to 0.1 and re-render, we get fewer samples per pixel and the EXR file size is reduced considerably: 37 samples instead of 218 for the chosen pixel.

如果增加Z Threshold到0.1重新渲染,每個像素中記錄的採樣信息會少很多,EXR文件也會小很多。被選中的像素內,包含37個採樣信息,不再是218個。

An even larger Z threshold would have reduced the stored samples further.

一個更大的Z Threshold會使採樣信息減少更多。

  • ObjectID Mode ObjectID模式

The ObjectID mode will merge all samples that belong to the same objectID without caring about whether they are close to each other in Z or not. This means that, by default, the ObjectID mode performs more sample merging than the Z mode, which in turn produces significantly smaller EXR files.

ObjectID模式將合併所有屬於相同Object ID的採樣,不理會這些採樣相互這間的Z深度差別。也就是說,默認狀況,相比Z模式,Object ID模式合併的採樣要多得多。

The following image shows how the Z mode works for our example scene.As it can be

seen, each object with a different ObjectIDgets a single sample.

下面的圖片顯示了Object ID模式是如何工作的。可以看到,每個擁有不同Object ID的物體只採樣了一次。

Note注意 For the ObjectID Deep Merge mode to be effective, objects need

to be assigned different ObjectIDs.

讓Object ID Deep合併模式更有效率,每個物體要被賦予不同的Object ID。

To see this effect in a more practical manner, let』s render the image from a lower vantage point where the sphere blurred trails overlap for a given pixel.

想看一個實際例子,讓我們在一個問題角度渲染一張圖片。此時在所選擇的位置點上,球體運動模糊的拖尾交疊在一起。

Inspecting the actual deep EXR image in Nuke reveals that the pixel in question only contains 3 samples. That is indeed what we expected since each sphere has its own ObjectID.

在Nuke中查看這張Deep EXR圖片,問題點上只包含了3個採樣。由於每人物體都有自己的Object ID,這也是我們所期待的結果。

While the Object ID Deep Merge mode produces significantly smaller EXR files, it has a few drawbacks.

儘管Object ID Deep Merge模式輸出的EXR文件大小精簡了很多,但它也有一些缺點。

If you try to composite together multiple deep EXRs (containing different objects), you could get visual artifacts if the objects in the different EXRs intersect each other in Z, as shown below.

如果想合成多個Deep EXR文件(包含多個不同物體),如果向下圖顯示的那樣,物體在不同EXR中相互交疊,在輸出中可能出現一些可見的缺陷。

Say you』re compositing aHoudini particle system (the gray cloud in the image) stored in a deep EXR with some redshift geometry (the red boxes in theimage) stored in another deep EXR. If the particle system intersects the Redshift geometry, the ObjectID Deep Merge mode will generate insufficient Z information and produce visual artifacts around the intersection areas during comp

假設你在在合成一個保存在一個Deep EXR中的Houdini粒子系統(圖片中灰色的雲),而另一些Redshift幾何體(圖片中紅色的方形)包含在另一個Deep EXR中。假設粒子系統與Redshift幾何體正好交疊,Object ID Deep Merge模式所產生的Z信息就不夠充分,從而導致合成時,交疊部分出現問題。

On the other hand, if the particle system is clearly separated from the objects, fewer or no issues will arise.

假如粒子系統與物體距離分得很開,那麼幾乎不會有問題出現。


推薦閱讀:
相關文章