#include <Material.h>
Public Member Functions | |
Material (const MS3DMaterial *material) | |
Initialize the Material using data from the corresponding Milkshape material. | |
const Color & | getAmbientColor () const |
Accessor for the ambient color. | |
const Color & | getDiffuseColor () const |
Accessor for the diffuse color. | |
const Color & | getSpecularColor () const |
Accessor for the specular color. | |
const Color & | getEmissiveColor () const |
Accessor for the emissive color. | |
float | getSpecularShininess () const |
Accessor for the specular factor. | |
bool | hasDetail () const |
Does this Material have a detail texture? | |
bool | hasBumpmap () const |
Does this Material have a bumpmap texture? | |
unsigned int | getDetailHandle () const |
Accessor for the Material detail texture handle. | |
unsigned int | getBumpmapHandle () const |
Accessor for the Material bumpmap texture handle. | |
unsigned int | getInvertedBumpmapHandle () const |
Accessor for the Material inverted bumpmap texture handle. | |
unsigned int | getNormalmapHandle () const |
Accessor for the Material normalmap texture handle. | |
Private Member Functions | |
Material (const Material ©) | |
Do not allow this Material to be copied. | |
Material & | operator= (const Material &rhs) |
Do not allow this Material to be copied. | |
void | initializeDetail (const Array3< unsigned char > &detailData) |
Initialize the m_detailHandle texture. | |
void | initializeBumpmap (const Array3< unsigned char > &bumpmapData) |
Initialize the m_bumpmapHandle texture. | |
void | initializeNormalmap (const Array3< unsigned char > &bumpmapData) |
Initialize the m_invertedBumpmapHandle texture. | |
Private Attributes | |
Color | m_ambient |
The ambient color of this Material. | |
Color | m_diffuse |
The diffuse color of this Material. | |
Color | m_specular |
The specular color of this Material. | |
Color | m_emissive |
The emissive color of this Material. | |
float | m_shininess |
The specular factor of this Material. | |
std::string | m_detailFileName |
The name of the file containing the detail texture. | |
std::string | m_bumpmapFileName |
The name of the file containing the bumpmap texture. | |
bool | m_hasDetail |
Does this material have a detail texture? | |
bool | m_hasBumpmap |
Does this material have a bumpmap texture? | |
unsigned int | m_detailHandle |
The handle to the detail texture. | |
unsigned int | m_bumpmapHandle |
The handle to the bumpmap (heightmap) texture. | |
unsigned int | m_invertedBumpmapHandle |
The handle to the inverted bumpmap (heightmap) texture. | |
unsigned int | m_normalmapHandle |
The handle to the normalmap texture. |
|
The handle to the bumpmap (heightmap) texture. Each RGB element in this texture represents the height of the corresponding texel in the detail texture. The texture is generated with 50% luminance (divides all R, G and B components by two) because, when the bumpmap textures are combined with the detail texture, the blending equation multiplies everything by two. |
|
The handle to the inverted bumpmap (heightmap) texture. Each RGB element in this texture represents the negative height of the corresponding texel in the bumpmap texture. The negative height is computed by subtracting the bumpmap height from 255. The texture is generated with 50% luminance (divides all R, G and B components by two) because, when the bumpmap textures are combined with the detail texture, the blending equation multiplies everything by two. |
|
The handle to the normalmap texture. Each RGB element in the normalmap texture corresponds to the perturbed normal vector extracted from a heightmap. The perturbed normal is computed by computing the cross product of two tangent vectors at each entry in the heightmap. The tangent vectors are computed as:
|