mental images - rendering imagination visible



Errata for volume 2, Programming mental ray

Last update: October 30, 2003.

Second Edition

Corrections

Using and Writing Shaders, RC functions, page 296

   

Clarification: When calling mi_trace_probe with a modified state->point, it is necessary to first clear and later restore state->pri.

Using and Writing Shaders, Thread Parallelism and Locks, page 357

mi_init_lock returns miBoolean, not void.

Index, page 715

The index is missing all API functions. Please download a revised index here:
full index, PDF
full index, PostScript

First Edition

Corrections

Introduction, WWW Resources, page 6

   

The correct FTP server name is ftp.mentalimages.com, not www.mentalimages.com.

Section 2.7.5, Lights, page 84

Below the scene examples, the second sentence should begin with "A rectangular area light is specified by two vectors that describe the lengths of the edges;". The vectors do not go from the center to the edge, which would make the area light source four times as large.

Chapter 3, Functions for Shaders

Most functions described as returning and accepting doubles actually return and accept miScalars. mi_cooktorr_specular returns miBoolean, not double.

Section 3.1, Output Shaders, page 197

The for(y) loop is lacking an opening brace, and also a corresponding closing brace just before the return statement.

Section 3.4.4, Intersection, page 154:

dot_nd is the dot product of the normal and the direction, not the negative dot product.

Section 3.10, Volume Shaders, page 181:

The parameter accesses in the code example should access paras->maxdist and paras->fogcolor, not state->maxdist and state->fogcolor.

Section 3.21.15, Callable Functions by Shader Type, page 276:

The function mi_tri_vectors cannot be used in displacement (D), lens (Le), and output (O) shaders because in these shaders there are no triangles to look up.

Appendix A, Scene File Grammar, page 435:

the data_bytes_list clause should recurse, not divert to tex_byte_list:

data_bytes_list :
                   | data_bytes_list T_BYTE_STRING
                                      { mi_api_data_byte_copy($2.len, $2.bytes); }

Additions that document later versions of mental ray and shaders

Section 3.21.2, RC Functions, page 223:

   

A new function mi_compute_directional_irradiance was introduced in mental ray 2.1.42.36.

miBoolean mi_compute_directional_irradiance(
    miColor *result,
    miState *state,
    miScalar r,
    miScalar g1,
    miScalar g2)

This is a generalization of mi_compute_volume_irradiance that calculates the volume irradiance obtained when the forward or backward scattering directions (measured with respect to the light ray direction) are preferred over sideways scattering. The parameters g1 and g2 are used to quantify two independent instances of these. Values between 0 and 1 specify forward scattering, while values between -1 and 0 specify backward scattering. A value of 0 indicates no preference, that is, diffuse scattering. The blending parameter r specifies to what extent the two choices should be (linearly) superimposed. For r = 0 only the choice with preferences specified by g2 contributes, while for r = 1 only the choice with preferences specified by g1 contributes. Commonly a positive choice for g1 is combined with a negative g2 and vice versa. Purely diffuse volume scattering may be computed more efficiently with mi_compute_volume_irradiance.