M&B: Bannerlord 1.0.0
The horns sound, the ravens gather.
Loading...
Searching...
No Matches
TaleWorlds.Engine.Material Class Reference

Representation of the material in the Mono domain MBMaterial provides methods related to texture, shader, and other material properties

Inherits TaleWorlds.Engine.Resource.

Public Types

enum  MBTextureType
 Types of texture regarding its usage in the related shader More...
 
enum  MBAlphaBlendMode : byte
 Types of alpha blend modes available for MBMaterial More...
 

Public Member Functions

Material CreateCopy ()
 Creates a copy this MBMaterial Added as a convenience method Same as new MBMaterial(this) More...
 
void SetShader (Shader shader)
 Sets the material shader More...
 
Shader GetShader ()
 Returns the assigned MBShader More...
 
UInt64 GetShaderFlags ()
 
void SetShaderFlags (UInt64 flagEntry)
 
void SetMeshVectorArgument (float x, float y, float z, float w)
 
void SetTexture (MBTextureType textureType, Texture texture)
 Sets the texture to the texture slot specified by 'textureType' More...
 
void SetTextureAtSlot (int textureSlot, Texture texture)
 
void SetAreaMapScale (float scale)
 
void SetEnableSkinning (bool enable)
 
bool UsingSkinning ()
 
Texture GetTexture (MBTextureType textureType)
 Returns the texture assigned to 'textureType' slot More...
 
MBAlphaBlendMode GetAlphaBlendMode ()
 Returns the alpha blend mode of the material More...
 
void SetAlphaBlendMode (MBAlphaBlendMode alphaBlendMode)
 Sets the alpha blend mode of this MBMaterial More...
 
void SetAlphaTestValue (float alphaTestValue)
 Sets the alpha test value of this MBMaterial More...
 
float GetAlphaTestValue ()
 Gets the alpha test value of this MBMaterial More...
 
void AddMaterialShaderFlag (String flagName, bool showErrors)
 

Static Public Member Functions

static Material GetDefaultMaterial ()
 
static Material GetOutlineMaterial (Mesh mesh)
 
static Material GetDefaultTableauSampleMaterial (bool transparency)
 
static Material CreateTableauMaterial (RenderTargetComponent.TextureUpdateEventHandler eventHandler, Object objectRef, Material sampleMaterial, int tableauSizeX, int tableauSizeY, bool continuousTableau=false)
 
static Material GetFromResource (string materialName)
 Returns a MBMaterial instance whose name is 'materialName'. More...
 
static Material GetAlphaMaskTableauMaterial ()
 

Properties

string Name [get, set]
 Gets Name of the material This property is read only More...
 
bool UsingSpecular [get, set]
 Property defining the usage of specular light component More...
 
bool UsingSpecularMap [get, set]
 Property defining the usage of specular map for specular reflection calculations UsingSpecular should be 'true' for this property to take effect More...
 
bool UsingEnvironmentMap [get, set]
 Property defining the usage of environment map More...
 
bool UsingSpecularAlpha [get, set]
 Property defining the usage of specular alpha More...
 
bool UsingDynamicLight [get, set]
 Property defining whether dynamic lights will effect this material or not More...
 
bool UsingSunLight [get, set]
 Property defining whether sun light will effect this material or not More...
 
bool UsingFresnel [get, set]
 Property defining the usage of fresnel effect on this material More...
 
bool IsSunShadowReceiver [get, set]
 Property defining whether shadows due to sun light will fall on this material More...
 
bool IsDynamicShadowReceiver [get, set]
 Property defining whether dynamic shadows will fall on this material More...
 
bool UsingDiffuseAlphaMap [get, set]
 Property defining the usage of diffuse alpha map More...
 
bool UsingParallaxMapping [get, set]
 Property defining the usage of parallax mapping More...
 
bool UsingParallaxOcclusion [get, set]
 Property defining the usage of parallax occlusion More...
 
MaterialFlags Flags [get, set]
 
- Properties inherited from TaleWorlds.Engine.Resource
bool IsValid [get]
 

Additional Inherited Members

- Protected Member Functions inherited from TaleWorlds.Engine.Resource
 Resource ()
 
void CheckResourceParameter (Resource param, string paramName="")
 Check if the parameter 'param' is null or invalid and throws an exception containing 'paramName' as further information More...
 

Member Enumeration Documentation

◆ MBTextureType

◆ MBAlphaBlendMode

Member Function Documentation

◆ GetDefaultMaterial()

static Material TaleWorlds.Engine.Material.GetDefaultMaterial ( )
static

◆ GetOutlineMaterial()

static Material TaleWorlds.Engine.Material.GetOutlineMaterial ( Mesh  mesh)
static

◆ GetDefaultTableauSampleMaterial()

static Material TaleWorlds.Engine.Material.GetDefaultTableauSampleMaterial ( bool  transparency)
static

◆ CreateTableauMaterial()

static Material TaleWorlds.Engine.Material.CreateTableauMaterial ( RenderTargetComponent.TextureUpdateEventHandler  eventHandler,
Object  objectRef,
Material  sampleMaterial,
int  tableauSizeX,
int  tableauSizeY,
bool  continuousTableau = false 
)
static

◆ CreateCopy()

Material TaleWorlds.Engine.Material.CreateCopy ( )
Returns

◆ GetFromResource()

static Material TaleWorlds.Engine.Material.GetFromResource ( string  materialName)
static
Parameters
materialNameName of the material to get
Returns
Returns the MBMaterial representation of the material named 'materialName'. Returns the previously retrieved instance. A new instance is created if there is none previously or its has been GCed. Returns null if there is no material named 'materialName'

◆ SetShader()

void TaleWorlds.Engine.Material.SetShader ( Shader  shader)
Parameters
shaderShader object to be set as the material shader

◆ GetShader()

Shader TaleWorlds.Engine.Material.GetShader ( )
Returns
Returns the material shader Returns null if no shader is assigned to this material

◆ GetShaderFlags()

UInt64 TaleWorlds.Engine.Material.GetShaderFlags ( )

◆ SetShaderFlags()

void TaleWorlds.Engine.Material.SetShaderFlags ( UInt64  flagEntry)

◆ SetMeshVectorArgument()

void TaleWorlds.Engine.Material.SetMeshVectorArgument ( float  x,
float  y,
float  z,
float  w 
)

◆ SetTexture()

void TaleWorlds.Engine.Material.SetTexture ( MBTextureType  textureType,
Texture  texture 
)
Parameters
textureTypeThe texture type.
textureTexture to be assigned to the texture slot specified by 'textureType'

◆ SetTextureAtSlot()

void TaleWorlds.Engine.Material.SetTextureAtSlot ( int  textureSlot,
Texture  texture 
)

◆ SetAreaMapScale()

void TaleWorlds.Engine.Material.SetAreaMapScale ( float  scale)

◆ SetEnableSkinning()

void TaleWorlds.Engine.Material.SetEnableSkinning ( bool  enable)

◆ UsingSkinning()

bool TaleWorlds.Engine.Material.UsingSkinning ( )

◆ GetTexture()

Texture TaleWorlds.Engine.Material.GetTexture ( MBTextureType  textureType)
Parameters
textureTypeDefines the texture type slot whose texture assignment will be returned
Returns
Returns the texture assigned to 'textureType' slot Returns null if there is no texture assigned to the specified slot

◆ GetAlphaMaskTableauMaterial()

static Material TaleWorlds.Engine.Material.GetAlphaMaskTableauMaterial ( )
static

◆ GetAlphaBlendMode()

MBAlphaBlendMode TaleWorlds.Engine.Material.GetAlphaBlendMode ( )
Returns
Returns the alpha blend mode of the material

◆ SetAlphaBlendMode()

void TaleWorlds.Engine.Material.SetAlphaBlendMode ( MBAlphaBlendMode  alphaBlendMode)
Parameters
alphaBlendModeThe alpha blend mode.

◆ SetAlphaTestValue()

void TaleWorlds.Engine.Material.SetAlphaTestValue ( float  alphaTestValue)
Parameters
alphaTestValueThe alpha blend value, from 0 to 1

◆ GetAlphaTestValue()

float TaleWorlds.Engine.Material.GetAlphaTestValue ( )

◆ AddMaterialShaderFlag()

void TaleWorlds.Engine.Material.AddMaterialShaderFlag ( String  flagName,
bool  showErrors 
)

Property Documentation

◆ Name

string TaleWorlds.Engine.Material.Name
getset

◆ UsingSpecular

bool TaleWorlds.Engine.Material.UsingSpecular
getset

◆ UsingSpecularMap

bool TaleWorlds.Engine.Material.UsingSpecularMap
getset

◆ UsingEnvironmentMap

bool TaleWorlds.Engine.Material.UsingEnvironmentMap
getset

◆ UsingSpecularAlpha

bool TaleWorlds.Engine.Material.UsingSpecularAlpha
getset

◆ UsingDynamicLight

bool TaleWorlds.Engine.Material.UsingDynamicLight
getset

◆ UsingSunLight

bool TaleWorlds.Engine.Material.UsingSunLight
getset

◆ UsingFresnel

bool TaleWorlds.Engine.Material.UsingFresnel
getset

◆ IsSunShadowReceiver

bool TaleWorlds.Engine.Material.IsSunShadowReceiver
getset

◆ IsDynamicShadowReceiver

bool TaleWorlds.Engine.Material.IsDynamicShadowReceiver
getset

◆ UsingDiffuseAlphaMap

bool TaleWorlds.Engine.Material.UsingDiffuseAlphaMap
getset

◆ UsingParallaxMapping

bool TaleWorlds.Engine.Material.UsingParallaxMapping
getset

◆ UsingParallaxOcclusion

bool TaleWorlds.Engine.Material.UsingParallaxOcclusion
getset

◆ Flags

MaterialFlags TaleWorlds.Engine.Material.Flags
getset