ShaderMaterial

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.

see

http://doc.babylonjs.com/how_to/shader_material

Hierarchy

Implements

Index

Constructors

constructor

Find examples in Playground
  • 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.

    see

    http://doc.babylonjs.com/how_to/shader_material

    Parameters

    • name: string

      Define the name of the material in the scene

    • scene: Scene

      Define the scene the material belongs to

    • shaderPath: any

      Defines the route to the shader code in one of three ways: - object - { vertex: "custom", fragment: "custom" }, used with Effect.ShadersStore["customVertexShader"] and Effect.ShadersStore["customFragmentShader"] - object - { vertexElement: "vertexShaderCode", fragmentElement: "fragmentShaderCode" }, used with shader code in