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.

假如粒子系统与物体距离分得很开,那么几乎不会有问题出现。


推荐阅读:
相关文章