Ocean
|
This class is the base class for all materials. More...
Public Member Functions | |
virtual RGBAColor | ambientColor () const |
Returns the ambient color of this material. More... | |
virtual RGBAColor | diffuseColor () const |
Returns the diffuse color of this material. More... | |
virtual RGBAColor | emissiveColor () const |
Returns the emissive color of this material. More... | |
virtual RGBAColor | specularColor () const |
Returns the specular color of this material. More... | |
virtual float | specularExponent () const |
Returns the specular exponent of this material with range [0.0, infinity). More... | |
virtual float | transparency () const |
Returns the transparency factor of this material with range [0.0, 1.0]. More... | |
virtual float | reflectivity () const |
Returns the reflectivity factor of this material with range [0.0, 1.0]. More... | |
virtual float | refractionIndex () const |
Returns the index of refraction of this material with range [0.0, 1.0]. More... | |
virtual void | get (RGBAColor &ambient, RGBAColor &diffuse, RGBAColor &emissive, RGBAColor &specular, float &specularExponent, float &transparency) |
Gets all color values of the material at once. More... | |
virtual bool | setAmbientColor (const RGBAColor &color) |
Sets the ambient color of the material. More... | |
virtual bool | setDiffuseColor (const RGBAColor &color) |
Sets the diffuse color of the material. More... | |
virtual bool | setEmissiveColor (const RGBAColor &color) |
Sets the emissive color of the material. More... | |
virtual bool | setSpecularColor (const RGBAColor &color) |
Sets the specular color of the material. More... | |
virtual bool | setSpecularExponent (const float specularExponent) |
Sets the specular exponent of this material with range [0.0, infinity). More... | |
virtual bool | setTransparency (const float transparency) |
Sets the transparency of the material. More... | |
virtual bool | setReflectivity (const float reflectivity) |
Sets the reflectivity of this material. More... | |
virtual bool | setRefractionIndex (const float index) |
Sets the index of refraction of this material. More... | |
virtual bool | set (const RGBAColor &ambient, const RGBAColor &diffuse, const RGBAColor &emissive, const RGBAColor &specular, const float specularExponent, const float transparency) |
Sets all color values of the material at once. More... | |
ObjectType | type () const override |
Returns the type of this object. More... | |
Public Member Functions inherited from Ocean::Rendering::Object | |
ObjectId | id () const |
Returns the unique object id of this object. More... | |
const std::string & | name () const |
Returns the name of this object. More... | |
virtual void | setName (const std::string &name) |
Sets or changes the name of this object. More... | |
virtual const std::string & | engineName () const =0 |
Returns the name of the owner engine. More... | |
ObjectRefs | parentObjects () const |
Returns all parent objects. More... | |
ObjectRefSet | parentNodes () const |
Returns all parent nodes. More... | |
virtual std::string | descriptiveInformation () const |
Returns descriptive information about the object as string. More... | |
Protected Member Functions | |
Material () | |
Creates a new material object. More... | |
~Material () override | |
Destructs a meterial object. More... | |
Protected Member Functions inherited from Ocean::Rendering::Attribute | |
Attribute () | |
Creates a new attribute object. More... | |
~Attribute () override | |
Destructs an attribute object. More... | |
Protected Member Functions inherited from Ocean::Rendering::Object | |
Object () | |
Creates a new object. More... | |
Object (const Object &object)=delete | |
Disabled copy constructor. More... | |
virtual | ~Object () |
Destructs an object. More... | |
Engine & | engine () const |
Returns the render engine which is owner of this object. More... | |
void | registerParent (const ObjectId parentId) |
Registers a parent node for this (child) node. More... | |
void | unregisterParent (const ObjectId parentId) |
Unregisters a parent node for this (child) node. More... | |
void | registerThisObjectAsParent (const ObjectRef &child) |
Registers this object at a child as parent object. More... | |
void | unregisterThisObjectAsParent (const ObjectRef &child) |
Unregisters this object from a child as parent. More... | |
Object & | operator= (const Object &object)=delete |
Disabled copy operator. More... | |
This class is the base class for all materials.
Each material is composed by different color components and appearance values:
Ambient color models light that is inherent in the global scene due to global illumination, (0.2, 0.2, 0.2) as default.
Diffuse color models light reflected on rough surfaces, (0.8, 0.8, 0.8) as default.
Emissive color enabled objects to seam self-luminous, (0.0, 0.0, 0.0) as default.
Specular color models light reflected on shiny surfaces, (0.0, 0.0, 0.0) as default.
Specular exponent models the sharpness of the reflection with range [0.0, infinity), 0.0 as default.
Transparency models transparent surfaces with range [0.0, 1.0], 0.0 (fully opaque) as default.
Use the material object to define the appearance of geometry nodes.
Each geometry node is associated with at most one material object.
The material object has to be inserted to an attribute set which itself is connected to the geometry node.
|
protected |
Creates a new material object.
|
overrideprotected |
Destructs a meterial object.
|
virtual |
Returns the ambient color of this material.
NotSupportedException | Is thrown if this function is not supported |
Reimplemented in Ocean::Rendering::GlobalIllumination::GIMaterial, and Ocean::Rendering::GLESceneGraph::GLESMaterial.
|
virtual |
Returns the diffuse color of this material.
NotSupportedException | Is thrown if this function is not supported |
Reimplemented in Ocean::Rendering::GlobalIllumination::GIMaterial, and Ocean::Rendering::GLESceneGraph::GLESMaterial.
|
virtual |
Returns the emissive color of this material.
NotSupportedException | Is thrown if this function is not supported |
Reimplemented in Ocean::Rendering::GlobalIllumination::GIMaterial, and Ocean::Rendering::GLESceneGraph::GLESMaterial.
|
virtual |
Gets all color values of the material at once.
ambient | Resulting ambient color of this material |
diffuse | Resulting diffuse color of this material |
emissive | Resulting emissive color of this material |
specular | Resulting specular color of this material |
specularExponent | Resulting specular exponent of this material with range [0.0, infinity) |
transparency | Resulting transparency factor of this material with range [0.0, 1.0] |
NotSupportedException | Is thrown if this function is not supported |
Reimplemented in Ocean::Rendering::GlobalIllumination::GIMaterial, and Ocean::Rendering::GLESceneGraph::GLESMaterial.
|
virtual |
Returns the reflectivity factor of this material with range [0.0, 1.0].
0.0 means no reflection, 1.0 means total reflection.
Beware: This parameter it used for global illumination and therefore not supported by most engines.
NotSupportedExcecption | Is thrown if this function is not supported |
Reimplemented in Ocean::Rendering::GlobalIllumination::GIMaterial.
|
virtual |
Returns the index of refraction of this material with range [0.0, 1.0].
The default value is 1 (as for standard for vacuum; water has 1.33, fused quartz glass has 1.46). Beware: This parameter it used for global illumination and therefore not supported by most engines.
NotSupportedExcecption | Is thrown if this function is not supported |
Reimplemented in Ocean::Rendering::GlobalIllumination::GIMaterial.
|
virtual |
Sets all color values of the material at once.
ambient | Ambient color to set |
diffuse | Diffuse color to set |
emissive | Emissive color to set |
specular | Specular color to set |
specularExponent | Specular exponent to set with range [0.0, infinity) |
transparency | Transparency factor to set with range [0.0, 1.0] |
NotSupportedException | Is thrown if this function is not supported |
Reimplemented in Ocean::Rendering::GlobalIllumination::GIMaterial, and Ocean::Rendering::GLESceneGraph::GLESMaterial.
|
virtual |
Sets the ambient color of the material.
color | Ambient color |
NotSupportedException | Is thrown if this function is not supported |
Reimplemented in Ocean::Rendering::GlobalIllumination::GIMaterial, and Ocean::Rendering::GLESceneGraph::GLESMaterial.
|
virtual |
Sets the diffuse color of the material.
color | Diffuse color |
NotSupportedException | Is thrown if this function is not supported |
Reimplemented in Ocean::Rendering::GlobalIllumination::GIMaterial, and Ocean::Rendering::GLESceneGraph::GLESMaterial.
|
virtual |
Sets the emissive color of the material.
color | Emissive color |
NotSupportedException | Is thrown if this function is not supported |
Reimplemented in Ocean::Rendering::GlobalIllumination::GIMaterial, and Ocean::Rendering::GLESceneGraph::GLESMaterial.
|
virtual |
Sets the reflectivity of this material.
0 means no reflection, 1 means total reflection.
Beware: This parameter it used for global illumination and therefore not supported by most engines.
reflectivity | Reflectivity factor of this material with range [0.0, 1.0] |
NotSupportedException | Is thrown if this function is not supported |
Reimplemented in Ocean::Rendering::GlobalIllumination::GIMaterial.
|
virtual |
Sets the index of refraction of this material.
The default value is 1 (as for standard for vacuum; water has 1.33, fused quartz glass has 1.46). Beware: This parameter it used for global illumination and therefore not supported by most engines.
index | Refraction index to be set with range [0.0, infinity) |
NotSupportedException | Is thrown if this function is not supported |
Reimplemented in Ocean::Rendering::GlobalIllumination::GIMaterial.
|
virtual |
Sets the specular color of the material.
color | Specular color |
NotSupportedException | Is thrown if this function is not supported |
Reimplemented in Ocean::Rendering::GlobalIllumination::GIMaterial, and Ocean::Rendering::GLESceneGraph::GLESMaterial.
|
virtual |
Sets the specular exponent of this material with range [0.0, infinity).
The higher the specular exponent value the sharper the reflection area.
specularExponent | Specular exponent |
NotSupportedException | Is thrown if this function is not supported |
Reimplemented in Ocean::Rendering::GlobalIllumination::GIMaterial, and Ocean::Rendering::GLESceneGraph::GLESMaterial.
|
virtual |
Sets the transparency of the material.
0.0 means fully opaque, 1.0 means fully transparent.
transparency | Transparency factor of the material with range [0.0, 1.0] |
NotSupportedException | Is thrown if this function is not supported |
Reimplemented in Ocean::Rendering::GlobalIllumination::GIMaterial, and Ocean::Rendering::GLESceneGraph::GLESMaterial.
|
virtual |
Returns the specular color of this material.
NotSupportedException | Is thrown if this function is not supported |
Reimplemented in Ocean::Rendering::GlobalIllumination::GIMaterial, and Ocean::Rendering::GLESceneGraph::GLESMaterial.
|
virtual |
Returns the specular exponent of this material with range [0.0, infinity).
The higher the specular exponent value the sharper the reflection area.
NotSupportedException | Is thrown if this function is not supported |
Reimplemented in Ocean::Rendering::GlobalIllumination::GIMaterial, and Ocean::Rendering::GLESceneGraph::GLESMaterial.
|
virtual |
Returns the transparency factor of this material with range [0.0, 1.0].
0.0 means fully opaque, 1.0 means fully transparent.
NotSupportedException | Is thrown if this function is not supported |
Reimplemented in Ocean::Rendering::GlobalIllumination::GIMaterial, and Ocean::Rendering::GLESceneGraph::GLESMaterial.
|
overridevirtual |
Returns the type of this object.
Reimplemented from Ocean::Rendering::Attribute.