Material data. More...
Detailed Description
Material data.
- Version
- 2.0
- Note
- Use A3DGlobalGetGraphRgbColorData to get ambient, diffuse, emissive and specular colors.
- The conventions described here are similar to the common scene graphics conventions described for other 3D standards such as OpenGL and DirectX.
- Support for PBR (Physically-Based Rendering):
- The following properties are supported:
- base color
- emissive color
- normals
- metallness
- roughness
- occlusion
The textures can have the following types (see m_uiMappingAttributes in A3DGraphTextureDefinitionData):
- kA3DTextureMappingDiffuse
- kA3DTextureMappingEmission
- kA3DTextureMappingNormal
- kA3DTextureMappingMetallness
- kA3DTextureMappingRoughness
- kA3DTextureMappingOcclusion
Two combinations of these flags are also provided for simplicity, as these data are often packed in a single texture:
If a kA3DTextureMappingMetallnessRoughnessOcclusion texture is used, its components are packed with:
- red = occlusion
- green = roughness
- blue = metallness
The base color and emissive color constants are A3DGraphRgbColorData provided through the m_uiDiffuse and m_uiEmissive members of the A3DGraphMaterialData structure.
The other constants are provided as A3DMiscAttribute attached to the A3DGraphMaterialData:
constant | name | type |
---|---|---|
alpha cut-off | "AlphaCutOff" | A3DDouble |
alpha mode | "AlphaMode" | A3DInt32 |
metallness | "MetallicFactor" | A3DDouble |
normals | "NormalTextureFactor" | A3DDouble |
occlusion | "OcclusionTextureFactor" | A3DDouble |
roughness | "RoughnessFactor" | A3DDouble |
The alpha mode values are defined in A3DETextureAlphaMode.
Each attribute contains a single A3DMiscSingleAttributeData of type kA3DModellerAttributeTypeReal (see A3DEModellerAttributeType).
If both texture and constant are provided for a given type, the constant is used as a texel multiplier.
Pseudocode to access these attributes:
Field Documentation
A3DUns32 A3DGraphMaterialData::m_uiAmbient |
Ambient color.
A3DUns32 A3DGraphMaterialData::m_uiDiffuse |
Diffuse color.
A3DUns32 A3DGraphMaterialData::m_uiEmissive |
Emissive color.
A3DUns32 A3DGraphMaterialData::m_uiSpecular |
Specular color.
A3DDouble A3DGraphMaterialData::m_dAmbientAlpha |
Ambient alpha value. Not yet implemented. Use A3DGraphStyleData::m_ucTransparency instead.
A3DDouble A3DGraphMaterialData::m_dDiffuseAlpha |
Diffuse alpha value. Not yet implemented. Use A3DGraphStyleData::m_ucTransparency instead.
A3DDouble A3DGraphMaterialData::m_dEmissiveAlpha |
Emissive alpha value. Not yet implemented. Use A3DGraphStyleData::m_ucTransparency instead.
A3DDouble A3DGraphMaterialData::m_dSpecularAlpha |
Specular alpha value. Not yet implemented. Use A3DGraphStyleData::m_ucTransparency instead.
A3DDouble A3DGraphMaterialData::m_dShininess |
Shininess. Valid values are between 0.0 and 1.0.