Keywords: main

Next: 6. Command Line Options Up: 5. Upgrading Previous: 5.2 Upgrading from mental
Subsections

- 5.3.1 Rendering Algorithms
- 5.3.2 Scene Description Language
- 5.3.3 Shader Writing and Integration

# 5.3 Upgrading from mental ray 3.0 to 3.1

mental ray 3.1 is a new major version of mental ray and has a very similar interface. Very little upgrading work is necessary, but there are a number of additional features.

## 5.3.1 Rendering Algorithms

- A new hierarchical grid acceleration algorithm was introduced that allows much better control than the old static grid accelerator in mental ray 2.1.

- Multipass rendering and merging is now supported. Render passes are independent renders of portions of the same scene, each generating a subsample-based layer file. Layer files can be merged back when rendering the last pass, or all layers can be merged as a separate process. Merging can be done in custom merging functions. Multipass rendering was introduced in mental ray 3.1.1, and was significantly enhanced (using an incompatible syntax extension) in mental ray 3.1.2.

- The `-nomaster` command-line option and the mi_job_set_slaves_only function call allow excluding the master from all tasks that can be handled on slaves, such as rendering and tessellating.

- The `bsp shadow on` option enables the new shadow BSP tree, which holds all shadow objects. The main BSP tree then only holds trace objects. This is useful if the scene contains simplified shadow stand-in geometry and has very low shadow ray coherence, for example if a light dome computed from a chrome dome photograph is used.

- The new multipass rendering facilities allow rendering a scene in passes, and combining the results on a subpixel level.

- Objects may specify min and max sampling parameters that constrain the sampling range in the options. For eye rays that do not see any objects, the `samples` statement in the options block allows an optional default constraint.

## 5.3.2 Scene Description Language

- Multiple motion vectors are now possible, and may require changes to shaders that evaluate motion vectors. (Normally mental ray handles motion vectors internally but post-motion output shaders might exist that access them directly.)

- A polygon vertex or free-form surface control point may have up to 15 motion vectors instead of only one. Multiple motion vectors define a path to allow curved motion blur. For motion transformations, a new `motion steps` option specifies the number of curve points to generate.

- Shutter statements may optionally define two values, a new shutter delay value defines the shutter open time in addition to the standard shutter close time.

- Two new types of area light source was introduced: one that uses any geometric object to define the shape of the light; and a user type that lets the light shader pick points on the light surface, and control integration in the material shader with state - > count.

- A new hair geometry primitive was introduced that can efficiently render large numbers of hairs.

- The new fine approximation mode allows efficient tessellation of freeform surfaces and displacement to microtriangles, which allows extremely detailed displacement without the previous high memory demands. This works with all rendering modes, including shadows and self-shadowing, motion blurring, ray tracing, global illumination, etc. See page for details.

- The new sharp approximation feature controls the sharpness of tessellations, by controlling the facet normals.

- New command-line options: `-approx`, `-approx_displace`, `-bsp_shadow`, `-diagnostic finalgather`, `-grid_depth`, `-grid_resolution`, `-grid_size`, `-nomaster`, `-motion_steps`, `-samples` with four arguments.

- New options block statements: `bsp shadow`, `diagnostic finalgather`, `grid depth`, `grid resolution`, `grid size`, `motion steps`, `pass`, `samples` with four arguments, `shutter` with delay argument, `traversal`. Image type `"rgbe"` in camera output statements, `pass` chain in the camera, `lightprofile` shader parameter type, `apply photonvol` in declarations, light profile blocks `lightprofile`...`end lightprofile`, `fine` and `sharp` attributes in approximations, and the `writable` attribute for texture statements. mental ray can use writable textures directly for rendering; mental ray 3.0 required a separate non-writable texture statement referencing the same file name.

- New image data types for RGBE (8-bit high dynamic range color data), and floating-point alpha and intensity channels including no-elliptic pyramid filtering for one-channel images. New image file formats IFF (Alias|Wavefront Maya), Radiance HDR, and HT (simple uncompressed HDR image).

- Inheritance functions are deprecated (but still supported), and replaced with the more powerful traversal functions that have full control over all forms of inheritance, including flags and materials.

## 5.3.3 Shader Writing and Integration

- Shaders can now define thread-local shader storage, to replace the simple method of indexing an array with a thread number, which worked in mental ray 2.1 but not 3.x. See page for details.

- The mi_trace_probe shader interface function in mental ray 3.1.2 and later finds objects with any flags, including visible and shadow, and is no longer restricted to objects marked trace. The state type is `miTRACE_PROBE`.

- High Dynamic Range images allow more compact storage of RGB color values greater than 1.0.

- IES and Eulumdat light profiles are supported. There is a new `lightprofile` ... `lightprofile end` block, and a new `lightprofile` shader parameter type. Light profile data can be passed to shaders in a similar way to user data. New mi_query modes, mi_api_lightprofile_* geometry shader API functions, and mi_lightprofile_* shader interface functions were introduced.

- Image streaming, which is part of the mental ray integration interface, has changed.

- Slave hosts can be added and removed at any time between frames, instead of using a list fixed at startup time, using the mi_msg_add_host and mi_msg_remove_host.

- New modes for mi_query were added:
  `miQ_FUNC_TLS_GET`
  `miQ_FUNC_TLS_GETALL`
  `miQ_FUNC_TLS_SET`
  `miQ_LIGHTPROFILE_COSTHETA_MAX`
  `miQ_LIGHTPROFILE_COSTHETA_MIN`
  `miQ_LIGHTPROFILE_INTENSITY_MAX`
  `miQ_LIGHTPROFILE_PHI_MAX`
  `miQ_LIGHTPROFILE_PHI_MIN`
  `miQ_LIGHTPROFILE_PHI_RES`
  `miQ_LIGHTPROFILE_THETA_RES`
  `miQ_LIGHT_CAUSTIC_PHOTONS_EMIT`
  `miQ_LIGHT_GLOBAL_PHOTONS_EMIT`

- Here is the complete list of new shader and integration interface functions:
  `mi_api_hair_begin`
  `mi_api_hair_end`
  `mi_api_hair_hairs_add`
  `mi_api_hair_hairs_begin`
  `mi_api_hair_hairs_end`
  `mi_api_hair_info`
  `mi_api_hair_scalars_begin`
  `mi_api_hair_scalars_end`
  `mi_lightprofile_sample`
  `mi_lightprofile_value`
  `mi_msg_remove_host`
  `mi_renderpass_access`
  `mi_volume_instances`

Next: 6. Command Line Options Up: 5. Upgrading Previous: 5.2 Upgrading from mental