Struct XMaterial
- Namespace
- OmegaEngine.Graphics
- Assembly
- OmegaEngine.dll
A combination of textures and lighting parameters.
public struct XMaterial : IEquatable<XMaterial>
- Implements
- Extension Methods
Remarks
Constructors
XMaterial()
A plain white untextured material.
public XMaterial()
XMaterial(ITextureProvider?)
public XMaterial(ITextureProvider? diffuse)
Parameters
diffuseITextureProvider
XMaterial(Color)
A combination of textures and lighting parameters.
public XMaterial(Color Diffuse)
Parameters
DiffuseColorThe color of the material when hit by diffuse light (normal lighting).
Remarks
Fields
Default
A plain white untextured material.
public static readonly XMaterial Default
Field Value
Properties
Ambient
The color of the material when lit by ambient/background light (always active)
public Color Ambient { readonly get; set; }
Property Value
Diffuse
The color of the material when hit by diffuse light (normal lighting)
public Color Diffuse { readonly get; set; }
Property Value
DiffuseMap
The primary diffuse texture map
public ITextureProvider? DiffuseMap { readonly get; set; }
Property Value
DiffuseMaps
The diffuse textures maps
public ImmutableArray<ITextureProvider?> DiffuseMaps { readonly get; set; }
Property Value
Emissive
The color of the light this material emits by itself
public Color Emissive { readonly get; set; }
Property Value
EmissiveFactor
A shader-specific parameter controlling the application of emissive lighting (usually how quickly emissive light fades out as the surface turns towards a light source)
public float EmissiveFactor { readonly get; set; }
Property Value
EmissiveMap
The emissive (which spots are self-shining without an external light source)
public ITextureProvider? EmissiveMap { readonly get; set; }
Property Value
Glow
The color of this material glows in, bleeding over edges
public Color Glow { readonly get; set; }
Property Value
GlowMap
The glow map (which spots glow, bleeding over edges)
public ITextureProvider? GlowMap { readonly get; set; }
Property Value
HeightMap
The height map (an optional addition to the normal map)
public ITextureProvider? HeightMap { readonly get; set; }
Property Value
IsTextured
Indicates whether this material uses textures
public bool IsTextured { get; }
Property Value
NeedsTBN
Indicates whether this material requires TBN (tangent, bitangent, normal) vectors
public bool NeedsTBN { get; }
Property Value
NormalMap
The normal map (i.e. bump map)
public ITextureProvider? NormalMap { readonly get; set; }
Property Value
Specular
The color of specular (shiny) highlights on the material surface
public Color Specular { readonly get; set; }
Property Value
SpecularMap
The specular map (which spots are "shiny")
public ITextureProvider? SpecularMap { readonly get; set; }
Property Value
SpecularPower
The sharpness of specular highlights (higher value = sharper, smaller highlight)
public float SpecularPower { readonly get; set; }
Property Value
Remarks
Defaults to match the exponent hardcoded in the surface shaders, so the fixed-function pipeline and shaders produce comparable highlights.
Methods
Deconstruct(out Color)
public readonly void Deconstruct(out Color Diffuse)
Parameters
DiffuseColor
Equals(XMaterial)
public readonly bool Equals(XMaterial other)
Parameters
otherXMaterial
Returns
Equals(object)
public override readonly bool Equals(object obj)
Parameters
objobject
Returns
GetHashCode()
public override readonly int GetHashCode()
Returns
HoldReference()
Calls HoldReference() for all contained XTextures.
public readonly void HoldReference()
ReleaseReference()
Calls ReleaseReference() for all contained XTextures.
public void ReleaseReference()
ToString()
public override string ToString()
Returns
Operators
operator ==(XMaterial, XMaterial)
public static bool operator ==(XMaterial left, XMaterial right)
Parameters
Returns
implicit operator XMaterial(XTexture)
public static implicit operator XMaterial(XTexture texture)
Parameters
textureXTexture
Returns
operator !=(XMaterial, XMaterial)
public static bool operator !=(XMaterial left, XMaterial right)