Create a shader program.
The rendering context.
Optional
shaders: Shader[]The shaders to attach to the shader program. If a valid set of shaders is given, the program will be linked automatically.
Optional
attributeLocations: Map<string, number>A map of attribute names to their desired locations.
Optional
feedbackVaryings: Iterable<string, any, any>The names of the varyings that should be tracked for transform feedback.
The mode to use when capturing transform feedback varyings.
ProgramLinkError if there is an issue when linking the shader program.
The number of active attribute variables in this shader program.
The number of active uniform variables in this shader program.
The shaders that are attached to this shader program.
The number of shaders that are attached to this shader program.
The deletion status of this shader program.
The linking status of this shader program.
The number of transform feedback varying variables in this shader program.
The validation status of this shader program.
The transform feedback varyings in this shader program.
Bind a generic vertex index to an attribute variable. Doing this after linking this program has no effect.
The index of the generic vertex to bind.
The name of the variable to bind to the generic vertex index.
Detach the given shader from this shader program.
The shader to detach.
Link this shader program.
ProgramLinkError if there is an issue when linking the shader program.
Specify the values to record in transform feedback buffers. Doing this after linking this program has no effect.
The names of the varyings to use for transform feedback.
The mode to use when capturing the varying variables.
Static
fromCreate a shader program from the given shader source code.
The rendering context.
The vertex shader's source code.
The fragment shader's source code.
The shader program.
ProgramLinkError if the shaders have different contexts, if either shader is not the correct type, or if there is an issue when linking the shader program.
UnsupportedOperationError if a shader program cannot be created.
UnsupportedOperationError if a shader cannot be created.
ShaderCompileError if a shader fails to compile.
A WebGL2 shader program.
See
WebGLProgram