![]() |
Polygon Crucher SDK - Documentation
Documentation
|
C3DMaterial is the material base class that handles the 3D material properties, whereas CMaterials a list of several materials.
Each material is identified by a single MaterialID. This identifier can be used to retrieve a particular material of the scene, using C3DScene::GetMaterial method.
DEFAULT_MATERIAL_ID is the MaterialID for a default material, whereas MATERIAL_UNDEFINED is sometime used when the material is not defined or cannot be retrieved.
C3DMaterial is usually created using C3DScene::CreateNewMaterial and can be retrieved using C3DScene::GetMaterial.
C3DMaterial handles one or more CMaterialMap defined by their MapType.
There is two more precise kinds of materials derived from C3DMaterial: C3DStandardMaterial and C3DPbrMaterial, and you can retrieve the appropriate type using C3DMaterial::GetClass.
Most of the format defines a single material, which means that front and back face has the same materials.
However, the SDK supports double face materials, which means you can define a different material for front and back materials.
Some methods named FB are related to double side materials.
For example you can test if a C3DGeomObject has double side materials using C3DGeomObject::HasBackFaceMaterials. You can retrieve the FB used by the object using C3DGeomObject::GetFBMaterialsHashMap.
It is also possible to assign a different UV channel for front and back face and you can know if this is the case using C3DGeomObject::HasDifferentFrontAndBackUVChannel
CMaterialHashMap is CHashMap that helps known which material are used by a C3DFaceList::GetMaterialsHashMap or by the C3DScene::GetMaterials.