Frame Buffers
mental ray stores finally rendered pixel data in frame buffers.
There are up to five main frame buffers pre-defined in mental ray:
for RGBA color, depth, normal vectors,
motion vectors, and
labels. The depth, normal vector, motion
vector, and label frame buffers store the respective values of
the frontmost object at each sample of the image. If multiple
samples are taken for a pixel, the frame buffer value for that
pixel may be either any one sample value, or a blend of all samples.
The number and type of frame buffers to be rendered is controlled by
framebuffer
statements.
Any number of additional user frame buffers of any data type but identical
resolution to the main frame buffers may be defined. These buffers will not
be filled by mental ray; their content is controlled by custom shaders only,
like output shaders. However,
mental ray will take care of writing the buffer content to image files.
The framebuffer statement allows to
create 'named' frame buffers in mental ray, together with data type and other
properties for this specific buffer. The number of frame buffers is not
limited by mental ray but only dependent on available system resources.
Storing a frame buffer to an output file
can be activated per buffer. It is possible to store several frame buffers
in a single file with multiple layers, for capable formats like
OpenEXR. mental ray will take care of
performing all required operations like data conversions and compression.
For backwards compatibility, frame buffer creation may also be controlled
with output statements.
The primary purpose of output statements
is to specify output shaders which
operate on the frame buffers. For backwards compatibility, deprecated
output statements can also specify files
to write.
Frame Buffer Files
mental ray is able to temporarily store frame
buffers in frame buffer files on
disk instead of keeping them in memory during rendering, given that sufficient
disk space is available. This technique is also referred to as
virtual frame buffers. It allows to
use very large frame buffers, or very large numbers of frame buffers, without
being limited by available physical memory. This feature can be controlled
with configuration settings or on
the command line of the standalone
mental ray.
By default, mental ray is using a frame buffer
cache mechanism, which is storing fragments of the frame buffers in disk
files as soon as their are finished. Only a small fraction of each frame buffer
is kept in memory, like the currently rendered tile, tiles recently accessed
by the display callbacks or output shaders, or when writing final images to
files. This feature may save significant amount of memory when rendering very
high resolution images, and is especially useful on 32bit systems with limited
memory resources. This technique is typically superior to memory mapped
files, the other virtual frame buffer option supported by mental ray.
In this case, frame buffers need to be stored and restored in full resolution,
which is more appropriate when rendering very many but smaller frame buffers.
It requires that the frame buffers fully fit into the virtual memory address
space of the process, making it more attractive for 64-bit systems. However,
if sufficient memory is available then virtual frame buffers might be turned
off to gain overall performance.
Note
Memory mapping large files can occupy a significant portion of the application's
virtual address space. The address space for a single process is limited on
32-bit architectures to 4 gigabytes or less, dependent on reserved space for
system frameworks and libraries. Trying to map a very large file or many files
might fail since there is not enough room left for the process to address it.
Frame buffer files are stored in the directory specified with
configuration or
command line options; otherwise in the
default temporary directory of the system.
Frame buffer files are removed from disk when rendering has finished.
Copyright © 1986, 2015
NVIDIA ARC GmbH. All rights reserved.