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
- metalness
- roughness
- occlusion
The textures can have the following types (see m_uiMappingAttributes in A3DGraphTextureDefinitionData):
- kA3DTextureMappingDiffuse
- kA3DTextureMappingEmission
- kA3DTextureMappingNormal
- kA3DTextureMappingMetalness
- kA3DTextureMappingRoughness
- kA3DTextureMappingOcclusion
Two combinations of these flags are also provided for simplicity, as these data are often packed in a single texture:
If a kA3DTextureMappingMetalnessRoughnessOcclusion texture is used, its components are packed with:
- red = occlusion
- green = roughness
- blue = metalness
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 | kA3DPBRAttributeNameAlphaCutOff | A3DDouble |
alpha mode | kA3DPBRAttributeNameAlphaMode | A3DInt32 |
metalness | kA3DPBRAttributeNameMetallicFactor | A3DDouble |
normals | kA3DPBRAttributeNameNormalTextureFactor | A3DDouble |
occlusion | kA3DPBRAttributeNameOcclusionTextureFactor | A3DDouble |
roughness | kA3DPBRAttributeNameRoughnessFactor | A3DDouble |
The alpha mode values are defined in A3DETextureAlphaMode.
Each attribute contains a single A3DMiscSingleAttributeData of type kA3DModellerAttributeTypeReal or kA3DModellerAttributeTypeInt (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
◆ m_uiAmbient
A3DUns32 A3DGraphMaterialData::m_uiAmbient |
Ambient color.
◆ m_uiDiffuse
A3DUns32 A3DGraphMaterialData::m_uiDiffuse |
Diffuse color.
◆ m_uiEmissive
A3DUns32 A3DGraphMaterialData::m_uiEmissive |
Emissive color.
◆ m_uiSpecular
A3DUns32 A3DGraphMaterialData::m_uiSpecular |
Specular color.
◆ m_dAmbientAlpha
A3DDouble A3DGraphMaterialData::m_dAmbientAlpha |
Ambient alpha value. Not yet implemented. Use A3DGraphStyleData::m_ucTransparency instead.
◆ m_dDiffuseAlpha
A3DDouble A3DGraphMaterialData::m_dDiffuseAlpha |
Diffuse alpha value. Not yet implemented. Use A3DGraphStyleData::m_ucTransparency instead.
◆ m_dEmissiveAlpha
A3DDouble A3DGraphMaterialData::m_dEmissiveAlpha |
Emissive alpha value. Not yet implemented. Use A3DGraphStyleData::m_ucTransparency instead.
◆ m_dSpecularAlpha
A3DDouble A3DGraphMaterialData::m_dSpecularAlpha |
Specular alpha value. Not yet implemented. Use A3DGraphStyleData::m_ucTransparency instead.
◆ m_dShininess
A3DDouble A3DGraphMaterialData::m_dShininess |
Shininess. Valid values are between 0.0 and 1.0.