Here is a summary of some of the new features and feature improvements in version 3.7 of mental ray. Please refer to the release notes for more details and for other changes which are not mentioned here.
mental ray now supports shaders written in MetaSL language to be used for software rendering. This is handled by integrated support for automatic compilation and/or linking on the target platform, see MetaSL shaders.
The shader code generation is performed by so-called MetaSL back-ends. mental ray currently provides two back-end alternatives :
The C++ back-end is currently the default.
The .NET back-end is optional, because it has several known limitations in the current implementation. It is using the .NET Framework from Microsoft, version 2.0 or higher, available for all modern Windows platforms.
For shading trees defined in mental ray scene files, mental ray
supports a first version of shading tree
flattening. This operation allows to generate a
single final shader from a source shading tree or phenomenon by
resolving all parameter connections and compilation to a composite
shader. This is possible for shading trees or phenomena which
consist only of MetaSL shaders, i.e. not mixed with C/C++ shaders.
The flattening can be enabled by setting the
{_MI_REG_METASL_FLATTEN}
mental ray registry variable
to a non-empty value.
In the progressive rendering mode, the image is not rendered in tiles each at full sampling quality any more. Instead, few samples are placed sparsely over the full image initially and more samples are taken over time until a desired quality is reached. During rendering the image is available for display at any time which allows to implement interactive rendering applications with mental ray. This mode even works with the regular but slower DISP stream protocol that is used when connecting imf_disp to a running mental ray. Various options allow to tune either for faster response or better quality. The progressive rendering can be controlled to run endlessly until explicitly stopped by the user, or until a certain sampling quality or error threshold is reached.
This version of mental ray supports traditional mental ray shaders and the existing rendering algorithms like finalgathering (in particular, with progressive finalgather precomputation) and photon mapping. Future versions may provide further optimized and faster converging solutions fully based on importance sampling and BSDFs.
Progressive mode can be controlled from the command line and with scene options.
The final gathering algorithm has been improved to provide much faster early feedback which is progressively refining during the pre-computation phase, to support interactive rendering applications based on mental ray. The tile display ordering has been adjusted to match the tile order used during regular rendering, giving the impression of doing a single rendering that improves progressively. This mode can be combined with progressive rendering mode for best interactive behavior. It has no effect with "exact" final gathering.
The finalgather display during pre-computation gets enabled with
the -finalgather_display on
command line option or
with the miRENDER_DISPLAY_FG
bit in the rendering mode
mask. The pre-computation is now split into several passes, each
one refining the previous ones. Furthermore, it also respects the
order of tile computations specified with
mi_rc_set_taskorder()
function call.
The number of FG precomputation passes can be specified with the
string option "finalgather passes"
, or with the
command line option -finalgather_passes <int>
.
The default value is 3.
In the current implementation, the maximal value of finalgather passes is 8. Only 2 most recent one apply adaptivity in the raster sampling, the purpose of others is to provide progressive rendering report. I.e. for the number of passes larger or equal to 3 the final image does not change.
For compatibility with mental ray 3.7 and prior, the single pass
finalgather display can be enabled with the string option
"finalgather precomp legacy"
.
For final gathering, implemented a way to restrict finalgather map lookup to a specified subset of finalgather points. In particular, this feature may be used for rendering of objects with multiple semi-transparent surfaces where explicit separating of layers is more efficient than limiting interpolation distance or increasing the density of the finalgather map.
The miIrrad_options
structure passed to
mi_compute_avg_radiance()
function has been extended
with the integer field "id"
. The default value for id
is zero. The id is stored with each finalgather point. For
interpolation, the id passed to the interpolation call is taken
into account: if zero, all finalgather points are potentially
accepted. If non-zero, only finalgather points with the same id are
accepted.
Backwards and forwards binary compatibility of mental ray shaders and finalgather map files is maintained.
mental ray provides a built-in solution for image-based lighting (IBL) with optimized performance and quality. It works for regular scenes which have a camera environment shader installed, no matter if that shader takes color values from a texture image or generates them procedurally. mental ray is pre-sampling the environment and creating lookup acceleration data structures to support importance-driven adaptive sampling during the lighting computations in shaders. The illumination from the IBL is automatically added to all material shaders which perform regular light sampling.
The IBL mode can be controlled with scene options.
IBL can be used in progressive rendering mode.
This version adds a novel and alternative global illumination technique called Irradiance Particles (short: IP), which is in many cases superior to finalgather and/or photon mapping in terms of image quality, usability and performance. It is based on importons which are shot to the scene from the camera before rendering starts. Their hit positions with information on the amount of direct (and possibly indirect) illumination coming at their position (hence the name "irradiance particles") are combined into a map. Optionally, one or more passes of indirect illumination can be computed. By the nature of the algorithm, this computation is importance-driven. During rendering, Irradiance Particles are used to estimate the irradiance for every shading point: if just direct illumination was collected for irradiance particles, this is equivalent to one bounce of indirect lighting. Irradiance can also be interpolated from precomputed values found at nearby particle positions.
Support for built-in illumination models represented by a Bidirectional Scattering Distribution Function (BSDF, commonly known as BRDF for non-transmitting materials) has been added to mental ray. In the current version, mental ray provides the most common Lambert, Mirror, Phong and Ashikhmin BSDFs, as well as an Architectural BSDF to closely simulate the behavior of the respective advanced mental ray shader. More BRDF/BSDF standard models will follow in future versions.
With BSDF shaders, it is possible to omit photon shaders. For
materials with a BSDF shader but no photon shader specified mental
ray automatically uses the BSDF shader and use its
sample
function to simulate photon shader behavior.
For the future version, this fallback into BSDF will be enabled for
other indirect illumination techniques.
BSDFs may be split into up to 6 components (reflection and
refraction, with diffuse, glossy, and specular components each).
The eval
function evaluates all BSDF components, or a
subset thereof, for a pair of incoming and outgoing directions. The
Bsdf
interface also provides a sample
function, which allows importance sampling of outgoing directions
for a given incoming direction. In addition, this function provides
information about the sampled component and the sample weight. The
latter can easily be combined with Russian roulette for absorption,
which could be used e.g. for writing photon shaders.
A BSDF shader may be attached as material shader into
miMaterial
. In this case, mental ray takes care of
simulating a material shader based on the BSDF.
An instance of a BSDF shader with given parameters may be specified with the usual shader syntax. Input parameters of a BSDF shader can be specified as the result of other shaders, allowing conventional shading trees and phenomena to be used.
Initial support for generalized Map containers has been added. Maps are particle systems in N dimensional space. Each particle has a position and set data assigned.
mental ray provides functionality for creating, accessing and
editing of Maps, as well as loading them from files and saving them
to files. An efficient nearest neighbor lookup functionality is
implemented, utilizing either euclidean distance or arbitrary
distance functor provided by user. The distance functor may
implement rejections by returning the miHUGE_SCALAR
value.
Particle data may be any structure consisting of the common types including scalars, integers, vectors, colors and transforms. All particles in a single map have identical layout. The position of a particle is an N-dimensional float vector, where N varies in range from 1 to 6 in the current implementation.
In this version, Maps need to be created or loaded by applications or geometry shaders. Tutorials are added to mental ray releases.
Implemented adaptive tessellation for Catmull-Clark meshes. Each region can now have a different refinement level. t-vertices with neighbor regions having different refinement levels are fixed with triangle fans. Positions are always computed on the limit surface.
For the Catmull-Clark meshes, improved texture seams quality by implementing spline-rule evaluation.
Added approximation for hair. In addition to the old approximation syntax which directly specifies the number of approximating segments, it is now possible to specify adaptive length, distance, angle approximation including view-dependent approximations. Parametric approximations depending on the degree of the hair curves are supported as well.
Especially for curved hair and hair at higher viewing distance, the new approximation criterion allows to have high approximation resolution restricted to the area where needed. The lower number of hair segments result in reduced memory consumption and increase rendering speed.
In order to get benefit from curvature-dependent approximations, hair needs to be modelled appropriately with hair degree > 1.
For moving polygonal objects with displacement, added functionality to automatically control the quality of displacement according to the amount of visual motion. For fast moving objects, images with comparable visual quality may be achieved with fewer displacement tessellation details compared to static or slow moving objects. Though it is also possible to tweak displacement approximation on a per-object basis, this would require a lot of manual efforts and is rarely done in practice. Per-object granularity may also be not fine enough for object having different amount of motion in different parts. The new approximation motion factor provides an automatic way for adjusting the displacement quality according to the amount of motion for a given object part.
For view-dependent fine poly displacement the adaptive subdivision checks motion length in screen space. The measured motion length is used to modify the use of the approximation constant. Geometry is reduced only in areas of the object with strong motion.
A new option can be used to modify the amount of geometry reduction compared to static case. The feature is enabled by default at a rather conservative setting, which reduces displacement quality only for very fast moving objects.
For OpenEXR textures, added ability to use display window. If
the registry setting _MI_OPENEXR_WINDOW
is set to
"display" (in contrast to "data"), then the OpenEXR display window
will be used. Note that display window is not compatible with
mipmap pyramids for filtered local textures.
The OpenEXR version as been updated to 1.6.1.
OpenEXR library is linked statically. On an attempt to link
mi_openexr.dll
, a warning message is printed.
Added IPv6 support for mental ray multi-hosting rendering. In
the .rayhosts
file, as well as on the command line,
IPv6 addresses may be specified. Host names and IPv4 addresses are
still supported. IPv6 addresses need to be put into the ][
]
brackets following common URL convention. Note that if
slave host is specified on the command line, the [ ]
brackets may need encapsulation depending on the shell used.
mental ray master host tries to establish connections to slaves using either TCP or TCPv6 protocol, whatever is available and applicable to a slave host (if a slave host is given by name, both TCP and TCPv6 protocols are tried out, the order depends on operating system used and OS configuration).
Added IPv6 support for the socket layer of mental ray DISP
protocol (immediate display of tiles as they rendered). mental ray
would listen for connections done with either TCP or TCPv6 on the
same port id. The imf_disp
tool would try to get the
connection with any of TCPv6 and TCP protocols.
The following changes were made in the .mi scene description syntax:
bsdf
keyword,
allowing to specify the BSDF shader in the material. An instance of
a BSDF shader with given parameters may be specified with the usual
shader syntax. Input parameters of a BSDF shader can be specified
as the result of other shaders, allowing conventional shading trees
and phenomena to be used.declare map "name" [ dim int , ] parameter1, ... parameter end declarewith each of parameters being one of
integer "parname" scalar "parname" vector "parname" color "parname" transform "parname" array int integer "parname" array int scalar "parname"The allowed parameter types are 32-bit integers, single precision floats, float 3d vectors, 4 component float colors and 4x4 float matrices, as well as fixed size arrays of integers and floats.
map "mapname" "layout" ( ["mapfile1", ... "mapfileN"] ) end map map "mapname" "layout" ( { <rec1field1>, ... , <rec1fieldM> }, ...., { <recKfield1>, ... , <recKfieldM> } ) end mapi.e., either a list of file names containing binary map data is specified, or the list of fields for each particles in the map. Each recSfieldT entry should consist of the proper number of space separated float or integer values. The first record in each row should be N floats corresponding to the position of a particle in the N-dimensional map.
map
type has been added to the list of legal
shader parameter types, following usual conventions. However, a Map
cannot be an output of a shader.approximate hair <curve_approx>with
<curve_approx
> being any curve
approximation technique, for example:
approximate hair view length 3 distance 0.1 angle 5 0 7
"geom
displace motion factor" f
used to modify the amount of
geometry reduction compared to static case. A factor of
f=0
turns off the feature. The factor f=1
is the current default to achieve a reasonable compromise between
quality and speed. Higher values of f
give more
reduction. The current default value is rather conservative: the
simplification of geometry will have an effect for motion of
approximately 16 pixels. In order to get effect on slower motion,
higher values should be used. For example, the factor value of 8
would reduce geometry in areas of objects moving at the speed of 2
pixels per frame."importon emitted"
. If
specifies the total number of importons to emit and overrides the
"importon density"
string option. The options are
similar, but "importon emitted"
specifies the value
which is independent of the image resolution and thus is better for
tuning.rename "target" "source"This function may be used to rename existing scene entities. See the related API function for further details.
triangle
estimate <int>
" to the .mi syntax. This field may be
set by a translator or exporter and give approximate number of
triangles expected for the given object. CAD application frequently
would know the precise number, but even if it is know only up to an
order of magnitude it is advisable to provide it. In the future
versions, mental ray will use it as a hint for optimizing
performance and memory usage."fine shared"
, "fine
nosmoothing"
, and "fine shared nosmoothing"
.
The registry key _MI_REG_SHARED_DISPLACEMENT
which
could be used to enabled the "shared" mode globally for all objects
is deprecated, but could be used in mental ray 3.7
for compatibility reasons.miMaterial
structure has been extended with a
bsdf
slot, which may specify an instance of an
optional BSDF shader.mi::shader::Access_bsdf
class.
The API for interaction with BSDFs is declared in the new
shader_bsdf.h
header file. It is described in the
doxygen documentation in the manual.builtin_bsdf_architectural
and
builtin_bsdf_mirror
BSDFs. The
builtin_bsdf_architectural
is a simplification of the
architectural material, containing the parameters relevant for the
material properties. The builtin_bsdf_mirror
is a
simple specular reflection, which multiplies the reflected color
with the reflection
parameter.builtin_bsdf_architectural
, but the declaration
follows those of the architectural material. This BSDF may be used
to minimize changes to the existing scenes and translators using
the architectural material.mi_api_map_*
functions family.mi_api_rename(char *target, char *source)to rename existing scene entities without recreating them. In particular this may be used by application interface to follow user interaction. The function has following limitations:
miObject::tri_est
, to
provide an estimate of triangulation counts. See scene syntax description for more
details.miAPPROX_STYLE_FINE_NO_SMOOTHING_CONT_DISP
value has been added to the miApprox_style
enumeration.mi_rc_run
now returns to the application in one second
and does not wait until all rendering threads are blocked. The
rendering threads are still blocked on memory or database
operations, possibly after mi_rc_run
returns. Previous
synchronous mode where mi_rc_run
returned first after
all threads get blocked was less robust: threads blocked on
internal locks were not counted, which resulted in a possible
application freeze.mi_query
mode miQ_STAGE
.miBoolean
, which is typedefed to int.unsigned
.miMaterial
structure has been extended with bsdf
slot.miHair_list
structure has been
extended with approximation. Unused integer approximation has been
removed.mi_shader_if.h
header file now
include several partial header files according to the features if
the mi::shader::Interface
class. Shader writers are
still supposed to include the mi_shader_if.h
file into
the shader C++ files.mi::shader_v3
namespace. A namespace alias for
mi::shader
is added, so that no changes to the shader
code are required. Shader writers are expected to continue to use
the mi::shader
namespace. This fixes possible crashes
(mismatched symbol linkage) in debug shader libraries using
different versions of mi::shader::Access_fb
or
Edit_fb
classes from different versions in the same
rendering.mi::shader::Interface
version has been
increased to 3. Shaders compiled for mental ray 3.7 alpha versions
need to be recompiled. Shaders compiled for mental ray 3.6/3.6+
keep the limited binary compatibility with mental ray 3.7 over the
mi::shader::Interface
version 2.miGeoBox
structure.Copyright © 1986-2010 by mental images GmbH