Click or drag to resize
Ab4d.SharpEngine logo

SolidColorMaterial Class

SolidColorMaterial is a material that is not shaded by lighting and is always rendered exactly as specified by the diffuse material properties. This means that positions and colors of the lights do not change the appearance. 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 and IBitmapIO or call LoadDiffuseTexture(String, IBitmapIO, CommonSamplerTypes, Single, Boolean, Boolean, Boolean) method. To immediately load the texture use the LoadDiffuseTexture(Scene, String, IBitmapIO, CommonSamplerTypes, Single, Boolean, Boolean) or LoadDiffuseTexture(VulkanDevice, String, IBitmapIO, CommonSamplerTypes, Single, Boolean) methods.
Inheritance Hierarchy

Namespace: Ab4d.SharpEngine.Materials
Assembly: Ab4d.SharpEngine (in Ab4d.SharpEngine.dll) Version: 4.0.9584+ba1aaa26d4181dd3fa8ed7b6398391d1affa36c8
Syntax
C#
public class SolidColorMaterial : StandardMaterialBase, 
	ISolidColorMaterial

The SolidColorMaterial type exposes the following members.

Constructors
 NameDescription
Public methodSolidColorMaterial(String) SolidColorMaterial constructor.
Public methodSolidColorMaterial(Color3, String) SolidColorMaterial constructor with a diffuse color (Opacity is 1)
Public methodSolidColorMaterial(Color4, String) SolidColorMaterial constructor with diffuse color and opacity specified in Color4 struct (opacity is set from color's alpha value). The color is not alpha pre-multiplied.
Public methodSolidColorMaterial(Color3, Single, String) SolidColorMaterial constructor with a diffuse color and an opacity value
Public methodSolidColorMaterial(GpuImage, CommonSamplerTypes, String) StandardMaterial constructor with diffuse texture. The textureImage is not disposed when disposing this material.
Public methodSolidColorMaterial(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. The loaded texture is disposed when disposing this material. This constructor does not have loadInBackground and initialDiffuseColor (as the one that takes textureFileName) because this would require that the fileStream is not closed until the texture is loaded (but there is no callback to the user to do that).
Public methodSolidColorMaterial(String, IBitmapIO, CommonSamplerTypes, Single, NullableColor4, Boolean, String) StandardMaterial constructor with file name of the diffuse texture. The texture will be lazily loaded when this material will be initialized. The loaded texture is disposed when disposing this material.
Top
Properties
 NameDescription
Public propertyIsSolidColor Always returns true because this material is always rendered as a solid color without any shading from lights.
Top
Methods
 NameDescription
Protected methodCreateClone
(Overrides StandardMaterialBaseCreateClone)
Protected methodOnInitializeSceneResources Initializes resources with the specified Scene and GpuDevice. This method can be overriden and is called from InitializeSceneResources(Scene) method.
(Overrides StandardMaterialBaseOnInitializeSceneResources(Scene, VulkanDevice))
Top
See Also