Configuration Settings

mental ray internal defaults or advanced properties can be set with the help of variables, either set in the runtime environment of the target operating system, or in the internal registry of mental ray, which is not platform dependent and more suitable in cases where the software is integrated into parent applications.

Environment Variables

Environment variables can be set from a shell prompt with shell commands such as setenv (see the documentation of your shell) before mental ray, or the application that mental ray is built into, is started from the same shell. Environment variables set after mental ray is started, or set from a different shell, have no effect. mental ray will work without any environment variables, except that the .rayrc startup script may not be found if MI_ROOT is undefined.

DISPLAY
The Unix X11 display to be used for OpenGL acceleration.
HOME
Unix home directory, for finding the user's local .rayrc file.
HOMEDRIVE
Windows NT home drive, such as C:.
HOMEPATH
Windows NT home directory. mental ray will try to load %HOMEDRIVE%/%HOMEPATH%/rayrc.
MI_ASSEMBLY_PATH3.6
A colon-separated or semicolon-separated list of paths to search for assembly .mi files referenced in a assembly.
MI_CG_FRAGMENT_PROFILE
Pass this profile name to the Cg compiler when compiling hardware shaders, instead of the profile matching the graphics hardware rendered on. This is useful in conjunction with the -hardware_echo command-line option to "cross-compile" shaders.
MI_HWDISPLAY
Overrides DISPLAY. This is useful if mental ray is run on one machine, where all graphical user interfaces are shown (so DISPLAY must point to the local host), but the local host does not have sufficient hardware rendering capacity so mental ray offloads it to another host, pointed to by MI_HWDISPLAY. This kind of remote hardware rendering incurs extra networking overhead but allows multiple desktop clients to share a fast hardware rendering server. It is not necessary for mental ray to be installed on the server, and no extra license is used. However, both the client and server hosts must have compatible OpenGL and OpenGL extension versions.
MI_LIBRARY_PATH
A colon-separated or semicolon-separated list of paths to search for files loded with the link command.
MI_LIGHTPROFILE_PATH
A colon-separated or semicolon-separated list of paths to search for lightprofile files.
MI_RAY_HOSTSFILE
Use this file name instead of the default .rayhosts to read host configuration for distributed rendering.
MI_RAY_INCPATH
A colon-separated or semicolon-separated list of paths to search for files included with the $include command.
MI_RAY_OPTIONS
Extra options that are inserted by mental ray before the options on the command line. This is commonly used for options such as -xcolor.
MI_RAY3_SERVICE
The IP service that mental ray uses to contact slaves on other machines. The default is mi-ray3 for mental ray 3.x. On Unix, service names are defined in /etc/services or in the services NIS map.
MI_RAY_SERVICE
If the previous variable is not defined, this one is used instead. This makes mental ray 2.x compatible with mental ray 1.9 while allowing both to coexist on the same machine. The default is mi-ray.
MI_RAY_SUBSTITUTE
An optional list of blank-separated substitution instructions, each in the form /search/replace/. Any other character besides / will also work.
MI_RAY_SWAPDIR
A swap directory where mental ray can temporarily store scene elements in files on disk when main memory runs out. This can be useful to render large scenes where other caching mechanisms are not enabled. mental ray generally swaps more efficiently than the operating system.
MI_RAY_SWAPLIMIT
The maximum number of bytes to write into the swap directory. A value of 0 turns off swapping.
MI_ROOT
The directory that mental ray searches for configuration files such as rayrc.
MI_STACKSIZE
New thread stacks will be created with this size in kilobytes if defined. The default is 16384 (16 MB) on Unix and 4096 on Windows. 4096 is nearly always sufficient except when very complex recursive shaders are used.
MI_TEX_LOOKUP_LOCAL
This variable can be set in network parallel rendering in order to look up and remap texture file paths on the individual rendering hosts instead of on the master host only. This allows to locate textures on the slave machines at a different file system path than on the master host.
Note that MI_TEX_LOOKUP_LOCAL should be set on all rendering hosts, not just the master.
Note also that this also causes file names to be echoed in the .mi format without performing file path substitutions.
SI_LOCATION
The directory of the linktab.ini file, which may be used by applications to customize file path mapping.
TMPDIR
A directory for temporary code or object files to be compiled or linked. The default is /usr/tmp on Unix and the current directory on Windows.
USER
The current user name. This is optional, and if it exists may be stored in image file headers, for example.

The mental ray registry supports lookups of environment variables. The form $var returns the value of the environment variable var, and $?var returns 1 if the environment variable var exists and 0 otherwise.

Registry Variables

Registry variables can be set from any .mi file. The special file .rayrc is automatically read by a standalone mental ray upon startup for configuration purposes.

mental ray recognizes and uses registry variables that begin with _MI_REG_ which have special meanings:

_MI_REG_INCLUDE
an include path where files included by $include commands are found, in addition to paths set with the -I command-line option.
_MI_REG_LIBRARY
an include path where shader libraries linked by link commands are found, in addition to paths set with the -L command-line option.
_MI_REG_MEMORY_LIMIT
the number of megabytes to use as memory limit default. May be overridden on the mental ray command line for a specific rendering.
_MI_REG_METASL_CIL 3.7
for MetaSL shaders, selects the .NET back-end instead of the C++ back-end if set to any non-empty value.
_MI_REG_TEXTURE
an include path where texture image files referenced by texture statements are found, in addition to paths set with the -T command-line option.
_MI_REG_LIGHTPROFILE
an include path where light profile files referenced by lightprofile statements are found, in addition to paths set with the -lightprofile_path command-line option.
_MI_REG_SWAPDIR
a directory to swap to, unless the -swap_dir command-line option has been specified.
_MI_REG_SWAPLIMIT
the number of megabytes to write to the swap directory, unless the -swap_limit command-line option has been specified.
_MI_REG_FBDIR
a directory where memory mapped frame buffers are stored, unless the -fb_dir command-line option has been specified.
_MI_REG_ASSEMBLY3.6
a directory where assembly files are stored, unless the -assembly command-line option has been specified.

mental ray provides and sets registry variables that begin with _MI_RAY_ as follows:3.6

_MI_RAY_VERSION3.6
the full version number of mental ray, like "3.6.50.18".
_MI_RAY_MAJOR_VERSION3.6
the major version number of mental ray, like "3".
_MI_RAY_MINOR_VERSION3.6
the minor version number of mental ray, like "3.6".
_MI_RAY_BRANCH3.6
the branch version number of mental ray, like "3.6.50".
_MI_RAY_REVISION3.6
the revision version number of mental ray, like "22985".
_MI_RAY_SYSTEM3.6
a general computer system name that mental ray has been compiled for. This is one of the strings "windows", "linux", or "macosx", and "unix" for all other systems.
_MI_RAY_PLATFORM3.6
the compile platform string of mental ray. Common values are "nt-x86", "nt-x86-vc8", "nt-x64", "linux-x86", "linux-x86-gcc4", linux-x86-64", "linux-x86-64-gcc4", "macosx", "macosx-x86", and "macosx-x86-64".
_MI_RAY_DATE3.6
a readable form of the build date of mental ray, like "21 Nov 2007".

Copyright © 1986-2009 by mental images GmbH