mental ray supports texture, bump, displacement and reflection mapping, all of which may be derived from an image file or procedurally defined using user-supplied shaders. Although there are various support functions provided by the mental ray shader interface, all these functions are fully implementable in shaders.
Procedural textures are computed by shaders, while image textures are read from image files. In practice, textures are a combination of both methods: a procedural texture shaders accepts an image texture parameter, which it accesses to read and filter pixels, and then modifies it according to other parameters to implement projections, scaling, cropping, replication, and other common operations on texture images. Purely procedural texture shaders that do not rely on texture images at all also exist, for example marble or cloud shaders. Some shaders use textures for special purposes; for example, a fur shader that computes hair in a volume might use a texture image to control the hair length or brushing direction.
The following table lists the file formats accepted by mental ray for reading texture image files:
format | description | color map |
compress | comp. | bits/comp. | extensions |
---|---|---|---|---|---|---|
rla rlb |
Wavefront image | - | RLE | 3, 4 | 8, 16 | color+z |
pic | Softimage image | - | RLE, - | 3, 4 | 8 | |
alias | Alias image | - | RLE | 3 | 8 | |
rgb | Silicon Graphics color | - | RLE, - | 3, 4 | 8 | |
jpg | JFIF image | - | JPEG | 3 | 8 | |
png | Portable Network Graphics | - | RLE, - | 3, 4 | 8 | |
yes | RLE, - | 3, 4 | 8 | |||
exr | OpenEXR | - | All | 1, 3, 4 | half, float | tiling layers pyramid |
tif* | TIFF image | - | RLE, Deflate | 1 | 1, 4, 8 | |
- | RLE, Deflate | 3, 4 | 8, 16, float | |||
yes | RLE, Deflate | 3, 4 | 4, 8 | |||
iff | Maya IFF image | - | RLE, - | 1, 3, 4 | 8, 16, float | tiling color+z |
picture | Dassault Systèmes PICTURE | - | RLE | 3 | 8 | |
hdr | Radiance RGBE | - | - | 4 | 8 | |
ppm | Portable pixmap | - | - | 3 | 8, 16 | |
tga | Targa image | - | RLE, - | 1, 3, 4 | 8 | |
- | RLE, - | 3 | 5 | |||
- | RLE, - | 4 | 5/1 | |||
yes | RLE, - | 3, 4 | 8 | |||
lwi | Solidworks texture (read-only) | - | RLE | 3 | 8 | |
bmp | MS Windows/OS2 bitmap | - | - | 3, 4 | 8 | |
yes | - | 3, 4 | 1, 4, 8 | |||
dds | DirectX texture | - | DXTn | 1, 3, 4 | 8, 16, float | |
qnt | Quantel/Abekas YUV image | - | YUV | 3 | 3 | |
ct* | mental images texture | - | - | 4 | 8, 16, float | |
st* | mental images alpha texture | - | - | 1 | 8, 16 | |
- | - | 1 | float | |||
vt wt |
mental images basis vectors | - | - | 2 | 16 | |
zt | mental images depth | - | - | 1 | float | |
nt mt |
mental images vectors | - | - | 3 | float | |
tt | mental images label (tag) | - | - | 1 | 32 | |
bit | mental images bit mask | - | - | 1 | 1 | |
map | memory mapped texture | - | - | any | any | pyramid |
remap (tiled) texture | - | - | any | any | tiling pyramid |
The extensions column informs about special support for file format features.
"diffuse"
,
"ambient"
, "transparency"
,
and so on. Each parameter may be assigned a static color such as "white",
or it may be attached to a texture shader. Even if the material shader was
never programmed to accept textures, the operations for which it has an
input parameter become controllable by a texture. In fact, it is possible
to build whole multi-level graphs of shaders using parameter assignment.
Shaders that do all the work internally are called
monolithic shaders, while shaders designed for
easy graph building are often called base shaders.
Determining the texture coordinates of a
point on a surface to be shaded requires defining a mapping from points on
the surface to points in texture space.
Such a mapping is itself referred to as a
texture space for the surface. Multiple texture spaces may be specified
for a surface. If the geometry is a polygon
or subdivision surface, a texture space
is created by associating texture vertices with the geometric vertices. If
the geometry is a free-form surface, a
texture space is created by associating a texture surface
with the surface. A texture surface is a free-form surface which defines the
mapping from the natural surface parameter space to texture space. Texture
maps, and therefore texture spaces and texture vertices, may be one, two, or
three dimensional.
Pyramid textures are a variant of
mip-map textures. When loading a texture
that is flagged for filtering, like with the filter property in the
scene description, mental ray
will build a hierarchy of different-resolution texture images that allow
elliptical filtering of texture samples. The map
texture file format may already contain such a pyramid, which can save a
lot of time and memory during rendering. Without filtering, distant textures
would be point-sampled at widely separated locations, missing the texture
areas between the samples, which causes texture aliasing. Texture filtering
attempts to project the screen pixel on the texture, which results in an
elliptic area on the texture. Pyramid textures allow sampling this ellipse
very efficiently, taking every pixel in the texture in the ellipse into
account without sampling each pixel. Pyramid textures are not restricted
to square and power-of-two resolutions, and work with any RGB or RGBA picture
file format. The shader can either rely on mental ray's texture projection
or specify its own. Filter blurriness can be adjusted per texture.
A procedural texture is free to use the texture space in any way it wants, but texture files are always defined to have unit size and to be repeated through all of texture space. That is, the lower-left corner of the file maps to (0.0, 0.0) in texture space, and again to (1.0, 0.0), (2.0, 0.0), and so on; the lower-right corner maps to (1.0, 0.0), (2.0, 0.0), etc. and the upper right to (1.0, 1.0), (2.0, 2.0), etc.
Copyright © 1986, 2015 NVIDIA ARC GmbH. All rights reserved.