The current WebGLRenderer instance.
The attribute buffer layouts to use in the program.
OptionalindexBuffer: WebGLBufferWrapper
The index buffer to use in the program, if any.
The attribute buffer layouts to use in the program. These are used to create a VAO.
The configuration object currently being assembled.
The key of the currently active shader program.
The index buffer to use in the program, if any. This is used to create a VAO.
A map of shader programs and associated data suite, identified by a unique key.
Each key corresponds to an object of the following shape:
program (WebGLProgramWrapper) - The compiled shader program.vao (WebGLVAOWrapper) - The VAO associated with the program.config (object) - The configuration object used to create the program.The current WebGLRenderer instance.
A map of uniform values, identified by the shader uniform names. This allows uniforms to be kept between shader programs.
Add a shader addition to the current configuration.
The shader addition to add.
Optionalindex: number
The index at which to insert the addition. If not specified, it will be added at the end.
Add a feature to the current configuration.
The feature to add.
Applies all stored uniform values to the given shader program. This is used to restore uniform state when switching between shader programs, ensuring the new program receives the same uniform values as the previous one.
The shader program to apply the uniforms to.
Clear all features from the current configuration.
Remove all uniforms.
Returns the addition with the given name.
The name to find.
The addition, or null if it was not found.
Returns the index of a shader addition with the given name.
The name to find.
The index of the addition, or -1 if it was not found.
Returns a list of shader additions in the current config that have a specific tag.
The tag to filter by.
The shader additions with the tag.
Returns a program suite based on the current configuration. If the program does not exist, it is created.
The suite contains the following properties:
program (WebGLProgramWrapper) - The compiled shader program.vao (WebGLVAOWrapper) - The VAO associated with the program.config (object) - The configuration object used to create the program.If parallel shader compilation is enabled,
the program may not be available immediately.
In this case, null is returned.undefined
The program suite, or null if the program is not available.
Remove a shader addition from the current configuration.
The name of the shader addition to remove.
Remove a feature from the current configuration.
The feature to remove.
Delete a uniform value. While unused uniforms are not harmful, they do take time to process and can be a source of confusion.
The name of the uniform.
Replace a shader addition in the current configuration.
The name of the shader addition to replace.
The new shader addition.
Resets the current configuration object to its default empty state, clearing the base vertex and fragment shaders, all shader additions, and all features.
Set the base shader for the current configuration.
The name of the shader program.
The vertex shader source code.
The fragment shader source code.
Set the value of a uniform, available for all shader programs in this manager.
The name of the uniform.
The value of the uniform.
The ProgramManager is a utility class used to manage instantiated shader programs and a suite of associated data, such as a VAO. It maintains a shared pool of uniforms, so if a different shader program is used, the uniforms can be applied to the new program.