Here is a summary of some of the new features and feature improvements in version 3.6 of mental ray. Please refer to the release notes for more details and for other changes which are not mentioned here.
An assembly is a subscene attached to a bounding box, which is
loaded on demand when the bounding box is hit by a ray, or is
contained and not completely occluded in a rendering tile, if the
rasterizer is used. In cases of insufficient memory, assemblies are
unloaded automatically and reloaded the next time they are
required.
An assembly may contain all scene DAG elements, such as objects,
instances and groups, as well as textures, materials, shaders,
phenomena, lightprofiles and other scene elements. Lights and
cameras can be contained in an assembly, but they will be ignored
in the rendering process. An assembly can be created procedurally
as a result of geometry shadercall, or loaded from a .mi
file. See also Known Limitations.
A new BSP acceleration technique (BSP2) has been developed for efficient rendering of large BSP trees. The new technique does not require manual tuning for BSP traversal performance and memory consumption improvements. The memory requirements are much lower compared to the traditional BSP. Thus, the new BSP2 is recommended for rendering of large scenes, like those which do not fit into the physical memory of a machine, and scenes containing assemblies.
This completely new subdivision surface
implementation is based on a mixed triangle-quad
subdivision scheme. The new implementation is several times
faster than the previous one, at a reduced feature set
compared to the full hierarchical subdivision surface support. The
new code path is used for triangle-quad ccmesh
input
objects not containing features listed below:
ccmesh
.For objects containing containing one of the above features or
other types of approximations, the mental ray 3.5-based subdivision
surface implementation is used.
The following approximation types are supported by the new
implementation:
parametric
[fine] [view] length [min max]
See also Known Limitations.
Importons are "particles" similar to photons. However, they are shot from the camera and traverse the scene in the opposite order. Instead of "energy", they hold a quality which is an importance of the contribution to the final image. The information from importons is used by the kernel for distribution of rendering efforts according to the final contribution to the rendered image, i.e. so-called importance-driven sampling. Importons are thus a foundation for new view-dependent indirect illumination techniques. As a first of them, mental ray 3.6 adds an importance-driven photon map described below.
A new technique based on the importon map described above has been implemented. This technique is superior to the photon merging introduced in mental ray 3.5. If importons are enabled, they are used to control the density of the globillum photon maps and to improve the lookup time.
A native implementation of ambient occlusion has been added, which can be used by shaders to replace custom probe ray tracing solutions and benefit from advanced features like caching. See also Known Limitations.
MetaSL is a powerful shading language targeting current and future shading requirements. mental ray shading functionality has been extended to allow efficient support for the MetaSL shaders. It is possible to use a mixture of native and MetaSL shaders in the same scene. It is also possible to combine "native" software mental ray shaders and MetaSL shaders in a shader tree or in a mental ray Phenomena at rendering time. See also Known Limitations.
Added new finalgather mode "force", where finalgather map creation and interpolation will be disabled. A set of finalgather ray will be shot each time mi_compute_irradiance or mi_compute_avg_radiance is called. The rendering speed would be much slower than in other finalgather modes, delivering a superior image quality.
rgba
buffer named "diffuse" will have channels named "diffuse.R",
"diffuse.G", "diffuse.B" and "diffuse.A". If the camera is defined
with output
statements instead of the new
framebuffer
statements, then mental ray will
automatically assign names to the channels.The following changes were made in the .mi scene description syntax:
framebuffer "name" datatype "string" filtering boolean primary boolean user boolean filename "string" filetype "string" colorprofile "string" compression "string" quality "string" dod boolean dpi intThe new syntax replaces file output statements. The old syntax is still supported.
hair ... scalar [ <number of scalars> ] binary `<binary block of scalars>` hair [ <number of offsets> ] binary `<binary block of hair offsets>` ... end hair
assembly "assembly_name" box [minx miny minz maxx maxy maxz] [ motion box [minx miny minz maxx maxy maxz]] file "file_name" end assembly
The individual parameters are:
Assemblies files should contain a root statement at the end:
root "group_name"The group "group_name" would be attached to the main scene of the assembly.
"acceleration
bsp2"
option in the .mi file."rast
transparency depth"
and the corresponded
-rast_transparency_depth
to limit the depth
complexity. For high depth scenes this option may be used to
significantly improve performance without noticeable changes to the
rendered image.The following changes were made in the shader and integration interfaces.
Note: All shaders and integrations should be recompiled for mental ray version 3.6. Common data structures in the shader interface and integration API have been changed, especially with regard to assemblies. Shaders compiled for an earlier version of mental ray may crash without error indication if they access changed data structures in the shader interface.
miBoolean mi_api_framebuffer_add( miTag buffertag, char *datatypes, char *filetype, float *fileparams, char *filename);which should be used for the C-style framebuffer API. It is not using the new named frame buffers. The functions mi_api_output_file_parameter and mi_api_output_file_def are deprecated. The parser has been changed to use the new function. Here is an example how the new code should look like.
void camera_set_output( miCamera* camera, const char* datatype, /* like "+rgba" */ const char* filetype, /* like "tif" */ const char* filename) /* like "myfile.tif" */ { float file_options[8] = { 0.0f, // QUALITY [jpg] or COMPRESS [exr] 0.0f, // EVEN or ODD 0.0f, // spare 0.0f, // spare 0.0f, // DOD 0.0f, // spare 75f, // DPI 0.0f // spare }; mi_api_framebuffer_add( camera->buffertag, mi_mem_strdup(datatype), mi_mem_strdup(filetype), file_options, mi_mem_strdup(filename)); }
const char* bufferName = ...; if (bufferName) { mi::shader::Access_fb fb(state->camera->buffertag); size_t bufferIndex(0); if (fb->get_index(bufferName, bufferIndex)) { miUint index = (miUint) bufferIndex; mi_fb_put(state, index, ...); ... } } // invalidates scope of smart pointerFor integrations, here is an example for iterating through frame buffers.
miCamera* camera = ...; if (camera) { // print the filename of all framebuffers mi::shader::Access_fb fb(cam->buffertag); size_t n_fbs(0); fb->get_buffercount(n_fbs); for (miUint i=0; i < n_fbs; i++) { const char* bname; const char* filename; fb->get_buffername(i, bname); fb->get(bname, "filename", filename); mi_info("filename %s", filename); } } // invalidating the scope of the smart pointer if (camera) { // remove all framebuffers, and // create new primary frame buffer with file output mi::shader::Edit_fb fb(camera->buffertag); fb->reset(); // delete all buffers fb->set("first", "datatype", "rgba"); fb->set("first", "filtering", true); fb->set("first", "primary", true); fb->set("first", "filetype", "tif"); fb->set("first", "filename", "/tmp/image.tif"); ... } // invalidating the scope of the smart pointer
mi::shader::Interface* iface; mi_query(miQ_RAY_INTERFACE, state, 0, (void*)&iface); auto_ptr<MI::RAY::LightList> llist(iface->createLightList( state, state->normal, 0.5)); for (mi::shader::LightIterator light = llist->begin(); light != llist->end(); ++light) { while (light->sample()) { miColor c = light->get_contribution(); // ... } if (light->get_number_of_samples()) { // ... } }
This could be used for sampling lights from both sides of the surface without the state->pri=0 trick.
This option can be used for significant performance improvement for scenes with a high number of low intensity lights: the length of the light lists, and thus the number of light shader calls and shadow rays is reduced significantly at the price of a larger photon map.
The corresponding .mi syntax in the light section: photons only boolean.
miTRUE
or miFALSE
if the related
component is used or not.The following changes were made in mental ray 3.6 which are not backwards compatible or which may cause different results than previous versions of mental ray:
mi_api_framebuffer_add
should be used
instead. The original functions are still existing but don't
perform any operations.miState->pri_idx
, the index of triangle in
the sub-object box, is removed. With the changes done for assembly
support, the miState->pri
completely identifies a
primitive in a scene. Lightmap and some contour shaders should use
the new miQ_PRI_INDEX
query mode to obtain the
triangle index. Lightmap shaders should use the new
mi_state_set_pri
function to set the current triangle
index.mi_tri_vectors
, which should be
ignored.mi::shader:Interface
class now has the new
version 2. The new class is incompatible with the version 1 used in
mental ray 3.5. However, the interface version 1 is still supported
and can be obtained with mi_ray_interface_version
, so
mental ray 3.5 shader will not need a recompilation due to
this change..mi1
files) is no longer supported. The geometry will
be loaded correctly, but the texture spaces and other coordinate
systems may be wrong.miOptions
, the fields
rapid_shading_samples
, rapid_collect_rate
and rapid_motion_resample
are renamed to more
intuitive rast_shading_samples
,
rast_collect_rate
and
rast_motion_resample
respectively._setmode( _fileno(stdin), _O_BINARY)
.Copyright © 1986-2010 by mental images GmbH