Texture Caching

mental ray supports caching of textures for some image formats. When texture caching is used then only the currently needed parts (tiles) of a texture are loaded into memory, which can reduce the memory consumption during rendering dramatically. These tiles are automatically removed or replaced by recently accessed ones. The size of the cache is adjustable.

Texture caching has some advantages compared to memory mapping, especially on 32-bit machines where virtual address space is limited. For scenes with many large textures not all of them would fit into the virtual memory simultaneously. In such cases, mental ray would frequently unmap and remap textures from memory on demand. This is a relatively slow operation. In contrast, cached textures occupy just a small fraction of their full size in memory. Texture tiles or pages are read from the image file only on demand, unused areas of a texture are not kept in memory.

Furthermore, cached textures have no restriction on supported data type, number of components or bit depths, and endianess. Data type conversions are performed on the fly. Memory mapped textures, on the other hand, need to be prepared for specific data types and endianess of the target machine, which typically requires to pre-convert texture files to the .map format.

The disadvantage of texture caching compared to memory mapping is the small runtime overhead to handle the cache, which applies even in cases where the full scene would fit into the virtual memory.

Texture caching is enabled by default, but actually utilized only for textures that are supplied in a supported format, and which are defined as local.

Texture caching is generally supported for the Autodesk Maya .iff, TIFF .tif, OpenEXR .exr (in tiled format), the mental ray .map (in remap format) and Microsoft Windows Bitmap .bmp image file types. If filtering is requested for a texture in mental ray then further requirements apply: if the pyramid level images are provided in the image file then they are all passing through the cache, otherwise only the highest level is cached and the lower levels - computed dynamically in mental ray - are not. Providing a pre-filtered image pyramid is currently supported for the TIFF mipmap pyramid, OpenEXR mipmap or ripmap pyramids, and the .map format. Support for further image file formats may be added in the future versions.

During rendering mental ray reports info and progress messages when texture caching has been used. Texture cache detail messages can be enabled on the command line.

The texture cache behavior and memory consumption can be customized using the registry, or on the command line of standalone mental ray.

Copyright © 1986, 2015 NVIDIA ARC GmbH. All rights reserved.