| VRS - The Virtual Rendering System |
| version 3.3 |
#include <vrs/material.h>

Public Member Functions | |
| Material (double Ka=0.2, double Kd=0.5, double Ks=0.0, double roughness=0.1, const Color &specularColor=Color::white, const Color &emissionColor=Color::black, bool distinguishFrontAndBackFaces=0) | |
| bool | operator== (const Material &other) const |
| void | setAmbient (double Ka, int side=0) |
| double | getAmbient (int side=0) const |
| Ka: ambient coefficient. | |
| void | setDiffuse (double Kd, int side=0) |
| double | getDiffuse (int side=0) const |
| Kd: diffuse coefficient. | |
| void | setSpecular (double Ks, int side=0) |
| double | getSpecular (int side=0) const |
| Ks: specular coefficient. | |
| void | setRoughness (double r, int side=0) |
| double | getRoughness (int side=0) const |
| r: the specular exponent. | |
| void | setSpecularColor (const Color &s, int side=0) |
| Color | getSpecularColor (int side=0) const |
| s: specular color. | |
| void | setEmissionColor (const Color &, int side=0) |
| Color | getEmissionColor (int side=0) const |
| Light emission of the surface. | |
| void | setDistinguishSides (bool onOff) |
| bool | getDistinguishSides () const |
| VRS_TYPEINFO (Material, MonoAttribute) | |
| VRS_SERIALIZABLE (Material) | |
| VRS::Material::Material | ( | double | Ka = 0.2, |
|
| double | Kd = 0.5, |
|||
| double | Ks = 0.0, |
|||
| double | roughness = 0.1, |
|||
| const Color & | specularColor = Color::white, |
|||
| const Color & | emissionColor = Color::black, |
|||
| bool | distinguishFrontAndBackFaces = 0 | |||
| ) |
For OpenGL, these coefficients are evaluated as follows (where color denotes the current ColorAttribute): ambient color = Ka * color diffuse color = Kd * color specular color = Ks * speccolor emission color = emiscolor shininess = roughness opacity = color[3] By default, front and back attributes are set to the same value.
| bool VRS::Material::operator== | ( | const Material & | other | ) | const |
| void VRS::Material::setAmbient | ( | double | Ka, | |
| int | side = 0 | |||
| ) |
| double VRS::Material::getAmbient | ( | int | side = 0 |
) | const [inline] |
Ka: ambient coefficient.
| void VRS::Material::setDiffuse | ( | double | Kd, | |
| int | side = 0 | |||
| ) |
| double VRS::Material::getDiffuse | ( | int | side = 0 |
) | const [inline] |
Kd: diffuse coefficient.
| void VRS::Material::setSpecular | ( | double | Ks, | |
| int | side = 0 | |||
| ) |
| double VRS::Material::getSpecular | ( | int | side = 0 |
) | const [inline] |
Ks: specular coefficient.
| void VRS::Material::setRoughness | ( | double | r, | |
| int | side = 0 | |||
| ) |
| double VRS::Material::getRoughness | ( | int | side = 0 |
) | const [inline] |
r: the specular exponent.
| void VRS::Material::setSpecularColor | ( | const Color & | s, | |
| int | side = 0 | |||
| ) |
| Color VRS::Material::getSpecularColor | ( | int | side = 0 |
) | const [inline] |
s: specular color.
| void VRS::Material::setEmissionColor | ( | const Color & | , | |
| int | side = 0 | |||
| ) |
| Color VRS::Material::getEmissionColor | ( | int | side = 0 |
) | const [inline] |
Light emission of the surface.
| void VRS::Material::setDistinguishSides | ( | bool | onOff | ) |
| bool VRS::Material::getDistinguishSides | ( | ) | const [inline] |
If the flag is not set, all of the above set-methods set the attributes for both sides.
| VRS::Material::VRS_TYPEINFO | ( | Material | , | |
| MonoAttribute | ||||
| ) |
| VRS::Material::VRS_SERIALIZABLE | ( | Material | ) |