Vertex |
public class VertexColorMaterial : Material, ITransparentMaterial, IVertexColorMaterial
The VertexColorMaterial type exposes the following members.
Name | Description | |
---|---|---|
VertexColorMaterial(String) | Constructor | |
VertexColorMaterial(Color4, String) | Constructor | |
VertexColorMaterial(Color4, Boolean, String) | Constructor |
Name | Description | |
---|---|---|
HasTransparency | Gets a boolean that specifies if this material is semi-transparent and needs to be alpha blended with the scene. | |
PositionColors | Gets or sets the Color4 array that specifies the colors for each position of the object. When the values in this array are changed after the material has already been initialized, then the UpdatePositionColors method must be called to update the VertexColorsBuffer. | |
VertexColorsBuffer | Gets a GpuBuffer for an array of Color4 values where each value represents a color of one position (vertex). |
Name | Description | |
---|---|---|
CreateClone | (Overrides MaterialCreateClone) | |
Dispose |
Dispose
(Overrides MaterialDispose(Boolean)) | |
OnEffectChanged |
OnEffectChanged is called after the effect is changed - overridden methods can return false to prevent the change of effect.
(Overrides MaterialOnEffectChanged(Effect, Effect)) | |
OnInitializeSceneResources |
Initializes resources with the specified Scene and GpuDevice.
This method can be override and is called from InitializeSceneResources(Scene) method.
(Overrides MaterialOnInitializeSceneResources(Scene, VulkanDevice)) | |
UpdatePositionColors | UpdatePositionColors must be called when the values in the PositionColors array are changed. | |
UpdatePositionColorsTransparency | UpdatePositionColorsTransparency method check if any color in the PositionColors has Alpha value less than 1 and sets HasTransparency accordingly. |
VertexColorMaterial can be used to render 3D objects with specifying color for each of its position.
The colors of each position is specified in the PositionColors array.
When values in the PositionColors array are changed, you need to call UpdatePositionColors method to update the DirectX resources.