mental ray
Setup for CD vol I & II


return to main index



Introduction

Volume 1 and Volume 2 of the mental images® reference books are accompanied by a CD that contains demo versions of mental ray suitable for Windows, Linux and MacOSX (32bit). Unfortunately, the CD does not provide clear instructions on how to setup the renderer. This tutorial is intended to guide users through the process of installing the demo version of mental ray contained on the CD. Because the version of mental ray on the CD is somewhat limited in its capabilities it is referred to, in these notes, as Demo Limited.

Readers who have purchased Volume 3: Writing mental ray Shaders should refer to the tutorial "Mental Ray: Setup CD vol III". Its CD has a fully featured version of mental ray. The fundza tutorials refer to it as Demo Complete.



System Files

Linux & MacOSX

The directory structure for Linux and MacOSX are very similiar. You will require root privileges to create a directory named "mi" ie.

    /usr/local/mi

The following directories and files should be copied from the CD into the mi directory,


/usr/local/mi/
             bin/
                imf_copy
                imf_diff
                imf_disp (not OSX)
                imf_info
                mkmishader
                ray
            include/
                base.mi
                contour.mi
                geoshader.h
                mi_version.h
                mirelay.h
                physics.mi
                shader.h
                subsurface.mi
             lib/
                libray.so
             shaders/
                base.so
                contour.so
                physics.so
                subsurface.so

The files for the include directory (Linux, MacOSX and Windows) can be found on the CD in the following directory.

    CD/common/include

Windows

Create the directories shown in bold,

    C:\Program Files\mental images\mental ray

The following directories and files should be copied from the CD into the mental ray directory.


C:\Program Files\mental images\mental ray\
             bin\
                imf_copy.exe
                imf_diff.exe
                imf_disp.exe
                imf_info.exe
                mkmishader.exe
                ray.exe
             include\
                base.mi
                contour.mi
                geoshader.h
                mi_version.h
                mirelay.h
                physics.mi
                shader.h
                subsurface.mi
             lib\
                base.lib        
                contour.lib
                libray.dll      
                libray.lib
                physics.lib     
                shader.lib
                subsurface.dll
             shaders\
                base.dll
                contour.dll
                physics.dll
                subsurface.dll



The Users Directory Structure

When writing and testing shaders, users will create at least three types of documents, namely,

  • 'C' language shader source code files,
  • .mi shader interface description files,
  • .mi scene files.

This section recommends the adoption of a simple directory structure that will help the reader keep their files organized. It is suggested that directories named,

mi/shader_src
mi/shaders
mi/scenes
mi/manual

store shader source code files,
store compiled shaders,
store .mi scene files,
store mental ray documentation files.

The full paths to these directories are given in the tutorial "mental ray: Cutter Preferences". If Cutter's mental ray preferences are set correctly, mi interface description files will be automatically generated and saved in both the users shader_src and shaders directories.



The rayrc File

The rayrc document shown below has been adapted from a rayrc file written by Andy Kopra and Bart Gawboy. A .rayrc file provides a series of search paths that enable mental ray to find compiled shaders and their accompanying .mi descriptors. The .rayrc file required by Linux, MacOSX and Windows are almost identical. To prepare a rayrc file suitable for each operating system involves making a few edits. If you are working on,

  • Linux - delete lines 2 to 8
  • MacOSX - delete lines 1 to 3 and 6 to 8
  • Windows - delete lines 1 to 6

Linux and MacOSX users should save the edited .rayrc file (note the leading dot) into the root directory of their USER_ACCOUNT. Windows users should save the rayrc file, (no leading dot), directly into the mental ray directory on their C: drive.


rayrc


1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
registry "{MI_DIR}" value "/usr/local/mi" end registry
registry "{USER_DIR}" value "/home/USER_ACCOUNT" end registry

registry "{MI_DIR}" value "/usr/local/mi" end registry
registry "{USER_DIR}" value "/Users/USER_ACCOUNT/Documents" end registry

registry "{MI_DIR}" value "C:/Program Files/mental images/mental ray" end registry
registry "{USER_DIR}" value "USER_DRIVE_LETTER:/mi" end registry

$lookup "{MI_DIR}"
$lookup "{USER_DIR}"

registry "{_MI_REG_INCLUDE}" 
    value "{MI_DIR}/include;{USER_DIR}/mi/shaders" 
end registry
registry "{_MI_REG_LIBRARY}" 
    value "{MI_DIR}/shaders;{MI_DIR}/lib;{USER_DIR}/mi/shaders" 
end registry

link "base.so"
$include "base.mi"
link "contour.so"
$include "contour.mi"
link "physics.so"
$include "physics.mi"
link "subsurface.so"
$include "subsurface.mi"



© 2002- Malcolm Kesson. All rights reserved.