Click or drag to resize
Ab4d.SharpEngine logo

StandardMaterial Class

StandardMaterial is a material that defines the standard properties to show the diffuse, specular and emissive material properties. It is possible to create a texture by using CreateDiffuseTexture(RawImageData, CommonSamplerTypes, String, Single) method. To lazily load a texture use constructor that takes file name, file stream or RawImageData. It is also possible to load texture by calling LoadDiffuseTexture method.
Inheritance Hierarchy

Namespace: Ab4d.SharpEngine.Materials
Assembly: Ab4d.SharpEngine (in Ab4d.SharpEngine.dll) Version: 1.0.8740+deb2991acfe86a95cca780cd4f82bcae2805c1a5
Syntax
C#
public class StandardMaterial : StandardMaterialBase, 
	ISpecularMaterial, IEmissiveMaterial

The StandardMaterial type exposes the following members.

Constructors
 NameDescription
Public methodStandardMaterial(String) Constructor
Public methodStandardMaterial(Color3, String) StandardMaterial constructor with a diffuse color (Opacity is 1)
Public methodStandardMaterial(Color4, String) StandardMaterial constructor with diffuse color and opacity specified in Color4 struct (opacity is set from color's alpha value).
Public methodStandardMaterial(Color3, Single, String) StandardMaterial constructor with a diffuse color and an opacity value
Public methodStandardMaterial(GpuImage, CommonSamplerTypes, String) StandardMaterial constructor with diffuse texture. The textureImage is not disposed when disposing this material.
Public methodStandardMaterial(Color3, Single, Single, String) StandardMaterial constructor with a diffuse color and an opacity value
Public methodStandardMaterial(String, IBitmapIO, CommonSamplerTypes, Single, String) StandardMaterial constructor with file name of the diffuse texture. The texture will be lazily loaded when this material will be initialized. When the created GpuImage is not cached by the Scene (defined by static UseSceneCacheForTextures) or GpuDevice (defined by static UseGpuDeviceCacheForTextures), then it is disposed when this Material is disposed.
Public methodStandardMaterial(Stream, String, IBitmapIO, CommonSamplerTypes, Single, String) StandardMaterial constructor with file stream of the diffuse texture. The texture will be lazily loaded when this material will be initialized. When the created GpuImage is not cached by the Scene (defined by static UseSceneCacheForTextures) or GpuDevice (defined by static UseGpuDeviceCacheForTextures), then it is disposed when this Material is disposed.
Top
Properties
 NameDescription
Public propertyEmissiveColor Gets or sets a Color3 that that represents the emissive color - the color of the object regardless of the lights.
Public propertyHasSpecularColor Gets a boolean that specifies if this material is using specular effect.
Public propertySpecularColor Gets or sets the Color3 that specifies the color used to draw the specular highlight effect. Default value is Color3.White.
Public propertySpecularPower Gets or sets a float that specifies the power of the specular effect. Zero value (by default) means that the specular effect is turned off.
Top
Methods
 NameDescription
Protected methodCreateClone
(Overrides MaterialCreateClone)
Public methodGetDetailsText GetDetailsText adds string that writes details about this Material into the specified StringBuilder.
(Overrides StandardMaterialBaseGetDetailsText(StringBuilder, Boolean, Boolean, Boolean))
Protected methodOnInitializeSceneResources Initializes resources with the specified Scene and GpuDevice. This method can be override and is called from InitializeSceneResources(Scene) method.
(Overrides StandardMaterialBaseOnInitializeSceneResources(Scene, VulkanDevice))
Public methodSetOpacity Sets Opacity and returns StandardMaterial so we can chain the calls to change material. This method can be used with materials defined in StandardMaterials class.
Public methodSetSpecular(Single) Sets SpecularPower to the specified value and SpecularColor to White. Method returns StandardMaterial so we can chain the calls to change material. This method can be used with materials defined in StandardMaterials class.
Public methodSetSpecular(Color3, Single) Sets SpecularColor and SpecularPower and returns StandardMaterial so we can chain the calls to change material. This method can be used with materials defined in StandardMaterials class.
Top
See Also