Assimp v5.2.2 (January 2022)
The Asset-Importer-Lib API documentation.
material.h File Reference

Defines the material system of the library. More...

Classes

struct  aiMaterial
 Data structure for a material. More...
 
struct  aiUVTransform
 Defines how an UV channel is transformed. More...
 

Macros

#define AI_DEFAULT_MATERIAL_NAME   "DefaultMaterial"
 
#define AI_MATERIAL_H_INC
 
#define AI_MATKEY_ANISOTROPY_FACTOR   "$mat.anisotropyFactor", 0, 0
 
#define AI_MATKEY_BASE_COLOR   "$clr.base", 0, 0
 
#define AI_MATKEY_BASE_COLOR_TEXTURE   aiTextureType_BASE_COLOR, 0
 
#define AI_MATKEY_BLEND_FUNC   "$mat.blend", 0, 0
 
#define AI_MATKEY_BUMPSCALING   "$mat.bumpscaling", 0, 0
 
#define AI_MATKEY_CLEARCOAT_FACTOR   "$mat.clearcoat.factor", 0, 0
 
#define AI_MATKEY_CLEARCOAT_NORMAL_TEXTURE   aiTextureType_CLEARCOAT, 2
 
#define AI_MATKEY_CLEARCOAT_ROUGHNESS_FACTOR   "$mat.clearcoat.roughnessFactor", 0, 0
 
#define AI_MATKEY_CLEARCOAT_ROUGHNESS_TEXTURE   aiTextureType_CLEARCOAT, 1
 
#define AI_MATKEY_CLEARCOAT_TEXTURE   aiTextureType_CLEARCOAT, 0
 
#define AI_MATKEY_COLOR_AMBIENT   "$clr.ambient", 0, 0
 
#define AI_MATKEY_COLOR_DIFFUSE   "$clr.diffuse", 0, 0
 
#define AI_MATKEY_COLOR_EMISSIVE   "$clr.emissive", 0, 0
 
#define AI_MATKEY_COLOR_REFLECTIVE   "$clr.reflective", 0, 0
 
#define AI_MATKEY_COLOR_SPECULAR   "$clr.specular", 0, 0
 
#define AI_MATKEY_COLOR_TRANSPARENT   "$clr.transparent", 0, 0
 
#define AI_MATKEY_EMISSIVE_INTENSITY   "$mat.emissiveIntensity", 0, 0
 
#define AI_MATKEY_ENABLE_WIREFRAME   "$mat.wireframe", 0, 0
 
#define AI_MATKEY_GLOBAL_BACKGROUND_IMAGE   "?bg.global", 0, 0
 
#define AI_MATKEY_GLOBAL_SHADERLANG   "?sh.lang", 0, 0
 
#define AI_MATKEY_GLOSSINESS_FACTOR   "$mat.glossinessFactor", 0, 0
 
#define AI_MATKEY_MAPPING(type, N)   _AI_MATKEY_MAPPING_BASE, type, N
 
#define AI_MATKEY_MAPPINGMODE_U(type, N)   _AI_MATKEY_MAPPINGMODE_U_BASE, type, N
 
#define AI_MATKEY_MAPPINGMODE_V(type, N)   _AI_MATKEY_MAPPINGMODE_V_BASE, type, N
 
#define AI_MATKEY_METALLIC_FACTOR   "$mat.metallicFactor", 0, 0
 
#define AI_MATKEY_METALLIC_TEXTURE   aiTextureType_METALNESS, 0
 
#define AI_MATKEY_NAME   "?mat.name", 0, 0
 
#define AI_MATKEY_OPACITY   "$mat.opacity", 0, 0
 
#define AI_MATKEY_REFLECTIVITY   "$mat.reflectivity", 0, 0
 
#define AI_MATKEY_REFRACTI   "$mat.refracti", 0, 0
 
#define AI_MATKEY_ROUGHNESS_FACTOR   "$mat.roughnessFactor", 0, 0
 
#define AI_MATKEY_ROUGHNESS_TEXTURE   aiTextureType_DIFFUSE_ROUGHNESS, 0
 
#define AI_MATKEY_SHADER_COMPUTE   "?sh.cs", 0, 0
 
#define AI_MATKEY_SHADER_FRAGMENT   "?sh.fs", 0, 0
 
#define AI_MATKEY_SHADER_GEO   "?sh.gs", 0, 0
 
#define AI_MATKEY_SHADER_PRIMITIVE   "?sh.ps", 0, 0
 
#define AI_MATKEY_SHADER_TESSELATION   "?sh.ts", 0, 0
 
#define AI_MATKEY_SHADER_VERTEX   "?sh.vs", 0, 0
 
#define AI_MATKEY_SHADING_MODEL   "$mat.shadingm", 0, 0
 
#define AI_MATKEY_SHEEN_COLOR_FACTOR   "$clr.sheen.factor", 0, 0
 
#define AI_MATKEY_SHEEN_COLOR_TEXTURE   aiTextureType_SHEEN, 0
 
#define AI_MATKEY_SHEEN_ROUGHNESS_FACTOR   "$mat.sheen.roughnessFactor", 0, 0
 
#define AI_MATKEY_SHEEN_ROUGHNESS_TEXTURE   aiTextureType_SHEEN, 1
 
#define AI_MATKEY_SHININESS   "$mat.shininess", 0, 0
 
#define AI_MATKEY_SHININESS_STRENGTH   "$mat.shinpercent", 0, 0
 
#define AI_MATKEY_SPECULAR_FACTOR   "$mat.specularFactor", 0, 0
 
#define AI_MATKEY_TEXBLEND(type, N)   _AI_MATKEY_TEXBLEND_BASE, type, N
 
#define AI_MATKEY_TEXFLAGS(type, N)   _AI_MATKEY_TEXFLAGS_BASE, type, N
 
#define AI_MATKEY_TEXMAP_AXIS(type, N)   _AI_MATKEY_TEXMAP_AXIS_BASE, type, N
 
#define AI_MATKEY_TEXOP(type, N)   _AI_MATKEY_TEXOP_BASE, type, N
 
#define AI_MATKEY_TEXTURE(type, N)   _AI_MATKEY_TEXTURE_BASE, type, N
 
#define AI_MATKEY_TRANSMISSION_FACTOR   "$mat.transmission.factor", 0, 0
 
#define AI_MATKEY_TRANSMISSION_TEXTURE   aiTextureType_TRANSMISSION, 0
 
#define AI_MATKEY_TRANSPARENCYFACTOR   "$mat.transparencyfactor", 0, 0
 
#define AI_MATKEY_TWOSIDED   "$mat.twosided", 0, 0
 
#define AI_MATKEY_USE_AO_MAP   "$mat.useAOMap", 0, 0
 
#define AI_MATKEY_USE_COLOR_MAP   "$mat.useColorMap", 0, 0
 
#define AI_MATKEY_USE_EMISSIVE_MAP   "$mat.useEmissiveMap", 0, 0
 
#define AI_MATKEY_USE_METALLIC_MAP   "$mat.useMetallicMap", 0, 0
 
#define AI_MATKEY_USE_ROUGHNESS_MAP   "$mat.useRoughnessMap", 0, 0
 
#define AI_MATKEY_UVTRANSFORM(type, N)   _AI_MATKEY_UVTRANSFORM_BASE, type, N
 
#define AI_MATKEY_UVWSRC(type, N)   _AI_MATKEY_UVWSRC_BASE, type, N
 
#define AI_MATKEY_VOLUME_ATTENUATION_COLOR   "$mat.volume.attenuationColor", 0, 0
 
#define AI_MATKEY_VOLUME_ATTENUATION_DISTANCE   "$mat.volume.attenuationDistance", 0, 0
 
#define AI_MATKEY_VOLUME_THICKNESS_FACTOR   "$mat.volume.thicknessFactor", 0, 0
 
#define AI_MATKEY_VOLUME_THICKNESS_TEXTURE   aiTextureType_TRANSMISSION, 1
 
#define AI_TEXTURE_TYPE_MAX   aiTextureType_TRANSMISSION
 

Enumerations

enum  aiBlendMode { aiBlendMode_Default = 0x0 , aiBlendMode_Additive = 0x1 , _aiBlendMode_Force32Bit = INT_MAX }
 Defines alpha-blend flags. More...
 
enum  aiShadingMode {
  aiShadingMode_Flat = 0x1 , aiShadingMode_Gouraud = 0x2 , aiShadingMode_Phong = 0x3 , aiShadingMode_Blinn = 0x4 ,
  aiShadingMode_Toon = 0x5 , aiShadingMode_OrenNayar = 0x6 , aiShadingMode_Minnaert = 0x7 , aiShadingMode_CookTorrance = 0x8 ,
  aiShadingMode_NoShading = 0x9 , aiShadingMode_Unlit = aiShadingMode_NoShading , aiShadingMode_Fresnel = 0xa , aiShadingMode_PBR_BRDF = 0xb ,
  _aiShadingMode_Force32Bit = INT_MAX
}
 Defines all shading models supported by the library. More...
 
enum  aiTextureFlags { aiTextureFlags_Invert = 0x1 , aiTextureFlags_UseAlpha = 0x2 , aiTextureFlags_IgnoreAlpha = 0x4 , _aiTextureFlags_Force32Bit = INT_MAX }
 Defines some mixed flags for a particular texture. More...
 
enum  aiTextureMapMode {
  aiTextureMapMode_Wrap = 0x0 , aiTextureMapMode_Clamp = 0x1 , aiTextureMapMode_Decal = 0x3 , aiTextureMapMode_Mirror = 0x2 ,
  _aiTextureMapMode_Force32Bit = INT_MAX
}
 Defines how UV coordinates outside the [0...1] range are handled. More...
 
enum  aiTextureMapping {
  aiTextureMapping_UV = 0x0 , aiTextureMapping_SPHERE = 0x1 , aiTextureMapping_CYLINDER = 0x2 , aiTextureMapping_BOX = 0x3 ,
  aiTextureMapping_PLANE = 0x4 , aiTextureMapping_OTHER = 0x5 , _aiTextureMapping_Force32Bit = INT_MAX
}
 Defines how the mapping coords for a texture are generated. More...
 
enum  aiTextureOp {
  aiTextureOp_Multiply = 0x0 , aiTextureOp_Add = 0x1 , aiTextureOp_Subtract = 0x2 , aiTextureOp_Divide = 0x3 ,
  aiTextureOp_SmoothAdd = 0x4 , aiTextureOp_SignedAdd = 0x5 , _aiTextureOp_Force32Bit = INT_MAX
}
 Defines how the Nth texture of a specific type is combined with the result of all previous layers. More...
 
enum  aiTextureType {
  aiTextureType_NONE = 0 , aiTextureType_DIFFUSE = 1 , aiTextureType_SPECULAR = 2 , aiTextureType_AMBIENT = 3 ,
  aiTextureType_EMISSIVE = 4 , aiTextureType_HEIGHT = 5 , aiTextureType_NORMALS = 6 , aiTextureType_SHININESS = 7 ,
  aiTextureType_OPACITY = 8 , aiTextureType_DISPLACEMENT = 9 , aiTextureType_LIGHTMAP = 10 , aiTextureType_REFLECTION = 11 ,
  aiTextureType_BASE_COLOR = 12 , aiTextureType_NORMAL_CAMERA = 13 , aiTextureType_EMISSION_COLOR = 14 , aiTextureType_METALNESS = 15 ,
  aiTextureType_DIFFUSE_ROUGHNESS = 16 , aiTextureType_AMBIENT_OCCLUSION = 17 , aiTextureType_SHEEN = 19 , aiTextureType_CLEARCOAT = 20 ,
  aiTextureType_TRANSMISSION = 21 , aiTextureType_UNKNOWN = 18 , _aiTextureType_Force32Bit = INT_MAX
}
 Defines the purpose of a texture. More...
 

Functions

ASSIMP_API C_ENUM aiReturn aiGetMaterialColor (const C_STRUCT aiMaterial *pMat, const char *pKey, unsigned int type, unsigned int index, C_STRUCT aiColor4D *pOut)
 Retrieve a color value from the material property table. More...
 
aiReturn aiGetMaterialFloat (const C_STRUCT aiMaterial *pMat, const char *pKey, unsigned int type, unsigned int index, ai_real *pOut)
 Retrieve a single float property with a specific key from the material. More...
 
ASSIMP_API C_ENUM aiReturn aiGetMaterialFloatArray (const C_STRUCT aiMaterial *pMat, const char *pKey, unsigned int type, unsigned int index, ai_real *pOut, unsigned int *pMax)
 Retrieve an array of float values with a specific key from the material. More...
 
aiReturn aiGetMaterialInteger (const C_STRUCT aiMaterial *pMat, const char *pKey, unsigned int type, unsigned int index, int *pOut)
 Retrieve an integer property with a specific key from a material. More...
 
ASSIMP_API C_ENUM aiReturn aiGetMaterialIntegerArray (const C_STRUCT aiMaterial *pMat, const char *pKey, unsigned int type, unsigned int index, int *pOut, unsigned int *pMax)
 Retrieve an array of integer values with a specific key from a material. More...
 
ASSIMP_API C_ENUM aiReturn aiGetMaterialProperty (const C_STRUCT aiMaterial *pMat, const char *pKey, unsigned int type, unsigned int index, const C_STRUCT aiMaterialProperty **pPropOut)
 Retrieve a material property with a specific key from the material. More...
 
ASSIMP_API C_ENUM aiReturn aiGetMaterialString (const C_STRUCT aiMaterial *pMat, const char *pKey, unsigned int type, unsigned int index, C_STRUCT aiString *pOut)
 Retrieve a string from the material property table. More...
 
ASSIMP_API aiReturn aiGetMaterialTexture (const C_STRUCT aiMaterial *mat, aiTextureType type, unsigned int index, aiString *path, aiTextureMapping *mapping=NULL, unsigned int *uvindex=NULL, ai_real *blend=NULL, aiTextureOp *op=NULL, aiTextureMapMode *mapmode=NULL, unsigned int *flags=NULL)
 Helper function to get all values pertaining to a particular texture slot from a material structure. More...
 
ASSIMP_API unsigned int aiGetMaterialTextureCount (const C_STRUCT aiMaterial *pMat, C_ENUM aiTextureType type)
 Get the number of textures for a particular texture type. More...
 
ASSIMP_API C_ENUM aiReturn aiGetMaterialUVTransform (const C_STRUCT aiMaterial *pMat, const char *pKey, unsigned int type, unsigned int index, C_STRUCT aiUVTransform *pOut)
 Retrieve a aiUVTransform value from the material property table. More...
 
ASSIMP_API const char * aiTextureTypeToString (enum aiTextureType in)
 

Detailed Description

Defines the material system of the library.

Macro Definition Documentation

◆ AI_DEFAULT_MATERIAL_NAME

#define AI_DEFAULT_MATERIAL_NAME   "DefaultMaterial"

◆ AI_MATERIAL_H_INC

#define AI_MATERIAL_H_INC

◆ AI_MATKEY_ANISOTROPY_FACTOR

#define AI_MATKEY_ANISOTROPY_FACTOR   "$mat.anisotropyFactor", 0, 0

◆ AI_MATKEY_BASE_COLOR

#define AI_MATKEY_BASE_COLOR   "$clr.base", 0, 0

◆ AI_MATKEY_BASE_COLOR_TEXTURE

#define AI_MATKEY_BASE_COLOR_TEXTURE   aiTextureType_BASE_COLOR, 0

◆ AI_MATKEY_BLEND_FUNC

#define AI_MATKEY_BLEND_FUNC   "$mat.blend", 0, 0

◆ AI_MATKEY_BUMPSCALING

#define AI_MATKEY_BUMPSCALING   "$mat.bumpscaling", 0, 0

◆ AI_MATKEY_CLEARCOAT_FACTOR

#define AI_MATKEY_CLEARCOAT_FACTOR   "$mat.clearcoat.factor", 0, 0

◆ AI_MATKEY_CLEARCOAT_NORMAL_TEXTURE

#define AI_MATKEY_CLEARCOAT_NORMAL_TEXTURE   aiTextureType_CLEARCOAT, 2

◆ AI_MATKEY_CLEARCOAT_ROUGHNESS_FACTOR

#define AI_MATKEY_CLEARCOAT_ROUGHNESS_FACTOR   "$mat.clearcoat.roughnessFactor", 0, 0

◆ AI_MATKEY_CLEARCOAT_ROUGHNESS_TEXTURE

#define AI_MATKEY_CLEARCOAT_ROUGHNESS_TEXTURE   aiTextureType_CLEARCOAT, 1

◆ AI_MATKEY_CLEARCOAT_TEXTURE

#define AI_MATKEY_CLEARCOAT_TEXTURE   aiTextureType_CLEARCOAT, 0

◆ AI_MATKEY_COLOR_AMBIENT

#define AI_MATKEY_COLOR_AMBIENT   "$clr.ambient", 0, 0

◆ AI_MATKEY_COLOR_DIFFUSE

#define AI_MATKEY_COLOR_DIFFUSE   "$clr.diffuse", 0, 0

◆ AI_MATKEY_COLOR_EMISSIVE

#define AI_MATKEY_COLOR_EMISSIVE   "$clr.emissive", 0, 0

◆ AI_MATKEY_COLOR_REFLECTIVE

#define AI_MATKEY_COLOR_REFLECTIVE   "$clr.reflective", 0, 0

◆ AI_MATKEY_COLOR_SPECULAR

#define AI_MATKEY_COLOR_SPECULAR   "$clr.specular", 0, 0

◆ AI_MATKEY_COLOR_TRANSPARENT

#define AI_MATKEY_COLOR_TRANSPARENT   "$clr.transparent", 0, 0

◆ AI_MATKEY_EMISSIVE_INTENSITY

#define AI_MATKEY_EMISSIVE_INTENSITY   "$mat.emissiveIntensity", 0, 0

◆ AI_MATKEY_ENABLE_WIREFRAME

#define AI_MATKEY_ENABLE_WIREFRAME   "$mat.wireframe", 0, 0

◆ AI_MATKEY_GLOBAL_BACKGROUND_IMAGE

#define AI_MATKEY_GLOBAL_BACKGROUND_IMAGE   "?bg.global", 0, 0

◆ AI_MATKEY_GLOBAL_SHADERLANG

#define AI_MATKEY_GLOBAL_SHADERLANG   "?sh.lang", 0, 0

◆ AI_MATKEY_GLOSSINESS_FACTOR

#define AI_MATKEY_GLOSSINESS_FACTOR   "$mat.glossinessFactor", 0, 0

◆ AI_MATKEY_MAPPING

#define AI_MATKEY_MAPPING (   type,
 
)    _AI_MATKEY_MAPPING_BASE, type, N

◆ AI_MATKEY_MAPPINGMODE_U

#define AI_MATKEY_MAPPINGMODE_U (   type,
 
)    _AI_MATKEY_MAPPINGMODE_U_BASE, type, N

◆ AI_MATKEY_MAPPINGMODE_V

#define AI_MATKEY_MAPPINGMODE_V (   type,
 
)    _AI_MATKEY_MAPPINGMODE_V_BASE, type, N

◆ AI_MATKEY_METALLIC_FACTOR

#define AI_MATKEY_METALLIC_FACTOR   "$mat.metallicFactor", 0, 0

◆ AI_MATKEY_METALLIC_TEXTURE

#define AI_MATKEY_METALLIC_TEXTURE   aiTextureType_METALNESS, 0

◆ AI_MATKEY_NAME

#define AI_MATKEY_NAME   "?mat.name", 0, 0

◆ AI_MATKEY_OPACITY

#define AI_MATKEY_OPACITY   "$mat.opacity", 0, 0

◆ AI_MATKEY_REFLECTIVITY

#define AI_MATKEY_REFLECTIVITY   "$mat.reflectivity", 0, 0

◆ AI_MATKEY_REFRACTI

#define AI_MATKEY_REFRACTI   "$mat.refracti", 0, 0

◆ AI_MATKEY_ROUGHNESS_FACTOR

#define AI_MATKEY_ROUGHNESS_FACTOR   "$mat.roughnessFactor", 0, 0

◆ AI_MATKEY_ROUGHNESS_TEXTURE

#define AI_MATKEY_ROUGHNESS_TEXTURE   aiTextureType_DIFFUSE_ROUGHNESS, 0

◆ AI_MATKEY_SHADER_COMPUTE

#define AI_MATKEY_SHADER_COMPUTE   "?sh.cs", 0, 0

◆ AI_MATKEY_SHADER_FRAGMENT

#define AI_MATKEY_SHADER_FRAGMENT   "?sh.fs", 0, 0

◆ AI_MATKEY_SHADER_GEO

#define AI_MATKEY_SHADER_GEO   "?sh.gs", 0, 0

◆ AI_MATKEY_SHADER_PRIMITIVE

#define AI_MATKEY_SHADER_PRIMITIVE   "?sh.ps", 0, 0

◆ AI_MATKEY_SHADER_TESSELATION

#define AI_MATKEY_SHADER_TESSELATION   "?sh.ts", 0, 0

◆ AI_MATKEY_SHADER_VERTEX

#define AI_MATKEY_SHADER_VERTEX   "?sh.vs", 0, 0

◆ AI_MATKEY_SHADING_MODEL

#define AI_MATKEY_SHADING_MODEL   "$mat.shadingm", 0, 0

◆ AI_MATKEY_SHEEN_COLOR_FACTOR

#define AI_MATKEY_SHEEN_COLOR_FACTOR   "$clr.sheen.factor", 0, 0

◆ AI_MATKEY_SHEEN_COLOR_TEXTURE

#define AI_MATKEY_SHEEN_COLOR_TEXTURE   aiTextureType_SHEEN, 0

◆ AI_MATKEY_SHEEN_ROUGHNESS_FACTOR

#define AI_MATKEY_SHEEN_ROUGHNESS_FACTOR   "$mat.sheen.roughnessFactor", 0, 0

◆ AI_MATKEY_SHEEN_ROUGHNESS_TEXTURE

#define AI_MATKEY_SHEEN_ROUGHNESS_TEXTURE   aiTextureType_SHEEN, 1

◆ AI_MATKEY_SHININESS

#define AI_MATKEY_SHININESS   "$mat.shininess", 0, 0

◆ AI_MATKEY_SHININESS_STRENGTH

#define AI_MATKEY_SHININESS_STRENGTH   "$mat.shinpercent", 0, 0

◆ AI_MATKEY_SPECULAR_FACTOR

#define AI_MATKEY_SPECULAR_FACTOR   "$mat.specularFactor", 0, 0

◆ AI_MATKEY_TEXBLEND

#define AI_MATKEY_TEXBLEND (   type,
 
)    _AI_MATKEY_TEXBLEND_BASE, type, N

◆ AI_MATKEY_TEXFLAGS

#define AI_MATKEY_TEXFLAGS (   type,
 
)    _AI_MATKEY_TEXFLAGS_BASE, type, N

◆ AI_MATKEY_TEXMAP_AXIS

#define AI_MATKEY_TEXMAP_AXIS (   type,
 
)    _AI_MATKEY_TEXMAP_AXIS_BASE, type, N

◆ AI_MATKEY_TEXOP

#define AI_MATKEY_TEXOP (   type,
 
)    _AI_MATKEY_TEXOP_BASE, type, N

◆ AI_MATKEY_TEXTURE

#define AI_MATKEY_TEXTURE (   type,
 
)    _AI_MATKEY_TEXTURE_BASE, type, N

◆ AI_MATKEY_TRANSMISSION_FACTOR

#define AI_MATKEY_TRANSMISSION_FACTOR   "$mat.transmission.factor", 0, 0

◆ AI_MATKEY_TRANSMISSION_TEXTURE

#define AI_MATKEY_TRANSMISSION_TEXTURE   aiTextureType_TRANSMISSION, 0

◆ AI_MATKEY_TRANSPARENCYFACTOR

#define AI_MATKEY_TRANSPARENCYFACTOR   "$mat.transparencyfactor", 0, 0

◆ AI_MATKEY_TWOSIDED

#define AI_MATKEY_TWOSIDED   "$mat.twosided", 0, 0

◆ AI_MATKEY_USE_AO_MAP

#define AI_MATKEY_USE_AO_MAP   "$mat.useAOMap", 0, 0

◆ AI_MATKEY_USE_COLOR_MAP

#define AI_MATKEY_USE_COLOR_MAP   "$mat.useColorMap", 0, 0

◆ AI_MATKEY_USE_EMISSIVE_MAP

#define AI_MATKEY_USE_EMISSIVE_MAP   "$mat.useEmissiveMap", 0, 0

◆ AI_MATKEY_USE_METALLIC_MAP

#define AI_MATKEY_USE_METALLIC_MAP   "$mat.useMetallicMap", 0, 0

◆ AI_MATKEY_USE_ROUGHNESS_MAP

#define AI_MATKEY_USE_ROUGHNESS_MAP   "$mat.useRoughnessMap", 0, 0

◆ AI_MATKEY_UVTRANSFORM

#define AI_MATKEY_UVTRANSFORM (   type,
 
)    _AI_MATKEY_UVTRANSFORM_BASE, type, N

◆ AI_MATKEY_UVWSRC

#define AI_MATKEY_UVWSRC (   type,
 
)    _AI_MATKEY_UVWSRC_BASE, type, N

◆ AI_MATKEY_VOLUME_ATTENUATION_COLOR

#define AI_MATKEY_VOLUME_ATTENUATION_COLOR   "$mat.volume.attenuationColor", 0, 0

◆ AI_MATKEY_VOLUME_ATTENUATION_DISTANCE

#define AI_MATKEY_VOLUME_ATTENUATION_DISTANCE   "$mat.volume.attenuationDistance", 0, 0

◆ AI_MATKEY_VOLUME_THICKNESS_FACTOR

#define AI_MATKEY_VOLUME_THICKNESS_FACTOR   "$mat.volume.thicknessFactor", 0, 0

◆ AI_MATKEY_VOLUME_THICKNESS_TEXTURE

#define AI_MATKEY_VOLUME_THICKNESS_TEXTURE   aiTextureType_TRANSMISSION, 1

◆ AI_TEXTURE_TYPE_MAX

#define AI_TEXTURE_TYPE_MAX   aiTextureType_TRANSMISSION

Enumeration Type Documentation

◆ aiBlendMode

Defines alpha-blend flags.

If you're familiar with OpenGL or D3D, these flags aren't new to you. They define how the final color value of a pixel is computed, basing on the previous color at that pixel and the new color value from the material. The blend formula is:

SourceColor * SourceBlend + DestColor * DestBlend

where DestColor is the previous color in the frame-buffer at this position and SourceColor is the material color before the transparency calculation.
This corresponds to the AI_MATKEY_BLEND_FUNC property.

Enumerator
aiBlendMode_Default 

Formula:

SourceColor*SourceAlpha + DestColor*(1-SourceAlpha)
aiBlendMode_Additive 

Additive blending.

Formula:
@code
SourceColor*1 + DestColor*1
@endcode
_aiBlendMode_Force32Bit 

◆ aiShadingMode

Defines all shading models supported by the library.

Property: AI_MATKEY_SHADING_MODEL

The list of shading modes has been taken from Blender. See Blender documentation for more information. The API does not distinguish between "specular" and "diffuse" shaders (thus the specular term for diffuse shading models like Oren-Nayar remains undefined).
Again, this value is just a hint. Assimp tries to select the shader whose most common implementation matches the original rendering results of the 3D modeler which wrote a particular model as closely as possible.

Enumerator
aiShadingMode_Flat 

Flat shading.

Shading is done on per-face base, diffuse only. Also known as 'faceted shading'.

aiShadingMode_Gouraud 

Simple Gouraud shading.

aiShadingMode_Phong 

Phong-Shading -.

aiShadingMode_Blinn 

Phong-Blinn-Shading.

aiShadingMode_Toon 

Toon-Shading per pixel.

Also known as 'comic' shader.
aiShadingMode_OrenNayar 

OrenNayar-Shading per pixel.

Extension to standard Lambertian shading, taking the
roughness of the material into account
aiShadingMode_Minnaert 

Minnaert-Shading per pixel.

Extension to standard Lambertian shading, taking the
"darkness" of the material into account
aiShadingMode_CookTorrance 

CookTorrance-Shading per pixel.

Special shader for metallic surfaces.
aiShadingMode_NoShading 

No shading at all.

Constant light influence of 1.0. Also known as "Unlit"

aiShadingMode_Unlit 
aiShadingMode_Fresnel 

Fresnel shading.

aiShadingMode_PBR_BRDF 

Physically-Based Rendering (PBR) shading using Bidirectional scattering/reflectance distribution function (BSDF/BRDF) There are multiple methods under this banner, and model files may provide data for more than one PBR-BRDF method.

Applications should use the set of provided properties to determine which of their preferred PBR rendering methods are likely to be available eg:

  • If AI_MATKEY_METALLIC_FACTOR is set, then a Metallic/Roughness is available
  • If AI_MATKEY_GLOSSINESS_FACTOR is set, then a Specular/Glossiness is available Note that some PBR methods allow layering of techniques
_aiShadingMode_Force32Bit 

◆ aiTextureFlags

Defines some mixed flags for a particular texture.

Usually you'll instruct your cg artists how textures have to look like ... and how they will be processed in your application. However, if you use Assimp for completely generic loading purposes you might also need to process these flags in order to display as many 'unknown' 3D models as possible correctly.

This corresponds to the AI_MATKEY_TEXFLAGS property.

Enumerator
aiTextureFlags_Invert 

The texture's color values have to be inverted (component-wise 1-n)

aiTextureFlags_UseAlpha 

Explicit request to the application to process the alpha channel of the texture.

Mutually exclusive with aiTextureFlags_IgnoreAlpha. These flags are set if the library can say for sure that the alpha channel is used/is not used. If the model format does not define this, it is left to the application to decide whether the texture alpha channel - if any - is evaluated or not.

aiTextureFlags_IgnoreAlpha 

Explicit request to the application to ignore the alpha channel of the texture.

Mutually exclusive with aiTextureFlags_UseAlpha.

_aiTextureFlags_Force32Bit 

◆ aiTextureMapMode

Defines how UV coordinates outside the [0...1] range are handled.

Commonly referred to as 'wrapping mode'.

Enumerator
aiTextureMapMode_Wrap 

A texture coordinate u|v is translated to u%1|v%1.

aiTextureMapMode_Clamp 

Texture coordinates outside [0...1] are clamped to the nearest valid value.

aiTextureMapMode_Decal 

If the texture coordinates for a pixel are outside [0...1] the texture is not applied to that pixel.

aiTextureMapMode_Mirror 

A texture coordinate u|v becomes u%1|v%1 if (u-(u%1))%2 is zero and 1-(u%1)|1-(v%1) otherwise.

_aiTextureMapMode_Force32Bit 

◆ aiTextureMapping

Defines how the mapping coords for a texture are generated.

Real-time applications typically require full UV coordinates, so the use of the aiProcess_GenUVCoords step is highly recommended. It generates proper UV channels for non-UV mapped objects, as long as an accurate description how the mapping should look like (e.g spherical) is given. See the AI_MATKEY_MAPPING property for more details.

Enumerator
aiTextureMapping_UV 

The mapping coordinates are taken from an UV channel.

#AI_MATKEY_UVWSRC property specifies from which UV channel
the texture coordinates are to be taken from (remember,
meshes can have more than one UV channel).
aiTextureMapping_SPHERE 

Spherical mapping.

aiTextureMapping_CYLINDER 

Cylindrical mapping.

aiTextureMapping_BOX 

Cubic mapping.

aiTextureMapping_PLANE 

Planar mapping.

aiTextureMapping_OTHER 

Undefined mapping.

Have fun.

_aiTextureMapping_Force32Bit 

◆ aiTextureOp

Defines how the Nth texture of a specific type is combined with the result of all previous layers.

Example (left: key, right: value):

DiffColor0 - gray
DiffTextureOp0 - aiTextureOpMultiply
DiffTexture0 - tex1.png
DiffTextureOp0 - aiTextureOpAdd
DiffTexture1 - tex2.png

Written as equation, the final diffuse term for a specific pixel would be:

diffFinal = DiffColor0 * sampleTex(DiffTexture0,UV0) +
sampleTex(DiffTexture1,UV0) * diffContrib;

where 'diffContrib' is the intensity of the incoming light for that pixel.

Enumerator
aiTextureOp_Multiply 

T = T1 * T2.

aiTextureOp_Add 

T = T1 + T2.

aiTextureOp_Subtract 

T = T1 - T2.

aiTextureOp_Divide 

T = T1 / T2.

aiTextureOp_SmoothAdd 

T = (T1 + T2) - (T1 * T2)

aiTextureOp_SignedAdd 

T = T1 + (T2-0.5)

_aiTextureOp_Force32Bit 

◆ aiTextureType

Defines the purpose of a texture.

This is a very difficult topic. Different 3D packages support different kinds of textures. For very common texture types, such as bumpmaps, the rendering results depend on implementation details in the rendering pipelines of these applications. Assimp loads all texture references from the model file and tries to determine which of the predefined texture types below is the best choice to match the original use of the texture as closely as possible.

In content pipelines you'll usually define how textures have to be handled, and the artists working on models have to conform to this specification, regardless which 3D tool they're using.

Enumerator
aiTextureType_NONE 

Dummy value.

No texture, but the value to be used as 'texture semantic'
(#aiMaterialProperty::mSemantic) for all material properties
*not* related to textures.
aiTextureType_DIFFUSE 

LEGACY API MATERIALS Legacy refers to materials which Were originally implemented in the specifications around 2000.

These must never be removed, as most engines support them. The texture is combined with the result of the diffuse lighting equation. OR PBR Specular/Glossiness

aiTextureType_SPECULAR 

The texture is combined with the result of the specular lighting equation.

OR PBR Specular/Glossiness

aiTextureType_AMBIENT 

The texture is combined with the result of the ambient lighting equation.

aiTextureType_EMISSIVE 

The texture is added to the result of the lighting calculation.

It isn't influenced by incoming light.

aiTextureType_HEIGHT 

The texture is a height map.

By convention, higher gray-scale values stand for
higher elevations from the base height.
aiTextureType_NORMALS 

The texture is a (tangent space) normal-map.

Again, there are several conventions for tangent-space
normal maps. Assimp does (intentionally) not
distinguish here.
aiTextureType_SHININESS 

The texture defines the glossiness of the material.

The glossiness is in fact the exponent of the specular
(phong) lighting equation. Usually there is a conversion
function defined to map the linear color values in the
texture to a suitable exponent. Have fun.
aiTextureType_OPACITY 

The texture defines per-pixel opacity.

Usually 'white' means opaque and 'black' means
'transparency'. Or quite the opposite. Have fun.
aiTextureType_DISPLACEMENT 

Displacement texture.

The exact purpose and format is application-dependent.
Higher color values stand for higher vertex displacements.
aiTextureType_LIGHTMAP 

Lightmap texture (aka Ambient Occlusion)

Both 'Lightmaps' and dedicated 'ambient occlusion maps' are
covered by this material property. The texture contains a
scaling value for the final color value of a pixel. Its
intensity is not affected by incoming light.
aiTextureType_REFLECTION 

Reflection texture.

Contains the color of a perfect mirror reflection. Rarely used, almost never for real-time applications.

aiTextureType_BASE_COLOR 

PBR Materials PBR definitions from maya and other modelling packages now use this standard.

This was originally introduced around 2012. Support for this is in game engines like Godot, Unreal or Unity3D. Modelling packages which use this are very common now.

aiTextureType_NORMAL_CAMERA 
aiTextureType_EMISSION_COLOR 
aiTextureType_METALNESS 
aiTextureType_DIFFUSE_ROUGHNESS 
aiTextureType_AMBIENT_OCCLUSION 
aiTextureType_SHEEN 

PBR Material Modifiers Some modern renderers have further PBR modifiers that may be overlaid on top of the 'base' PBR materials for additional realism.

These use multiple texture maps, so only the base type is directly defined Sheen Generally used to simulate textiles that are covered in a layer of microfibers eg velvet https://github.com/KhronosGroup/glTF/tree/master/extensions/2.0/Khronos/KHR_materials_sheen

aiTextureType_CLEARCOAT 

Clearcoat Simulates a layer of 'polish' or 'laquer' layered on top of a PBR substrate https://autodesk.github.io/standard-surface/#closures/coating https://github.com/KhronosGroup/glTF/tree/master/extensions/2.0/Khronos/KHR_materials_clearcoat.

aiTextureType_TRANSMISSION 

Transmission Simulates transmission through the surface May include further information such as wall thickness.

aiTextureType_UNKNOWN 

Unknown texture.

A texture reference that does not match any of the definitions
above is considered to be 'unknown'. It is still imported,
but is excluded from any further post-processing.
_aiTextureType_Force32Bit 

Function Documentation

◆ aiGetMaterialColor()

ASSIMP_API C_ENUM aiReturn aiGetMaterialColor ( const C_STRUCT aiMaterial pMat,
const char *  pKey,
unsigned int  type,
unsigned int  index,
C_STRUCT aiColor4D pOut 
)

Retrieve a color value from the material property table.

See the sample for aiGetMaterialFloat for more information

◆ aiGetMaterialFloat()

aiReturn aiGetMaterialFloat ( const C_STRUCT aiMaterial pMat,
const char *  pKey,
unsigned int  type,
unsigned int  index,
ai_real pOut 
)
inline

Retrieve a single float property with a specific key from the material.

Pass one of the AI_MATKEY_XXX constants for the last three parameters (the example reads the AI_MATKEY_SHININESS_STRENGTH property of the first diffuse texture)

float specStrength = 1.f; // default value, remains unmodified if we fail.
(float*)&specStrength);
#define AI_MATKEY_SHININESS_STRENGTH
Definition: material.h:954
aiReturn aiGetMaterialFloat(const C_STRUCT aiMaterial *pMat, const char *pKey, unsigned int type, unsigned int index, ai_real *pOut)
Retrieve a single float property with a specific key from the material.
Definition: material.h:1537
Parameters
pMatPointer to the input material. May not be NULL
pKeyKey to search for. One of the AI_MATKEY_XXX constants.
pOutReceives the output float.
type(see the code sample above)
index(see the code sample above)
Returns
Specifies whether the key has been found. If not, the output float remains unmodified.

◆ aiGetMaterialFloatArray()

ASSIMP_API C_ENUM aiReturn aiGetMaterialFloatArray ( const C_STRUCT aiMaterial pMat,
const char *  pKey,
unsigned int  type,
unsigned int  index,
ai_real pOut,
unsigned int *  pMax 
)

Retrieve an array of float values with a specific key from the material.

Pass one of the AI_MATKEY_XXX constants for the last three parameters (the example reads the AI_MATKEY_UVTRANSFORM property of the first diffuse texture)

unsigned int max = sizeof(aiUVTransform);
(float*)&trafo, &max) || sizeof(aiUVTransform) != max)
{
// error handling
}
@ aiTextureType_DIFFUSE
LEGACY API MATERIALS Legacy refers to materials which Were originally implemented in the specificatio...
Definition: material.h:208
ASSIMP_API C_ENUM aiReturn aiGetMaterialFloatArray(const C_STRUCT aiMaterial *pMat, const char *pKey, unsigned int type, unsigned int index, ai_real *pOut, unsigned int *pMax)
Retrieve an array of float values with a specific key from the material.
#define AI_MATKEY_UVTRANSFORM(type, N)
Definition: material.h:1382
Defines how an UV channel is transformed.
Definition: material.h:520
Parameters
pMatPointer to the input material. May not be NULL
pKeyKey to search for. One of the AI_MATKEY_XXX constants.
pOutPointer to a buffer to receive the result.
pMaxSpecifies the size of the given buffer, in float's. Receives the number of values (not bytes!) read.
type(see the code sample above)
index(see the code sample above)
Returns
Specifies whether the key has been found. If not, the output arrays remains unmodified and pMax is set to 0.

◆ aiGetMaterialInteger()

aiReturn aiGetMaterialInteger ( const C_STRUCT aiMaterial pMat,
const char *  pKey,
unsigned int  type,
unsigned int  index,
int *  pOut 
)
inline

Retrieve an integer property with a specific key from a material.

See the sample for aiGetMaterialFloat for more information.

◆ aiGetMaterialIntegerArray()

ASSIMP_API C_ENUM aiReturn aiGetMaterialIntegerArray ( const C_STRUCT aiMaterial pMat,
const char *  pKey,
unsigned int  type,
unsigned int  index,
int *  pOut,
unsigned int *  pMax 
)

Retrieve an array of integer values with a specific key from a material.

See the sample for aiGetMaterialFloatArray for more information.

◆ aiGetMaterialProperty()

ASSIMP_API C_ENUM aiReturn aiGetMaterialProperty ( const C_STRUCT aiMaterial pMat,
const char *  pKey,
unsigned int  type,
unsigned int  index,
const C_STRUCT aiMaterialProperty **  pPropOut 
)

Retrieve a material property with a specific key from the material.

Parameters
pMatPointer to the input material. May not be NULL
pKeyKey to search for. One of the AI_MATKEY_XXX constants.
typeSpecifies the type of the texture to be retrieved ( e.g. diffuse, specular, height map ...)
indexIndex of the texture to be retrieved.
pPropOutPointer to receive a pointer to a valid aiMaterialProperty structure or NULL if the key has not been found.

◆ aiGetMaterialString()

ASSIMP_API C_ENUM aiReturn aiGetMaterialString ( const C_STRUCT aiMaterial pMat,
const char *  pKey,
unsigned int  type,
unsigned int  index,
C_STRUCT aiString pOut 
)

Retrieve a string from the material property table.

See the sample for aiGetMaterialFloat for more information.

◆ aiGetMaterialTexture()

ASSIMP_API aiReturn aiGetMaterialTexture ( const C_STRUCT aiMaterial mat,
aiTextureType  type,
unsigned int  index,
aiString path,
aiTextureMapping mapping = NULL,
unsigned int *  uvindex = NULL,
ai_real blend = NULL,
aiTextureOp op = NULL,
aiTextureMapMode mapmode = NULL,
unsigned int *  flags = NULL 
)

Helper function to get all values pertaining to a particular texture slot from a material structure.

This function is provided just for convenience. You could also read the texture by parsing all of its properties manually. This function bundles all of them in a huge function monster.

Parameters
[in]matPointer to the input material. May not be NULL
[in]typeSpecifies the texture stack to read from (e.g. diffuse, specular, height map ...).
[in]indexIndex of the texture. The function fails if the requested index is not available for this texture type. aiGetMaterialTextureCount() can be used to determine the number of textures in a particular texture stack.
[out]pathReceives the output path If the texture is embedded, receives a '*' followed by the id of the texture (for the textures stored in the corresponding scene) which can be converted to an int using a function like atoi. This parameter must be non-null.
mappingThe texture mapping mode to be used. Pass NULL if you're not interested in this information.
[out]uvindexFor UV-mapped textures: receives the index of the UV source channel. Unmodified otherwise. Pass NULL if you're not interested in this information.
[out]blendReceives the blend factor for the texture Pass NULL if you're not interested in this information.
[out]opReceives the texture blend operation to be perform between this texture and the previous texture. Pass NULL if you're not interested in this information.
[out]mapmodeReceives the mapping modes to be used for the texture. Pass NULL if you're not interested in this information. Otherwise, pass a pointer to an array of two aiTextureMapMode's (one for each axis, UV order).
[out]flagsReceives the the texture flags.
Returns
AI_SUCCESS on success, otherwise something else. Have fun.

◆ aiGetMaterialTextureCount()

ASSIMP_API unsigned int aiGetMaterialTextureCount ( const C_STRUCT aiMaterial pMat,
C_ENUM aiTextureType  type 
)

Get the number of textures for a particular texture type.

Parameters
[in]pMatPointer to the input material. May not be NULL
typeTexture type to check for
Returns
Number of textures for this type.
Note
A texture can be easily queried using aiGetMaterialTexture()

◆ aiGetMaterialUVTransform()

ASSIMP_API C_ENUM aiReturn aiGetMaterialUVTransform ( const C_STRUCT aiMaterial pMat,
const char *  pKey,
unsigned int  type,
unsigned int  index,
C_STRUCT aiUVTransform pOut 
)

Retrieve a aiUVTransform value from the material property table.

See the sample for aiGetMaterialFloat for more information

◆ aiTextureTypeToString()

ASSIMP_API const char * aiTextureTypeToString ( enum aiTextureType  in)