Material Class |
public abstract class Material : InitializedSceneComponent, IDisposable
The Material type exposes the following members.
Name | Description | |
---|---|---|
Effect | Gets or sets the Effect that is used to render this material. | |
MaterialBlockIndex | Indexed of the memory block that holds the material data at MaterialIndex. This value may be set only by the effect that will render this material (this is done by calling protected SetMaterialBlock(Int32, Int32) method). | |
MaterialIndex | An index within the material buffer that contains the data for the shader. This value may be set only by the effect that will render this material (this is done by calling protected SetMaterialBlock(Int32, Int32) method). | |
Version | Gets the version number of this Material. Version is increased each time the material is changed. Note: When material is changed a lot of times, the Version value can overflow from positive to negative numbers (to prevent problems do not check for bigger value but for not equal value) |
Name | Description | |
---|---|---|
Clone | Clones the current material with creating a shallow copy of this Material (cloned material has new Id; other properties are copied but referenced objects are preserved). | |
CreateClone | (Overrides InitializedSceneComponentCreateClone) | |
Dispose | Disposes all resources that are used by this material. | |
Dispose(Boolean) |
Releases unmanaged and managed resources (when disposing is true).
This method may be called only from the CheckAndDispose(Boolean) method and must not be called manually by the user.
(Overrides ComponentBaseDispose(Boolean)) | |
GetDetailsText(Boolean, Boolean, Boolean) | GetDetailsText return string with details about this Material. | |
GetDetailsText(StringBuilder, Boolean, Boolean, Boolean) | GetDetailsText adds string that writes details about this Material into the specified StringBuilder. | |
NotifyMaterialBufferChange | NotifyMaterialBufferChange sets the MaterialBufferChanged and adds the material to the update queue. | |
NotifyMaterialChange | NotifyMaterialBufferChange sets the MaterialChanged, updates the Version number and adds the material to the update queue. | |
NotifyMaterialComplexChange | NotifyMaterialBufferChange sets the MaterialComplexChange and adds the material to the update queue. | |
OnEffectChanged | OnEffectChanged is called after the effect is changed - overridden methods can return false to prevent the change of effect. | |
OnInitializeSceneResources |
Initializes resources with the specified Scene and GpuDevice.
This method can be override and is called from InitializeSceneResources(Scene) method.
(Overrides InitializedSceneComponentOnInitializeSceneResources(Scene, VulkanDevice)) | |
OnMaterialChanged | OnMaterialChanged | |
ProcessMeshDataChannels | ProcessMeshDataChannels can be overriden by a derived class to provide logic to process custom mesh data channels (for example, create GpuBuffer for vertex color data). | |
Refresh | Refresh method regenerates the material and the resources it created. | |
SetMaterialBlock | Sets MaterialBlockIndex and MaterialIndex properties. This can be also done by calling protected SetMaterialBlock method from Effect class. | |
ToString |
Returns a String that represents this instance.
(Overrides ObjectToString) | |
Update | Update method is called before every rendering and updates the graphics buffers and states objects based on the current value of properties in this Material. |
Name | Description | |
---|---|---|
MaterialChanged | MaterialChanged |