pCon.planner Plugin SDK  Version 8.8.1
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Properties Events
Public Member Functions | Static Public Member Functions | Properties | List of all members
X3g::Plugin::Material Class Reference

Material describes how an object interacts with light. More...

Public Member Functions

 Material (System::String^ pName, MaterialType pType)
 Creates a new material within the current document. More...
 
virtual bool Equals (System::Object^ pOther) override
 Compares two Materials. More...
 
virtual int GetHashCode () override
 Hash the Material and get the hash value. More...
 
void BeginEdit ()
 Enables editing of material. More...
 
void EndEdit ()
 Finishes editing of material. More...
 
ImageGetTextureImage (TextureType pType)
 Returns texture image of given type. More...
 
void SetTextureImage (TextureType pType, Image^ pImage)
 Sets texture image of given type. More...
 
IList< SoundAbsorption >^ GetSoundAbsorption ()
 Returns an optional list of sound absorption values. More...
 
void SetSoundAbsorption (IEnumerable< SoundAbsorption >^pValues)
 Sets an optional collection of sound absorption values. More...
 

Static Public Member Functions

static MaterialLoadMatz (array< unsigned char >^pData)
 Load a Material by byte array. More...
 
static MaterialLoadMatz (System::String^ pFileName)
 Load a Material by file. More...
 

Properties

System::String^  Name [get]
 The unique name of the material. More...
 
System::String^  Label [get, set]
 Optional label. More...
 
MaterialType Type [get, set]
 The material type. More...
 
Color BaseColor [get, set]
 Base color. More...
 
bool UseBaseColorFromEntity [get]
 If this flag is set, DbEntity::Color is used instead of BaseColor. More...
 
System::Nullable< float > Albedo [get, set]
 Albedo equals the luminance of the base color or the average luminance of the base color texture in linear color space. More...
 
float Metallic [get, set]
 Metallness of the surface. More...
 
float Roughness [get, set]
 The roughness of the surface. More...
 
float Transparency [get, set]
 Transparency. More...
 
float RefractiveIndex [get, set]
 Index of refraction. More...
 
Color EmissiveColor [get, set]
 Emissive color. More...
 
float Luminance [get, set]
 Luminance. More...
 
GeMatrix^  BaseTextureMatrix [get, set]
 Transformation of all textures except normal texture. More...
 
GeMatrix^  NormalTextureMatrix [get, set]
 Transformation of normal texture. More...
 
bool ReadOnly [get]
 Returns if material is read-only. More...
 

Detailed Description

Material describes how an object interacts with light.

Constructor & Destructor Documentation

X3g::Plugin::Material::Material ( System::String^  pName,
MaterialType  pType 
)

Creates a new material within the current document.

Exceptions
System::NotSupportedExceptionThrown if a material with this name already exists.

Member Function Documentation

void X3g::Plugin::Material::BeginEdit ( )

Enables editing of material.

This method has to be called before any setters.

void X3g::Plugin::Material::EndEdit ( )

Finishes editing of material.

Material is written to database when this function is called.

bool X3g::Plugin::Material::Equals ( System::Object^  pOther)
overridevirtual

Compares two Materials.

Returns
true if both are equal.
false otherwise.
int X3g::Plugin::Material::GetHashCode ( )
overridevirtual

Hash the Material and get the hash value.

IList< SoundAbsorption > X3g::Plugin::Material::GetSoundAbsorption ( )

Returns an optional list of sound absorption values.

Image X3g::Plugin::Material::GetTextureImage ( TextureType  pType)

Returns texture image of given type.

The base color texture is gamma-corrected (SRGB). Metallic, normal and roughness textures are linear.

Material X3g::Plugin::Material::LoadMatz ( array< unsigned char >^  pData)
static

Load a Material by byte array.

The byte array should have the content of a matz file.

static Material ^ X3g::Plugin::Material::LoadMatz ( System::String^  pFileName)
static

Load a Material by file.

void X3g::Plugin::Material::SetSoundAbsorption ( IEnumerable< SoundAbsorption >^  pValues)

Sets an optional collection of sound absorption values.

void X3g::Plugin::Material::SetTextureImage ( TextureType  pType,
Image pImage 
)

Sets texture image of given type.

The base color texture is expected to be in SRGB. Metallic, normal and roughness textures should be linear.

Setting base color texture resets Albedo and changes BaseColor to average texture color.

Property Documentation

System:: Nullable< float> X3g::Plugin::Material::Albedo
getset

Albedo equals the luminance of the base color or the average luminance of the base color texture in linear color space.

If albedo is null, the base color or base color texture is used for rendering as it is. If albedo is set, the base color or texture is blended with black or white accordingly for rendering. MaterialUtility provides helper functions to apply albedo to base color.

Color X3g::Plugin::Material::BaseColor
getset

Base color.

Base color is gamma-corrected (SRGB).

Setting base color resets Albedo.

GeMatrix^ X3g::Plugin::Material::BaseTextureMatrix
getset

Transformation of all textures except normal texture.

Color X3g::Plugin::Material::EmissiveColor
getset

Emissive color.

Color of light originating from an object. Emissive color is gamma-corrected (SRGB).

System:: String^ X3g::Plugin::Material::Label
getset

Optional label.

float X3g::Plugin::Material::Luminance
getset

Luminance.

The luminance indicates how much luminous power will be detected by an eye looking at the surface from a particular angle of view.

float X3g::Plugin::Material::Metallic
getset

Metallness of the surface.

System:: String^ X3g::Plugin::Material::Name
get

The unique name of the material.

GeMatrix^ X3g::Plugin::Material::NormalTextureMatrix
getset

Transformation of normal texture.

bool X3g::Plugin::Material::ReadOnly
get

Returns if material is read-only.

It's not allowed to change properties of read-only materials.

float X3g::Plugin::Material::RefractiveIndex
getset

Index of refraction.

Can be changed for MaterialType::Glass only.

float X3g::Plugin::Material::Roughness
getset

The roughness of the surface.

float X3g::Plugin::Material::Transparency
getset

Transparency.

Transparency is the percentage of light which passes through the material without being scattered.

MaterialType X3g::Plugin::Material::Type
getset

The material type.

bool X3g::Plugin::Material::UseBaseColorFromEntity
get

If this flag is set, DbEntity::Color is used instead of BaseColor.