IMaterial
Functions
Detailed Description
-
class
IMaterial
: public RED::IREDObject Material interface for material manipulation.
The ART::IMaterial interface gives access to the material object for geometries and plants.
A realistic material is defined by several properties:
- diffuse;
- transmission (transparency/opacity);
- reflectance;
- bump;
- back diffuse (not for geometries);
- translucency (not for geometries);
- IOR;
- glossiness.
A PBR material is defined by several other properties:
- albedo;
- roughness;
- metalness;
- bump;
- ao.
The PBR material is intended to provide a physical description for opaque elements. The realistic material can provide a description for opaque and transparent elements.
For each of these properties, this interface allows to:
- set the value, color or texture;
- set the UV transform matrix;
- set the texture wrap mode (repeat or clamp);
- set the texture coordinates mesh channel.
According to the material properties, the mesh is rendered following a specific pipeline: opaque, transparent, masked and double sided or emissive.
Public Functions
-
SET_CID
(CID_class_ARTIMaterial)
-
virtual void
SetType
(ART::MATERIAL_TYPE iType) = 0 Sets the material type.
Realistic material uses channels:
- Diffuse
- Transmission
- Reflectance
- Bump
- Back diffuse
- Translucency
- IOR
- Glossiness
PBR metallic material uses channels:
- Albedo
- Roughness
- Metalness
- Transmission
- Bump
- AO
Emissive material uses channels:
- Emissive
Parameters: iType – material type.
-
virtual ART::MATERIAL_TYPE
GetType
() const = 0 Gets the material type.
Returns: the material type.
-
virtual void
SetDiffuse
(const RED::Color &iDiffuse) = 0 Sets the diffuse color.
If the material has a diffuse texture, the diffuse color is ignored.
Parameters: iDiffuse – diffuse color.
-
virtual const RED::Color &
GetDiffuse
() const = 0 Gets the diffuse color.
If the material has a diffuse texture, the diffuse color is ignored.
Returns: the diffuse color.
-
virtual void
SetDiffuseTexture
(const RED::Object *iTexture) = 0 Sets the diffuse texture.
Parameters: iTexture – diffuse texture.
-
virtual const RED::Object *
GetDiffuseTexture
() const = 0 Gets the diffuse texture.
Returns: the diffuse texture or NULL if is doesn’t exist.
-
virtual void
SetDiffuseWrap
(bool iRepeatU, bool iRepeatV) = 0 Sets the diffuse wrap mode.
Parameters: - iRepeatU – true to have the texture repeat along U, false if clamped.
- iRepeatV – true to have the texture repeat along V, false if clamped.
-
virtual void
GetDiffuseWrap
(bool &oRepeatU, bool &oRepeatV) const = 0 Gets the diffuse wrap mode.
Parameters: - oRepeatU – returned true if the diffuse texture repeats along U, false if it is clamped.
- oRepeatV – returned true if the diffuse texture repeats along V, false if it is clamped.
-
virtual void
SetTransmission
(double iTransmission) = 0 Sets the transmission value.
If the material has a transmission texture, the transmission value is ignored.
A value of 0 is fully opaque whereas a value of 1 is fully transparent.
Parameters: iTransmission – transmission value.
-
virtual double
GetTransmission
() const = 0 Gets the transmission value.
If the material has a transmission texture, the transmission value is ignored.
A value of 0 is fully opaque whereas a value of 1 is fully transparent.
Returns: the transmission value.
-
virtual void
SetTransmissionTexture
(const RED::Object *iTexture) = 0 Sets the transmission texture.
A value of 0 is fully opaque whereas a value of 1 is fully transparent.
Parameters: iTexture – transmission texture.
-
virtual const RED::Object *
GetTransmissionTexture
() const = 0 Gets the transmission texture.
A value of 0 is fully opaque whereas a value of 1 is fully transparent.
Returns: the transmission texture or NULL if is doesn’t exist.
-
virtual void
SetTransmissionWrap
(bool iRepeatU, bool iRepeatV) = 0 Sets the transmission wrap mode.
Parameters: - iRepeatU – true to have the texture repeat along U, false if clamped.
- iRepeatV – true to have the texture repeat along V, false if clamped.
-
virtual void
GetTransmissionWrap
(bool &oRepeatU, bool &oRepeatV) const = 0 Gets the transmission wrap mode.
Parameters: - oRepeatU – returned true if the transmission texture repeats along U, false if it is clamped.
- oRepeatV – returned true if the transmission texture repeats along V, false if it is clamped.
-
virtual void
SetReflectance
(double iReflectance) = 0 Sets the reflectance value.
If the material has a reflectance texture, the reflectance value is ignored.
A value of 0 is fully mat whereas a value of 1 is fully reflective.
Parameters: iReflectance – reflectance value.
-
virtual double
GetReflectance
() const = 0 Gets the reflectance value.
If the material has a reflectance texture, the reflectance value is ignored.
A value of 0 is fully mat whereas a value of 1 is fully reflective.
Returns: the reflectance value.
-
virtual void
SetReflectanceTexture
(const RED::Object *iTexture) = 0 Sets the reflectance texture.
A value of 0 is fully mat whereas a value of 1 is fully reflective.
Parameters: iTexture – reflectance texture.
-
virtual const RED::Object *
GetReflectanceTexture
() const = 0 Gets the reflectance texture.
A value of 0 is fully mat whereas a value of 1 is fully reflective.
Returns: the reflectance texture or NULL if is doesn’t exist.
-
virtual void
SetReflectanceWrap
(bool iRepeatU, bool iRepeatV) = 0 Sets the reflectance wrap mode.
Parameters: - iRepeatU – true to have the texture repeat along U, false if clamped.
- iRepeatV – true to have the texture repeat along V, false if clamped.
-
virtual void
GetReflectanceWrap
(bool &oRepeatU, bool &oRepeatV) const = 0 Gets the reflectance wrap mode.
Parameters: - oRepeatU – returned true if the reflectance texture repeats along U, false if it is clamped.
- oRepeatV – returned true if the reflectance texture repeats along V, false if it is clamped.
-
virtual void
SetBumpTexture
(const RED::Object *iTexture) = 0 Sets the bump texture.
The bump texture is a normal map containing 3D vector data.
Parameters: iTexture – bump texture.
-
virtual const RED::Object *
GetBumpTexture
() const = 0 Gets the bump texture.
The bump texture is a normal map containing 3D vector data.
Returns: the bump texture or NULL if is doesn’t exist.
-
virtual void
SetBumpWrap
(bool iRepeatU, bool iRepeatV) = 0 Sets the bump wrap mode.
Parameters: - iRepeatU – true to have the texture repeat along U, false if clamped.
- iRepeatV – true to have the texture repeat along V, false if clamped.
-
virtual void
GetBumpWrap
(bool &oRepeatU, bool &oRepeatV) const = 0 Gets the bump wrap mode.
Parameters: - oRepeatU – returned true if the bump texture repeats along U, false if it is clamped.
- oRepeatV – returned true if the bump texture repeats along V, false if it is clamped.
-
virtual void
SetBackDiffuse
(const RED::Color &iBackDiffuse) = 0 Sets the back diffuse color.
If the material has a back diffuse texture, the back diffuse color is ignored.
Parameters: iBackDiffuse – back diffuse color.
-
virtual const RED::Color &
GetBackDiffuse
() const = 0 Gets the back diffuse color.
If the material has a back diffuse texture, the back diffuse color is ignored.
Returns: the back diffuse color.
-
virtual void
SetBackDiffuseTexture
(const RED::Object *iTexture) = 0 Sets the back diffuse texture.
Parameters: iTexture – back diffuse texture.
-
virtual const RED::Object *
GetBackDiffuseTexture
() const = 0 Gets the back diffuse texture.
Returns: the back diffuse texture or NULL if is doesn’t exist.
-
virtual void
SetBackDiffuseWrap
(bool iRepeatU, bool iRepeatV) = 0 Sets the back diffuse wrap mode.
Parameters: - iRepeatU – true to have the texture repeat along U, false if clamped.
- iRepeatV – true to have the texture repeat along V, false if clamped.
-
virtual void
GetBackDiffuseWrap
(bool &oRepeatU, bool &oRepeatV) const = 0 Gets the back diffuse wrap mode.
Parameters: - oRepeatU – returned true if the back diffuse texture repeats along U, false if it is clamped.
- oRepeatV – returned true if the back diffuse texture repeats along V, false if it is clamped.
-
virtual void
SetTranslucency
(double iTranslucency) = 0 Sets the translucency color.
If the material has a translucency texture, the translucency color is ignored.
Parameters: iTranslucency – translucency color.
-
virtual double
GetTranslucency
() const = 0 Gets the translucency color.
If the material has a translucency texture, the translucency color is ignored.
Returns: the translucency color.
-
virtual void
SetTranslucencyTexture
(const RED::Object *iTexture) = 0 Sets the translucency texture.
Parameters: iTexture – translucency texture.
-
virtual const RED::Object *
GetTranslucencyTexture
() const = 0 Gets the translucency texture.
Returns: the translucency texture or NULL if is doesn’t exist.
-
virtual void
SetTranslucencyWrap
(bool iRepeatU, bool iRepeatV) = 0 Sets the translucency wrap mode.
Parameters: - iRepeatU – true to have the texture repeat along U, false if clamped.
- iRepeatV – true to have the texture repeat along V, false if clamped.
-
virtual void
GetTranslucencyWrap
(bool &oRepeatU, bool &oRepeatV) const = 0 Gets the translucency wrap mode.
Parameters: - oRepeatU – returned true if the translucency texture repeats along U, false if it is clamped.
- oRepeatV – returned true if the translucency texture repeats along V, false if it is clamped.
-
virtual void
SetIOR
(double iIOR) = 0 Sets the index of refraction.
Parameters: iIOR – index of refraction between 0 and 10.
-
virtual double
GetIOR
() const = 0 Gets the index of refraction.
Returns: the index of refraction of the material.
-
virtual void
SetIORTexture
(const RED::Object *iTexture) = 0 Gets the index of refraction texture.
Parameters: iTexture – IOR texture.
-
virtual const RED::Object *
GetIORTexture
() const = 0 Gets the index of refraction texture.
Returns: the IOR texture or NULL if is doesn’t exist.
-
virtual void
SetIORWrap
(bool iRepeatU, bool iRepeatV) = 0 Sets the index of refraction wrap mode.
Parameters: - iRepeatU – true to have the texture repeat along U, false if clamped.
- iRepeatV – true to have the texture repeat along V, false if clamped.
-
virtual void
GetIORWrap
(bool &oRepeatU, bool &oRepeatV) const = 0 Gets the index of refraction wrap mode.
Parameters: - oRepeatU – returned true if the translucency texture repeats along U, false if it is clamped.
- oRepeatV – returned true if the translucency texture repeats along V, false if it is clamped.
-
virtual void
SetGlossiness
(double iGlossiness) = 0 Sets the glossiness.
Parameters: iGlossiness – glossiness of the material between 0 and 1.
-
virtual double
GetGlossiness
() const = 0 Gets the glossiness.
Returns: the glossiness of the material.
-
virtual void
SetGlossinessTexture
(const RED::Object *iTexture) = 0 Gets the glossiness texture.
Parameters: iTexture – glossiness texture.
-
virtual const RED::Object *
GetGlossinessTexture
() const = 0 Gets the glossiness texture.
Returns: the glossiness texture or NULL if is doesn’t exist.
-
virtual void
SetGlossinessWrap
(bool iRepeatU, bool iRepeatV) = 0 Sets the glossiness wrap mode.
Parameters: - iRepeatU – true to have the texture repeat along U, false if clamped.
- iRepeatV – true to have the texture repeat along V, false if clamped.
-
virtual void
GetGlossinessWrap
(bool &oRepeatU, bool &oRepeatV) const = 0 Gets the glossiness wrap mode.
Parameters: - oRepeatU – returned true if the translucency texture repeats along U, false if it is clamped.
- oRepeatV – returned true if the translucency texture repeats along V, false if it is clamped.
-
virtual void
SetAlbedo
(const RED::Color &IAlbedo) = 0 Sets the albedo color.
If the material has an albedo texture, the albedo color is ignored.
Parameters: iAlbedo – albedo color.
-
virtual const RED::Color &
GetAlbedo
() const = 0 Gets the albedo color.
If the material has an albedo texture, the albedo color is ignored.
Returns: the diffuse color.
-
virtual void
SetAlbedoTexture
(const RED::Object *iTexture) = 0 Sets the albedo texture.
Parameters: iTexture – albedo texture.
-
virtual const RED::Object *
GetAlbedoTexture
() const = 0 Gets the albedo texture.
Returns: the albedo texture or NULL if is doesn’t exist.
-
virtual void
SetAlbedoWrap
(bool iRepeatU, bool iRepeatV) = 0 Sets the albedo wrap mode.
Parameters: - iRepeatU – true to have the texture repeat along U, false if clamped.
- iRepeatV – true to have the texture repeat along V, false if clamped.
-
virtual void
GetAlbedoWrap
(bool &oRepeatU, bool &oRepeatV) const = 0 Gets the albedo wrap mode.
Parameters: - oRepeatU – returned true if the albedo texture repeats along U, false if it is clamped.
- oRepeatV – returned true if the albedo texture repeats along V, false if it is clamped.
-
virtual void
SetRoughness
(double iRoughness) = 0 Sets the roughness value.
If the material has a roughness texture, the roughness value is ignored.
Parameters: iRoughness – roughness value.
-
virtual double
GetRoughness
() const = 0 Gets the roughness value.
If the material has a roughness texture, the roughness value is ignored.
Returns: the transmission value.
-
virtual void
SetRoughnessTexture
(const RED::Object *iTexture) = 0 Sets the roughness texture.
Parameters: iTexture – roughness texture.
-
virtual const RED::Object *
GetRoughnessTexture
() const = 0 Gets the roughness texture.
Returns: the roughness texture or NULL if is doesn’t exist.
-
virtual void
SetRoughnessWrap
(bool iRepeatU, bool iRepeatV) = 0 Sets the roughness wrap mode.
Parameters: - iRepeatU – true to have the texture repeat along U, false if clamped.
- iRepeatV – true to have the texture repeat along V, false if clamped.
-
virtual void
GetRoughnessWrap
(bool &oRepeatU, bool &oRepeatV) const = 0 Gets the roughness wrap mode.
Parameters: - oRepeatU – returned true if the roughness texture repeats along U, false if it is clamped.
- oRepeatV – returned true if the roughness texture repeats along V, false if it is clamped.
-
virtual void
SetMetalness
(double iMetalness) = 0 Sets the metalness value.
If the material has a metalness texture, the metalness value is ignored.
Parameters: iRoughness – roughness value.
-
virtual double
GetMetalness
() const = 0 Gets the metalness value.
If the material has a metalness texture, the metalness value is ignored.
Returns: the transmission value.
-
virtual void
SetMetalnessTexture
(const RED::Object *iTexture) = 0 Sets the metalness texture.
Parameters: iTexture – metalness texture.
-
virtual const RED::Object *
GetMetalnessTexture
() const = 0 Gets the metalness texture.
Returns: the metalness texture or NULL if is doesn’t exist.
-
virtual void
SetMetalnessWrap
(bool iRepeatU, bool iRepeatV) = 0 Sets the metalness wrap mode.
Parameters: - iRepeatU – true to have the texture repeat along U, false if clamped.
- iRepeatV – true to have the texture repeat along V, false if clamped.
-
virtual void
GetMetalnessWrap
(bool &oRepeatU, bool &oRepeatV) const = 0 Gets the metalness wrap mode.
Parameters: - oRepeatU – returned true if the metalness texture repeats along U, false if it is clamped.
- oRepeatV – returned true if the metalness texture repeats along V, false if it is clamped.
-
virtual void
SetAO
(double iAO) = 0 Sets the AO value.
If the material has a AO texture, the AO value is ignored.
Parameters: iRoughness – roughness value.
-
virtual double
GetAO
() const = 0 Gets the AO value.
If the material has a AO texture, the AO value is ignored.
Returns: the transmission value.
-
virtual void
SetAOTexture
(const RED::Object *iTexture) = 0 Sets the AO texture.
Parameters: iTexture – AO texture.
-
virtual const RED::Object *
GetAOTexture
() const = 0 Gets the AO texture.
Returns: the AO texture or NULL if is doesn’t exist.
-
virtual void
SetAOWrap
(bool iRepeatU, bool iRepeatV) = 0 Sets the AO wrap mode.
Parameters: - iRepeatU – true to have the texture repeat along U, false if clamped.
- iRepeatV – true to have the texture repeat along V, false if clamped.
-
virtual void
GetAOWrap
(bool &oRepeatU, bool &oRepeatV) const = 0 Gets the AO wrap mode.
Parameters: - oRepeatU – returned true if the AO texture repeats along U, false if it is clamped.
- oRepeatV – returned true if the AO texture repeats along V, false if it is clamped.
-
virtual void
SetEmissive
(const RED::Color &iEmissive) = 0 Sets the emissive color.
If the material has an emissive texture, the emissive color is ignored.
Parameters: iEmissive – emissive color.
-
virtual const RED::Color &
GetEmissive
() const = 0 Gets the emissive color.
If the material has an emissive texture, the emissive color is ignored.
Returns: the emissive color.
-
virtual void
SetEmissiveTexture
(const RED::Object *iTexture) = 0 Sets the emissive texture.
Parameters: iTexture – emissive texture.
-
virtual const RED::Object *
GetEmissiveTexture
() const = 0 Gets the emissive texture.
Returns: the emissive texture or NULL if is doesn’t exist.
-
virtual void
SetEmissiveIntensity
(double iIntensity) = 0 Sets the emissive intensity in case of an emissive material.
Parameters: iIntensity – emissive intensity between 0 and +inf.
-
virtual double
GetEmissiveIntensity
() const = 0 Gets the material emissive intensity.
Returns: the emissive intensity.
-
virtual void
SetEmissiveWrap
(bool iRepeatU, bool iRepeatV) = 0 Sets the emissive wrap mode.
Parameters: - iRepeatU – true to have the texture repeat along U, false if clamped.
- iRepeatV – true to have the texture repeat along V, false if clamped.
-
virtual void
GetEmissiveWrap
(bool &oRepeatU, bool &oRepeatV) const = 0 Gets the emissive wrap mode.
Parameters: - oRepeatU – returned true if the emissive texture repeats along U, false if it is clamped.
- oRepeatV – returned true if the emissive texture repeats along V, false if it is clamped.
-
virtual void
SetWaterColor
(const RED::Color &iColor) = 0 Sets the water color.
If the material is not of type water, the water color is ignored.
Parameters: iColor – water color.
-
virtual void
SetWaterRefractIOR
(double iRefractIOR) = 0 Sets the IOR value used for water refraction.
This refract IOR value is independant from the IOR value, that will be used for reflection. For a water material, you need to set both.
Parameters: iRefractIOR – refract IOR value between 1.0 and 10.0, with a value of 1.0 meaning no refraction at all.
-
virtual double
GetWaterRefractIOR
() const = 0 Gets the material refraction IOR value.
Returns: the refraction IOR.
-
virtual void
SetTransmittance
(double iTransmittance) = 0 Sets the transmittance factor in case of water material.
Parameters: iTransmittance – transmittance factor between 0 and 1.
-
virtual double
GetTransmittance
() const = 0 Gets the material transmittance factor.
Returns: the transmittance factor.
-
virtual void
SetRippleSpeed
(double iRippleSpeed) = 0 Sets the speed factor for ripples. It defines the speed of the rippling mouvement of the water.
Parameters: iRippleSpeed – speed ripple factor between 0 and 1, with a value of 0 meaning no mouvement at all.
-
virtual double
GetRippleSpeed
() const = 0 Gets the ripple speed factor.
Returns: the ripple speed factor.
-
virtual void
SetRippleStrength
(double iRippleStrength) = 0 Sets the strength factor for ripples. It defines the strenght of the water ripples defined from the normal map.
Parameters: iRippleStrength – strength ripple factor between 0 and 1, with a value of 0 meaning no ripples at all.
-
virtual double
GetRippleStrength
() const = 0 Gets the ripple strength factor.
Returns: the ripple strength factor.
-
virtual void
SetFlowOrientation
(double iFlowOrientation) = 0 Sets the orientation of the flow mouvement. This parameter must be used alongside the orientation value for the normal map itself.
Parameters: iFlowOrientation – orientation of the flow mouvement between -180 and +180 degrees.
-
virtual double
GetFlowOrientation
() const = 0 Gets the orientation of the flow mouvement.
Returns: the flow orientation value.
-
virtual void
SetFlowSpeed
(double iFlowSpeed) = 0 Sets the speed factor for the flow mouvement.
Parameters: iFlowSpeed – speed factor for the flow mouvement between 0 and 1, with a value of 0 meaning no flow mouvement at all.
-
virtual double
GetFlowSpeed
() const = 0 Gets the speed factor of the flow mouvement.
Returns: the flow speed factor.
-
virtual void
SetWaterPlaneNormal
(const RED::Color &iNormal) = 0 Sets the water surface normal vector.
This normal vector is required for the refraction algorithm. It must be the same normal that is used for the planar reflection rendering pipeline. If the refraction IOR is set to 1.0, this value is ignored.
Parameters: iNormal – normal vector in world coordinates, normalized. The alpha value of the RED::Color is unused.
-
virtual const RED::Color &
GetWaterPlaneNormal
() const = 0 Gets the water surface normal vector.
Returns: the water normal vector, in WCS.
-
virtual void
SetWaterDepth
(double iDepth) = 0 Sets the depth of the water, meaning the approximate depth (in meters) between the water surface where this material is applied, and the other meshes underneath.
This depth value is required for the refraction algorithm. If the refraction IOR is set to 1.0, this value is ignored.
Parameters: iDepth – approximate water depth, in meters.
-
virtual double
GetWaterDepth
() const = 0 Gets the depth of the water.
Returns: the depth of the water, in meters.
-
virtual void
SetMatrix
(const RED::Matrix &iMatrix) = 0 Sets the transform matrix.
Parameters: iMatrix – transform matrix.
-
virtual const RED::Matrix &
GetMatrix
() const = 0 Gets the transform matrix.
Returns: the transform matrix.
-
virtual void
SetChannel
(RED::MESH_CHANNEL iChannel) = 0 Sets the texture mesh channel.
Parameters: iChannel – mesh channel containing the texture coordinates.
-
virtual RED::MESH_CHANNEL
GetChannel
() const = 0 Gets the texture mesh channel.
Returns: the mesh channel containing the texture coordinates.
-
virtual void
SetMasked
(bool iMasked) = 0 Defines the material as masked.
If the material is masked, the masked texture is set using ART::IMaterial::SetTransmissionTexture.
The masked and double sided materials are rendered using the same pipeline. A masked material is automatically double sided.
Parameters: iMasked – true to activate the material masking.
-
virtual bool
IsMasked
() const = 0 Tests if the material is masked.
Returns: true if the material is masked, false otherwise.
-
virtual void
SetDoubleSided
(bool iDoubleSided) = 0 Sets the material double sided.
The masked and double sided materials are rendered using the same pipeline. A double sided material is automatically masked.
Parameters: iDoubleSided – true to activate the material double siding.
-
virtual bool
IsDoubleSided
() const = 0 Tests if the material is double sided.
Returns: true if the material is double sided, false otherwise.
-
virtual bool
HasTransparency
() const = 0 Tests if the material is rendered in the transparent pipeline.
Returns: true if the material is transparent.
-
virtual void
SetAlphaThreshold
(double iThreshold) = 0 Sets the alpha threshold in case of a masked material.
Parameters: iThreshold – alpha threshold under which the material is fully transparent between 0 and 1.
-
virtual double
GetAlphaThreshold
() const = 0 Gets the alpha threshold in case of a masked material.
Returns: the alpha threshold between 0 and 1.