Instantiate a new shader material. The ShaderMaterial object has the necessary methods to pass data from your scene to the Vertex and Fragment Shaders and returns a material that can be applied to any mesh. This returned material effects how the mesh will look based on the code in the shaders.
Define the name of the material in the scene
Define the scene the material belongs to
Defines the route to the shader code in one of three ways:
Define the options used to create the shader
Gets the alpha value of the material
Gets the value of the alpha mode
Stores the animations for the material
Gets the back-face culling state
Specifies if the ready state should be checked on each call
Specifies if the ready state should be checked once
Specifies the depth function that should be used. 0 means the default engine function
Specifies if depth writing should be disabled
Specifies if the material should be serialized
Sets the material fill mode
Gets the value of the fog enabled state
Specifies if depth writing should be forced
Callback triggered to get the render target textures
Gets a boolean indicating that current material needs to register RTT
The ID of the material
List of inspectable custom properties (used by the Inspector)
Specifies if updates for the material been locked
Gets or sets user defined metadata
The name of the material
Gets the depth pre-pass value
Called during a bind event
An event triggered when the material is bound
Callback triggered when the material is compiled
Called during a dispose event
An event triggered when the material is disposed
Callback triggered when an error occurs
An event triggered when the material is unbound
Gets the options used to compile the shader. They can be modified to trigger a new compilation
Stores the size of points
Sets the state of point cloud mode
For internal use only. Please do not use.
Specifies if there should be a separate pass for culling
Sets the shader path used to define the shader code It can be modified to trigger a new compilation
Stores the value for side orientation
The state of the material
Gets or sets the unique id of the material
Sets the state of wireframe mode
Stores the z offset value
The all dirty flag value
The dirty attribute flag value
Stores the clock-wise side orientation
Stores the counter clock-wise side orientation
The dirty fresnel flag value
The dirty light flag value
Returns the line list draw mode
Returns the line loop draw mode
Returns the line strip draw mode
The dirty misc flag value
Returns the point fill mode
Returns the point list draw mode
The dirty texture flag value
Returns the triangle fan draw mode
Returns the triangle fill mode
Returns the triangle strip draw mode
Returns the wireframe mode
Binds the world matrix to the material
defines the world transformation matrix
Binds the scene's uniform buffer to the effect.
defines the effect to bind to the scene uniform buffer
defines the uniform buffer storing scene data
Binds the view matrix to the effect
defines the effect to bind the view matrix to
Binds the view projection matrix to the effect
defines the effect to bind the view projection matrix to
Makes a duplicate of the material, and gives it a new name
defines the new name for the duplicated material
the cloned material
Disposes the material
specifies if effects should be forcefully disposed
specifies if textures should be forcefully disposed
specifies if the material that is being disposed is known to be not bound to any mesh
Force shader compilation
defines the mesh associated with this material
defines a function to execute once the material is compiled
defines the options to configure the compilation
defines a function to execute if the material fails compiling
Force shader compilation
defines the mesh that will use this material
defines additional options for compiling the shaders
a promise that resolves when the compilation completes
Locks updates for the material
Gets the active textures from the material
an array of textures
Gets the texture used for the alpha test
the texture to use for alpha testing
Gets the meshes bound to the material
an array of meshes bound to the material
Gets the current class name of the material e.g. "ShaderMaterial" Mainly use in serialization.
the class name
Returns the current scene
a Scene
Specifies if the material uses a texture
defines the texture to check against the material
a boolean specifying if the material uses the texture
Checks if the material is ready to render the requested mesh
Define the mesh to render
Define whether or not the material is used with instances
true if ready, otherwise false
Specifies that the submesh is ready to be used
defines the mesh to check
defines which submesh to check
specifies that instances should be used
a boolean indicating that the submesh is ready or not
Marks a define in the material to indicate that it needs to be re-computed
defines a flag used to determine which parts of the material have to be marked as dirty
Marks the material to indicate that it needs to be re-calculated
Specifies if the material will require alpha blending
a boolean specifying if alpha blending is needed
Specifies if the mesh will require alpha blending
defines the mesh to check
a boolean specifying if alpha blending is needed for the mesh
Specifies if this material should be rendered in alpha test mode
a boolean specifying if an alpha test is needed.
Serializes this material in a JSON representation
the serialized material object
Set a vec2 array in the shader from a number array.
Define the name of the uniform as defined in the shader
Define the value to give to the uniform
the material itself allowing "fluent" like uniform updates
Set a vec3 array in the shader from a number array.
Define the name of the uniform as defined in the shader
Define the value to give to the uniform
the material itself allowing "fluent" like uniform updates
Set a vec4 array in the shader from a number array.
Define the name of the uniform as defined in the shader
Define the value to give to the uniform
the material itself allowing "fluent" like uniform updates
Set a vec3 in the shader from a Color3.
Define the name of the uniform as defined in the shader
Define the value to give to the uniform
the material itself allowing "fluent" like uniform updates
Set a vec3 array in the shader from a Color3 array.
Define the name of the uniform as defined in the shader
Define the value to give to the uniform
the material itself allowing "fluent" like uniform updates
Set a vec4 in the shader from a Color4.
Define the name of the uniform as defined in the shader
Define the value to give to the uniform
the material itself allowing "fluent" like uniform updates
Set a vec4 array in the shader from a Color4 array.
Define the name of the uniform as defined in the shader
Define the value to give to the uniform
the material itself allowing "fluent" like uniform updates
Set a float in the shader.
Define the name of the uniform as defined in the shader
Define the value to give to the uniform
the material itself allowing "fluent" like uniform updates
Set an array of floats in the shader.
Define the name of the uniform as defined in the shader
Define the value to give to the uniform
the material itself allowing "fluent" like uniform updates
Set a int in the shader.
Define the name of the uniform as defined in the shader
Define the value to give to the uniform
the material itself allowing "fluent" like uniform updates
Set a float32Array in the shader from a matrix array.
Define the name of the uniform as defined in the shader
Define the value to give to the uniform
the material itself allowing "fluent" like uniform updates
Set a mat4 in the shader from a Matrix.
Define the name of the uniform as defined in the shader
Define the value to give to the uniform
the material itself allowing "fluent" like uniform updates
Set a mat2 in the shader from a Float32Array.
Define the name of the uniform as defined in the shader
Define the value to give to the uniform
the material itself allowing "fluent" like uniform updates
Set a mat3 in the shader from a Float32Array.
Define the name of the uniform as defined in the shader
Define the value to give to the uniform
the material itself allowing "fluent" like uniform updates
Set a texture in the shader.
Define the name of the uniform samplers as defined in the shader
Define the texture to bind to this sampler
the material itself allowing "fluent" like uniform updates
Set a texture array in the shader.
Define the name of the uniform sampler array as defined in the shader
Define the list of textures to bind to this sampler
the material itself allowing "fluent" like uniform updates
Set a vec2 in the shader from a Vector2.
Define the name of the uniform as defined in the shader
Define the value to give to the uniform
the material itself allowing "fluent" like uniform updates
Set a vec3 in the shader from a Vector3.
Define the name of the uniform as defined in the shader
Define the value to give to the uniform
the material itself allowing "fluent" like uniform updates
Set a vec4 in the shader from a Vector4.
Define the name of the uniform as defined in the shader
Define the value to give to the uniform
the material itself allowing "fluent" like uniform updates
Returns a string representation of the current material
defines a boolean indicating which levels of logging is desired
a string with material information
Unbinds the material from the mesh
Unlocks updates for the material
Creates a shader material from parsed shader material data
defines the JSON represnetation of the material
defines the hosting scene
defines the root URL to use to load textures and relative dependencies
a new material
Generated using TypeDoc
The ShaderMaterial object has the necessary methods to pass data from your scene to the Vertex and Fragment Shaders and returns a material that can be applied to any mesh.
This returned material effects how the mesh will look based on the code in the shaders.
http://doc.babylonjs.com/how_to/shader_material