Materials

The materials APIs can be used for creating complex materials and applying them to shaded entities. Materials can be set to blocks, groups, layers, entities, and faces. The following materials are present in every drawing:

The global material for a drawing can be retrieved using AcDbDatabase::globalMaterial(). The current database also keeps track of the by-block and by-layer material. By default, the current material is set to the by-layer material.The current material, applied automatically to new entities, can be changed using setCmaterial().

You can override the current material on a group, entity, or subentity with a call to the respective object’s setMaterial() or setmaterialId() member function. To set the material for a face of a 3D solid use the AcDb3dSolid::setSubentMaterial() function.

Materials have the following simple properties:

The material’s shader model determines which shader algorithm is used to render the material. Set the model using AcDbMaterial::setIlluminationModel().