Principal Classes for Materials and Textures
The following are the main classes associated with materials and textures.
- MtlBase - The base class for all materials and texture classes.
- Mtl - The base class for all material plug-ins.
- Texmap - The base class for procedural textures plug-ins.
- ShadeContext - Provides data members and methods used in communication between the renderer and
the plug-in material or texture. An instance of this class is passed into various
methods associated with materials and texture maps.
- RenderGlobalContext - Used by materials, texture maps, and other classes, to retrieve information about
the global rendering environment, such as the renderer in use, the project type for
rendering, the output device width and height, several matrices for transforming between
camera and world coordinates, the environment map, the atmospheric effects, the current
time, field rendering information, and motion blur information.
- IMtlParams - An interface class passed to a material or texture map when it is being edited
in the materials editor. The class has methods to do things such as add roll-up pages
to the dialog, remove rollup pages, and retrieve the current time (frame slider position).
- ParamDlg - Every MtlBase derived class (i.e. texture map and material) defines a ParamDlg to manage its part of the material editor user interface. See the topic on Editing Material and Texture Parameters for details on how this class is used.
- UVGen - Most texture maps that use UV-coordinate systems will use a UVGen. This class encapsulates a lot of the user interface for setting mirroring, tiling
and so on. The UVGen is given a MapSampler callback, and the plug-in lets the UVGen call it. This lets the UVGen figure out the components for anti-aliasing, and it includes any transform including
scaling, rotation, moving, and noise on the UVs.
- MapSampler - A texture map implements this class and passes it into the methods UVGen::EvalUVMap(), UVGen::EvalUVMapMono(), and UVGen::EvalDeriv() to evaluate itself with tiling & mirroring. Each of the methods of this class are
used to sample the map at a single UV coordinate.
- XYZGen - Generates Point3 coordinates based on the ShadeContext. A reference to one of these is referenced by all 3D texture maps. XYZGen does for 3D Texmaps what UVGen does for 2D Texmaps. It puts up the 3D "Coordinates" rollup, and supplies the 3D
Texmap with transformed 3D coordinates.
- TextureOutput - This class may be used by textures to provide control over their output. The standard
rollup page 'Output' is managed by this class. The Output Amount, RGB Level, and RGB
Offset are settable. In the future this may be enhanced to include other things that
are often desirable on the output stage such as tinting, color shifting, etc.
The following are the main classes associated with accessing properties of materials and textures:
- StdMat - Provides access to the parameters of the 3ds Max Standard material.
- MultiMtl - Provides access to the developer alterable properties of the 3ds Max Multi/Sub-Object
material.
- BitmapTex - Provides access to the parameters of the 3ds Max Bitmap texture.
- StdUVGen - Provides access to the parameters of the 3ds Max UVGen class. These are the settings
in the 'Coordinates' and 'Noise' rollups such as UV offsets, angle, blur, noise level,
etc.
- StdXYZGen - Provides access to the parameter of the 3ds Max XYZGen class.
- MtlBaseLib - Provides access to the materials stored in a materials library. See the sample
code in Accessing Material Libraries below for an example of use.