#include <Material.h>

Public Member Functions | |
| Material () | |
| ~Material () | |
| void | texSetup () |
| set up the textures for this material | |
| void | surfaceSetup () |
| set up the surface parameters for this material | |
| unsigned int | getLayerSize () |
| get the number of layers used | |
| void | use () |
| use this material, called before a draw to setup this material | |
| void | bindTexture (unsigned short texLayer, cvrIndex texRefId, short tex_type) |
| bind texture to a specific layer of this material | |
| void | bindTexture (cvrIndex texRefId) |
| bind texture to last layer | |
| void | addLayer (unsigned short texLayer) |
| add a texture layer (specific) | |
| unsigned short | addLayer () |
| add a texture layer | |
| void | setAmbient (const RGBA &ambient_in) |
| set ambient color | |
| void | setDiffuse (const RGBA &diffuse_in) |
| set diffuse color | |
| void | setSpecular (const RGBA &specular_in) |
| set specular color | |
| void | setColor (const RGBA &color_in) |
| set color | |
| void | setShininess (float shininess_in) |
| set shininess, 0.0 .. 128.0 | |
| void | set (const RGBA &ambient_in, const RGBA &diffuse_in, const RGBA &specular_in, const RGBA &color_in, float shininess_in) |
| set all the above values at once | |
| void | setSidedness (unsigned short sidedness_in) |
| set whether to show front, back or both sides of faces with this material | |
| void | setMaxSmooth (float max_smooth_in) |
| set the maximum smoothing angle for the calculation of normals | |
| bool | hasMask () |
| has a transparency mask | |
| void | setReflective (float ref) |
| set reflectivity (environment map) application amount (0.0 - 1.0) | |
| void | colorMask (bool cmask_in) |
| set Material as transparent with black color mask | |
| bool | loadProgram (const char *vp, const char *fp) |
| bool | loadProgramFile (const char *vf, const char *ff) |
| bool | hasProgram () |
| void | useProgram () |
| void | setupProgram () |
| void | clearProgram () |
Static Public Member Functions | |
| static cvrIndex | create () |
| create a material and return a global material reference ID | |
| static cvrIndex | create (std::string mat_name) |
| create a material and return a global material reference ID | |
| static void | use (cvrIndex matNum) |
| use a global id, convenience routine for calling Material::materials[matNum].use(); | |
| static Material & | getMaterial (cvrIndex matNum) |
| Get a reference to a given material ID. | |
| static Material & | getMaterial (std::string mat_name) |
| static cvrIndex | getMaterialId (std::string mat_name) |
| static void | clear () |
| clear all materials | |
Public Attributes | |
| RGBA | ambient |
| RGBA | diffuse |
| RGBA | specular |
| RGBA | color |
| unsigned long | shader_mask |
| float | reflectivity |
| bool | color_mask |
| float | shininess |
| unsigned short | sidedness |
| float | max_smooth |
| bool | cached |
| unsigned int | dList |
| std::vector< MaterialLayer > | layer |
Static Public Attributes | |
| static std::vector< Material > | materials |
| global materials list, generate a global reference using the create() functions | |
| static std::map< std::string, cvrIndex, string_less > | nameref |
| name to global id reference, string map, nameref[name] will give you an ID | |
Static Private Member Functions | |
| static void | createNull () |
Private Attributes | |
| GLShader | program |
Static Private Attributes | |
| static MaterialInit | initializer = MaterialInit() |
Friends | |
| class | MaterialInit |
| Material::Material | ( | ) |
| Material::~Material | ( | ) |
| void Material::createNull | ( | ) | [static, private] |

| cvrIndex Material::create | ( | ) | [static] |
create a material and return a global material reference ID
| cvrIndex Material::create | ( | std::string | mat_name | ) | [static] |
create a material and return a global material reference ID

| void Material::use | ( | cvrIndex | matNum | ) | [static] |
use a global id, convenience routine for calling Material::materials[matNum].use();
| Material & Material::getMaterial | ( | cvrIndex | matNum | ) | [static] |
Get a reference to a given material ID.
| Material & Material::getMaterial | ( | std::string | mat_name | ) | [static] |
| cvrIndex Material::getMaterialId | ( | std::string | mat_name | ) | [static] |
| void Material::clear | ( | ) | [static] |
clear all materials
| void Material::texSetup | ( | ) |
set up the textures for this material

| void Material::surfaceSetup | ( | ) |
set up the surface parameters for this material
hasParallax = needs binormal/tangent for parallax
| unsigned int Material::getLayerSize | ( | ) |
get the number of layers used
| void Material::use | ( | ) |
use this material, called before a draw to setup this material

| void Material::bindTexture | ( | unsigned short | texLayer, | |
| cvrIndex | texRefId, | |||
| short | tex_type | |||
| ) |
bind texture to a specific layer of this material

| void Material::bindTexture | ( | cvrIndex | texRefId | ) |
bind texture to last layer

| void Material::addLayer | ( | unsigned short | texLayer | ) |
add a texture layer (specific)
| unsigned short Material::addLayer | ( | ) |
add a texture layer
| void Material::setAmbient | ( | const RGBA & | ambient_in | ) |
set ambient color
| void Material::setDiffuse | ( | const RGBA & | diffuse_in | ) |
set diffuse color
| void Material::setSpecular | ( | const RGBA & | specular_in | ) |
set specular color
| void Material::setColor | ( | const RGBA & | color_in | ) |
set color
| void Material::setShininess | ( | float | shininess_in | ) |
set shininess, 0.0 .. 128.0
| void Material::set | ( | const RGBA & | ambient_in, | |
| const RGBA & | diffuse_in, | |||
| const RGBA & | specular_in, | |||
| const RGBA & | color_in, | |||
| float | shininess_in | |||
| ) |
set all the above values at once

| void Material::setSidedness | ( | unsigned short | sidedness_in | ) |
set whether to show front, back or both sides of faces with this material
| void Material::setMaxSmooth | ( | float | max_smooth_in | ) |
set the maximum smoothing angle for the calculation of normals
| bool Material::hasMask | ( | ) |
has a transparency mask
| void Material::setReflective | ( | float | ref | ) |
set reflectivity (environment map) application amount (0.0 - 1.0)
| void Material::colorMask | ( | bool | cmask_in | ) |
set Material as transparent with black color mask
| bool Material::loadProgram | ( | const char * | vp, | |
| const char * | fp | |||
| ) |

| bool Material::loadProgramFile | ( | const char * | vf, | |
| const char * | ff | |||
| ) |

| bool Material::hasProgram | ( | ) |

| void Material::useProgram | ( | ) |

| void Material::setupProgram | ( | ) |

| void Material::clearProgram | ( | ) |

friend class MaterialInit [friend] |
IMPEXP MaterialInit Material::initializer = MaterialInit() [static, private] |
GLShader Material::program [private] |
| unsigned long Material::shader_mask |
| float Material::reflectivity |
| bool Material::color_mask |
| float Material::shininess |
| unsigned short Material::sidedness |
| float Material::max_smooth |
| bool Material::cached |
| unsigned int Material::dList |
std::vector< Material > Material::materials [static] |
global materials list, generate a global reference using the create() functions
std::map< std::string, cvrIndex, string_less > Material::nameref [static] |
name to global id reference, string map, nameref[name] will give you an ID
| std::vector<MaterialLayer> Material::layer |
1.5.6