Creates a shiny new GlProgram. Used by WebGL renderer.
Name | Type | Description |
---|---|---|
options |
GlProgramOptions |
The options for the program. |
Example
// Create a new program
const program = new GlProgram({
vertex: '...',
fragment: '...',
});
Members
defaultOptions Partial<GlProgramOptions> static
The default options used by the program.
the fragment glsl shader source.
details on how to use this program with transform feedback
the vertex glsl shader source
Methods
Helper function that creates a program for a given source. It will check the program cache if the program has already been created. If it has that one will be returned, if not a new one will be created and cached.
Name | Type | Description |
---|---|---|
options |
GlProgramOptions |
The options for the program. |
Returns:
Type | Description |
---|---|
GlProgram | A program using the same source |
destroys the program