Click or drag to resize
Ab4d.SharpEngine logo

Material Class

Material is a base abstract class that defines the common properties for all material objects.
Inheritance Hierarchy

Namespace: Ab4d.SharpEngine.Materials
Assembly: Ab4d.SharpEngine (in Ab4d.SharpEngine.dll) Version: 1.0.8740+deb2991acfe86a95cca780cd4f82bcae2805c1a5
Syntax
C#
public abstract class Material : InitializedSceneComponent, 
	IDisposable

The Material type exposes the following members.

Constructors
 NameDescription
Protected methodMaterial Constructor
Top
Properties
 NameDescription
Public propertyEffect Gets or sets the Effect that is used to render this material.
Public propertyMaterialBlockIndex 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).
Public propertyMaterialIndex 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).
Public propertyVersion 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)
Top
Methods
 NameDescription
Public methodClone 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).
Protected methodCreateClone
(Overrides InitializedSceneComponentCreateClone)
Public methodDispose Disposes all resources that are used by this material.
Protected methodDispose(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))
Public methodGetDetailsText(Boolean, Boolean, Boolean) GetDetailsText return string with details about this Material.
Public methodGetDetailsText(StringBuilder, Boolean, Boolean, Boolean) GetDetailsText adds string that writes details about this Material into the specified StringBuilder.
Protected methodNotifyMaterialBufferChange NotifyMaterialBufferChange sets the MaterialBufferChanged and adds the material to the update queue.
Protected methodNotifyMaterialChange NotifyMaterialBufferChange sets the MaterialChanged, updates the Version number and adds the material to the update queue.
Protected methodNotifyMaterialComplexChange NotifyMaterialBufferChange sets the MaterialComplexChange and adds the material to the update queue.
Protected methodOnEffectChanged OnEffectChanged is called after the effect is changed - overridden methods can return false to prevent the change of effect.
Protected methodOnInitializeSceneResources Initializes resources with the specified Scene and GpuDevice. This method can be override and is called from InitializeSceneResources(Scene) method.
(Overrides InitializedSceneComponentOnInitializeSceneResources(Scene, VulkanDevice))
Protected methodOnMaterialChanged OnMaterialChanged
Public methodRefresh Refresh method regenerates the material and the resources it created.
Protected methodSetMaterialBlock Sets MaterialBlockIndex and MaterialIndex properties. This can be also done by calling protected SetMaterialBlock method from Effect class.
Public methodToString Returns a String that represents this instance.
(Overrides ObjectToString)
Public methodUpdate 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.
Top
Events
 NameDescription
Public eventMaterialChanged MaterialChanged
Top
See Also