Click or drag to resize

Material Class

A material contains all the information that describes how to render a mesh. E.g. textures, colors, and render states. Internally all this information is stored as key-value pair properties. The class contains many convienence methods and properties for accessing non-texture/texture properties without having to know the Assimp material key names. Not all properties may be present, and if they aren't a default value will be returned.
Inheritance Hierarchy
SystemObject
  Internal.AssimpMaterial

Namespace: Internal.Assimp
Assembly: NeoAxis.Core (in NeoAxis.Core.dll) Version: 2026.2.1.0 (2026.2.1.0)
Syntax
C#
public sealed class Material : IMarshalable<Material, AiMaterial>

The Material type exposes the following members.

Constructors
 NameDescription
Public methodMaterial Constructs a new instance of the Material class.
Top
Properties
 NameDescription
Public propertyBlendMode Gets the blending mode. Default value is Default.
Public propertyBumpScaling Gets the bump scaling. Default value is 0.0f;
Public propertyColorAmbient Gets the color ambient. Default value is (.2f, .2f, .2f, 1.0f).
Public propertyColorDiffuse Gets the color diffuse. Default value is white.
Public propertyColorEmissive Gets the color emissive. Default value is black.
Public propertyColorReflective Gets the color reflective. Default value is black.
Public propertyColorSpecular Gets the color specular. Default value is black.
Public propertyColorTransparent Gets the color transparent. Default value is black.
Public propertyHasBlendMode Checks if the material has a blend mode property.
Public propertyHasBumpScaling Checks if the material has a bump scaling property.
Public propertyHasColorAmbient Checks if the material has a color ambient property.
Public propertyHasColorDiffuse Checks if the material has a color diffuse property.
Public propertyHasColorEmissive Checks if the material has a color emissive property.
Public propertyHasColorReflective Checks if the material has a color reflective property.
Public propertyHasColorSpecular Checks if the material has a color specular property.
Public propertyHasColorTransparent Checks if the material has a color transparent property.
Public propertyHasName Checks if the material has a name property.
Public propertyHasOpacity Checks if the material has an opacity property.
Public propertyHasReflectivity Checks if the material has a reflectivty property.
Public propertyHasShaders Gets if the material has embedded shader source code.
Public propertyHasShadingMode Checks if the material has a shading-mode property.
Public propertyHasShininess Checks if the material has a shininess property.
Public propertyHasShininessStrength Checks if the material has a shininess strength property.
Public propertyHasTextureAmbient Gets if the material has a ambient texture in the first texture index.
Public propertyHasTextureAmbientOcclusion Gets if the material has an ambient occlusion map in in the first texture index.
Public propertyHasTextureDiffuse Gets if the material has a diffuse texture in the first texture index.
Public propertyHasTextureDisplacement Gets if the material has a displacement texture in the first texture index.
Public propertyHasTextureEmissive Gets if the material has a emissive texture in the first texture index.
Public propertyHasTextureHeight Gets if the material has a height texture in the first texture index.
Public propertyHasTextureLightMap Gets if the material has a light map texture in the first texture index.
Public propertyHasTextureNormal Gets if the material has a normal texture in the first texture index.
Public propertyHasTextureOpacity Gets if the material has an opacity texture in the first texture index.
Public propertyHasTextureReflection Gets if the material has a reflection texture in the first texture index.
Public propertyHasTextureSpecular Gets if the material has a specular texture in the first texture index.
Public propertyHasTransparencyFactor Checks if the material has a transparency factor property.
Public propertyHasTwoSided Checks if the material has a two-sided property.
Public propertyHasWireFrame Checks if the material has a wireframe property.
Public propertyIsPBRMaterial Determines if the material is part of a PBR workflow or not.
Public propertyIsTwoSided Gets if the material should be rendered as two-sided. Default value is false.
Public propertyIsWireFrameEnabled Gets if wireframe should be enabled. Default value is false.
Public propertyName Gets the material name value, if any. Default value is an empty string.
Public propertyOpacity Gets the opacity. Default value is 1.0f.
Public propertyPBR Gets a group accessor for any PBR properties in the material.
Public propertyPropertyCount Gets the number of properties contained in the material.
Public propertyReflectivity Gets the reflectivity. Default value is 0.0f;
Public propertyShaders Gets a group accessor for any embedded shader source code in the material.
Public propertyShadingMode Gets the shading mode. Default value is None, meaning it is not defined.
Public propertyShininess Gets the shininess. Default value is 0.0f;
Public propertyShininessStrength Gets the shininess strength. Default vaulue is 1.0f.
Public propertyTextureAmbient Gets or sets ambient texture properties in the first texture index.
Public propertyTextureAmbientOcclusion Gets or sets ambient occlusion texture properties in the first texture index.
Public propertyTextureDiffuse Gets or sets diffuse texture properties in the first texture index.
Public propertyTextureDisplacement Gets or sets displacement texture properties in the first texture index.
Public propertyTextureEmissive Gets or sets emissive texture properties in the first texture index.
Public propertyTextureHeight Gets or sets height texture properties in the first texture index.
Public propertyTextureLightMap Gets or sets light map texture properties in the first texture index.
Public propertyTextureNormal Gets or sets normal texture properties in the first texture index.
Public propertyTextureOpacity Gets or sets opacity texture properties in the first texture index.
Public propertyTextureReflection Gets or sets reflection texture properties in the first texture index.
Public propertyTextureSpecular Gets or sets specular texture properties in the first texture index.
Public propertyTransparencyFactor Gets the transparency factor. This is used to make a surface more or less opaque (0 = opaque, 1 = transparent). Default value is 0.0f.
Top
Methods
 NameDescription
Public methodAddMaterialTexture(TextureSlot) Adds a texture to the material - this bulk creates a property for each field. This will either create properties or overwrite existing properties. If the texture has no file path, nothing is added.
Public methodAddMaterialTexture(TextureSlot, Boolean) Adds a texture to the material - this bulk creates a property for each field. This will either create properties or overwrite existing properties. If the texture has no file path, nothing is added.
Public methodAddProperty Adds a property to this material.
Public methodClear Removes all properties from the material;
Public methodStatic memberCreateFullyQualifiedName Helper method to construct a fully qualified name from the input parameters. All the input parameters are combined into the fully qualified name: {baseName},{texType},{texIndex}. E.g. "$clr.diffuse,0,0" or "$tex.file,1,0". This is the name that is used as the material dictionary key.
Public methodEqualsDetermines whether the specified object is equal to the current object.
(Inherited from Object)
Public methodStatic memberFreeNative Frees unmanaged memory created by ToNative(IntPtr, Native).
Public methodGetAllProperties Gets -all- properties contained in the Material.
Public methodGetHashCodeServes as the default hash function.
(Inherited from Object)
Public methodGetMaterialTexture Gets a texture that corresponds to the type/index.
Public methodGetMaterialTextureCount Gets all the number of textures that are of the specified texture type.
Public methodGetMaterialTextures Gets all textures that correspond to the type.
Public methodGetNonTextureProperty Gets the non-texture properties contained in this Material. The name should be the "base name", as in it should not contain texture type/texture index information. E.g. "$clr.diffuse" rather than "$clr.diffuse,0,0". The extra data will be filled in automatically.
Public methodGetProperty(String) Gets the material property by its fully qualified name. The format is: {baseName},{texType},{texIndex}. E.g. "$clr.diffuse,0,0" or "$tex.file,1,0".
Public methodGetProperty(String, TextureType, Int32) Gets the material property. All the input parameters are combined into the fully qualified name: {baseName},{texType},{texIndex}. E.g. "$clr.diffuse,0,0" or "$tex.file,1,0".
Public methodGetTypeGets the Type of the current instance.
(Inherited from Object)
Public methodHasNonTextureProperty Checks if the material has the specified non-texture property. The name should be the "base name", as in it should not contain texture type/texture index information. E.g. "$clr.diffuse" rather than "$clr.diffuse,0,0". The extra data will be filled in automatically.
Public methodHasProperty(String) Checks if the material has the specified property by looking up its fully qualified name. The format is: {baseName},{texType},{texIndex}. E.g. "$clr.diffuse,0,0" or "$tex.file,1,0".
Public methodHasProperty(String, TextureType, Int32) Checks if the material has the specified property. All the input parameters are combined into the fully qualified name: {baseName},{texType},{texIndex}. E.g. "$clr.diffuse,0,0" or "$tex.file,1,0".
Public methodRemoveMaterialTexture Removes a texture from the material - this bulk removes a property for each field. If the texture has no file path, nothing is removed
Public methodRemoveNonTextureProperty Removes a non-texture property from the material.
Public methodRemoveProperty(String) Removes a property from the material.
Public methodRemoveProperty(String, TextureType, Int32) Removes a property from the material.
Public methodToStringReturns a string that represents the current object.
(Inherited from Object)
Top
Extension Methods
 NameDescription
Public Extension MethodMethodInvoke Calls the object method by name.
(Defined by ObjectEx)
Public Extension MethodPropertyGet Gets the value of the object property by name.
(Defined by ObjectEx)
Public Extension MethodPropertyGetT Gets the value of the object property by name.
(Defined by ObjectEx)
Public Extension MethodPropertySet Sets the value of the object property by name.
(Defined by ObjectEx)
Top
See Also