API

Type Alias IComputeShaderPath

Defines the route to the shader code. The priority is as follows:

  • object: { computeSource: "compute shader code string"} for directly passing the shader code
  • object: { computeElement: "vertexShaderCode" }, used with shader code in script tags
  • object: { compute: "custom" }, used with Effect.ShadersStore["customVertexShader"] and Effect.ShadersStore["customFragmentShader"]
  • string: "./COMMON_NAME", used with external files COMMON_NAME.vertex.fx and COMMON_NAME.fragment.fx in index.html folder.
type IComputeShaderPath = {
    compute?: string;
    computeElement?: string;
    computeSource?: string;
}
Index
compute?: string

Used with Effect.ShadersStore. If the vertex is set to "custom, then Babylon.js will read from Effect.ShadersStore["customVertexShader"]

computeElement?: string

Used with shader code in script tags

computeSource?: string

Directly pass the shader code