Face |
public class FaceColorMaterial : Material, IFaceColorMaterial, IDiffuseMaterial, ITransparentMaterial, IEmissiveMaterial, ISpecularMaterial, ITwoSidedMaterial
The FaceColorMaterial type exposes the following members.
Name | Description | |
---|---|---|
FaceColorMaterial | Constructor | |
FaceColorMaterial(Color4) | Constructor |
Name | Description | |
---|---|---|
Alpha | Gets or sets a float value that defines the alpha value for the material. | |
AmbientColor | Gets or sets a Color3 that specifies an color that defines how much ambient color is reflected by this material. | |
CreateDynamicBuffer | 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. | |
DiffuseColor | Gets or sets a Color3 that specifies the diffuse color of this material. | |
EmissiveColor | Gets or sets a Color3 that that represents the emissive color - the color of the object regardless of the lights. | |
FaceColors | Gets or sets the Color4 array that specifies the colors for each face (triangle) of the object. | |
FaceColorsShaderResourceView | Gets the ShaderResourceView that is created from FaceColors array. | |
HasOnlyEmissiveColor | Gets or sets a Boolean that specifies if this material has only emissive color. If false than other material properties are also defined. | |
HasSpecularColor | Gets a boolean that specifies if this material is using specular effect. | |
HasTransparency | Gets a boolean that specifies if this material is semi-transparent and needs to be alpha blended with the scene. | |
IsPreMultipliedAlphaColor | 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. | |
IsTwoSided | Gets or sets a Boolean that specifies if the material should be rendered on both front and back side. Default value is false. | |
SpecularColor | Gets the Color3 that specifies the color used to draw the specular highlight effect. | |
SpecularPower | Gets a float that specifies the power of the specular effect. Zero values means that the specular effect is turned off. |
Name | Description | |
---|---|---|
ToString |
ToString
(Overrides MaterialToString) | |
Update | Update method updates the DirectX vertex buffer from the current values of FaceColors. |
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.