Version 3.13
Version 3.13.1.0
January 12, 2015
The shader implements the following conventions to assign materials to individual
elements in the Alembic archive, which are not provided by Alembic itself.
To relate existing mental ray materials, a custom property
"material" with a string value can be specified on an object.
The shader looks up a material with that name in the main scene and, if found,
assigns it to the object in the mental ray scene.
As a special extension, if a property "adskDiffuseColor" of type
"color" is specified in the archive, the shader will auto-create a purely
diffuse BSDF with that value as the color, and assign this material to the
object.
declare data
geometry "abcimport" (
string "filename",
scalar "time" default -1.0,
boolean "assembly" default off,
string "select",
integer "fps" default 24,
integer "subdivisions" default 0,
boolean "facesetmaterials" default on
)
end declare
"/root/group/node" will load only the geometry of
that DAG sub-graph.
The shader requires that additional information is computed by mental ray.
This can be enabled either globally, using the registry setting
"{_MI_REG_CCMESH_PTEX}", or per object with the "bary" property.
The shader also needs texture differential information, unless used only for
displacement. For secondary rays, the mental ray "ray differentials" should
be turned on.
declare phenomenon
color
"mib_ptex_lookup" (
string "filename",
scalar "width" default 1.0,
scalar "blur" default 0.0,
integer "filtertype" default 4,
boolean "interpolate_level" default off,
scalar "filter_sharpness" default 1.0,
## these parameters are taken if face_index is >= 0
scalar "duv_dx_u" default 0.0,
scalar "duv_dx_v" default 0.0,
scalar "duv_dy_u" default 0.0,
scalar "duv_dy_v" default 0.0,
scalar "bary_v0x",
scalar "bary_v0y",
scalar "bary_v1x",
scalar "bary_v1y",
scalar "bary_v2x",
scalar "bary_v2y",
integer "face_index" default -1
)
end declare
declare shader
struct {
color "color",
scalar "alpha",
boolean "has_alpha"
}
"mib_ptex_lookup" (
string "filename",
scalar "width" default 1.0,
scalar "blur" default 0.0,
integer "filtertype" default 4,
boolean "interpolate_level" default off,
scalar "filter_sharpness" default 1.0,
## these parameters are taken if face_index is >= 0
scalar "duv_dx_u" default 0.0,
scalar "duv_dx_v" default 0.0,
scalar "duv_dy_u" default 0.0,
scalar "duv_dy_v" default 0.0,
scalar "bary_v0x",
scalar "bary_v0y",
scalar "bary_v1x",
scalar "bary_v1y",
scalar "bary_v2x",
scalar "bary_v2y",
integer "face_index" default -1
)
end declare
The shader returns a color value for 1-dimensional (scalar) textures with all
rgba components set to the same value. For 3-dimensional (color) textures,
color is set to the lookup value. For 4-dimensional textures, the
rgba color components are set accordingly. If a valid alpha channel
is specified, and in case of 1-dimensional textures, the return value
has_alpha is set to true and alpha contains
the lookup value.
This shader helps to use UV tiled texture mapping with mental ray. It implements common naming schemes of third-party tools, but also supports completely custom tile layouts.
declare shader
color texture
"mib_tiled_texture" (
integer "mode" default 0,
integer "utiles" default 10,
scalar "filter",
string "colorprofile",
vector "uvCoord",
string "texture_dir",
array struct "texture_info" {
string "filename",
vector "tile_coord"
}
)
end declare
texture_info array (0-based)
3.
The core utility shaders are contained in the coreutil library. The declaration of the shaders and phenomena can be found in the file voreutil.mi. To use the shaders, the declaration file must be included and the library linked:
link "coreutil.so" $include "coreutil.mi"