ShaderMaterial

ShaderMaterial class

A shader material allows to describe the material by external rendering engine or shader language. ShaderMaterial uses ShaderTechnique to describe the concrete rendering details, and the most suitable one will be used according to the final rendering platform. For example, your ShaderMaterial instance can have two technique, one is defined by HLSL, and another is defined by GLSL Under non-window platform the GLSL should be used instead of HLSL

Methods

constructor

NameDescription
constructor()Initializes a new instance of the ShaderMaterial class.

Result:


constructor_overload

NameDescription
constructor_overload(name)Initializes a new instance of the ShaderMaterial class.

Parameters:

NameTypeDescription
nameStringName

Result:


getTechniques

NameDescription
getTechniques()Gets all available techniques defined in this material.

Result:


getName

NameDescription
getName()Gets or sets the name. The name.

Result:


setName

NameDescription
setName(value)Gets or sets the name. The name.

Result:


getProperties

NameDescription
getProperties()Gets the collection of all properties.

Result:


getTexture

NameDescription
getTexture(slotName)Gets the texture from the specified slot, it can be material’s property name or shader’s parameter name

Parameters:

NameTypeDescription
slotNameStringSlot name.

Result: TextureBase


setTexture

NameDescription
setTexture(slotName, texture)Sets the texture to specified slot

Parameters:

NameTypeDescription
slotNameStringSlot name.
textureTextureBaseTexture.

Result: TextureBase


toString

NameDescription
toString()Formats object to string

Result: String


removeProperty

NameDescription
removeProperty(property)Removes a dynamic property.

Parameters:

NameTypeDescription
propertyPropertyWhich property to remove

Result: boolean


removeProperty

NameDescription
removeProperty(property)Remove the specified property identified by name

Parameters:

NameTypeDescription
propertStringnull

Result: boolean


getProperty

NameDescription
getProperty(property)Get the value of specified property

Parameters:

NameTypeDescription
propertyStringProperty name

Result: Object


setProperty

NameDescription
setProperty(property, value)Sets the value of specified property

Parameters:

NameTypeDescription
propertyStringProperty name
valueObjectThe value of the property

Result: Object


findProperty

NameDescription
findProperty(propertyName)Finds the property. It can be a dynamic property (Created by CreateDynamicProperty/SetProperty) or native property(Identified by its name)

Parameters:

NameTypeDescription
propertyNameStringProperty name.

Result: Property


iterator

NameDescription
iterator()Reserved for internal use.

Result: Property