Click or drag to resize
AB4D logo

FaceColorMaterial Class

FaceColorMaterial can be used to render 3D objects with specifying color for each of its face (triangle). The face colors are provided with the FaceColors array (each array element provides Color4 for the triangle with the same index). When color's alpha value is below 0.01, then the whole triangle is discarded and will not be rendered.
Inheritance Hierarchy
SystemObject
  Ab3d.DirectXDXResourceBase
    Ab3d.DirectXSharedDXResource
      Ab3d.DirectXSharedDXDeviceResource
        Ab3d.DirectXMaterial
          Ab3d.DirectX.MaterialsFaceColorMaterial

Namespace: Ab3d.DirectX.Materials
Assembly: Ab3d.DXEngine (in Ab3d.DXEngine.dll) Version: 7.0.8865.1045
Syntax
C#
public class FaceColorMaterial : Material, 
	IFaceColorMaterial, IDiffuseMaterial, ITransparentMaterial, IEmissiveMaterial, ISpecularMaterial, 
	ITwoSidedMaterial

The FaceColorMaterial type exposes the following members.

Constructors
 NameDescription
Public methodFaceColorMaterial Constructor
Public methodFaceColorMaterial(Color4) Constructor
Top
Properties
 NameDescription
Public propertyAlpha Gets or sets a float value that defines the alpha value for the material.
Public propertyAmbientColor Gets or sets a Color3 that specifies an color that defines how much ambient color is reflected by this material.
Public propertyCreateDynamicBuffer Gets or sets a Boolean that specifies if a dynamic buffer will be created from the FaceColors array. This can be used in case when the colors change very often.
Public propertyDiffuseColor Gets or sets a Color3 that specifies the diffuse color of this material.
Public propertyEmissiveColor Gets or sets a Color3 that that represents the emissive color - the color of the object regardless of the lights.
Public propertyFaceColors Gets or sets the Color4 array that specifies the colors for each face (triangle) of the object.
Public propertyFaceColorsShaderResourceView Gets the ShaderResourceView that is created from FaceColors array.
Public propertyHasOnlyEmissiveColor Gets or sets a Boolean that specifies if this material has only emissive color. If false than other material properties are also defined.
Public propertyHasSpecularColor Gets a boolean that specifies if this material is using specular effect.
Public propertyHasTransparency Gets a boolean that specifies if this material is semi-transparent and needs to be alpha blended with the scene.
Public propertyIsPreMultipliedAlphaColor When IsPreMultipliedAlphaColor is true (false by default) and Alpha is less then 1, then the color components of the DiffuseColor are already multiplied with alpha value to produce pre-multiplied colors. When false, then non-pre-multiplied color is converted in pre-multiplied color when this is required by the shader.
Public propertyIsTwoSided Gets or sets a Boolean that specifies if the material should be rendered on both front and back side. Default value is false.
Public propertySpecularColor Gets the Color3 that specifies the color used to draw the specular highlight effect.
Public propertySpecularPower Gets a float that specifies the power of the specular effect. Zero values means that the specular effect is turned off.
Top
Methods
 NameDescription
Public methodToString ToString
(Overrides MaterialToString)
Public methodUpdate Update method updates the DirectX vertex buffer from the current values of FaceColors.
Top
Remarks

FaceColorMaterial can be used to render 3D objects with specifying color for each of its face (triangle).

The face colors are provided with the FaceColors array (each array element provides Color4 for the triangle with the same index). When color's alpha value is below 0.01, then the whole triangle is discarded and will not be rendered.

When values in the FaceColors array are changed, you need to call Update method to update the DirectX resources.

See Also