ShaderProgram¶
Under Construction
This documentation is auto-generated, and is a work in progress. Please see the source code at https://github.com/phetsims/scenery/blob/main/js/util/ShaderProgram.ts for the most up-to-date information.
Overview¶
Abstraction over the shader program
@author Jonathan Olson <jonathan.olson@colorado.edu>
Class ShaderProgram¶
Constructor¶
new ShaderProgram( gl : WebGLRenderingContext, vertexSource : string, fragmentSource : string, providedOptions? : ShaderProgramOptions )¶
Instance Methods¶
initialize( gl : WebGLRenderingContext )¶
Initializes (or reinitializes) the WebGL state and uniform/attribute references.
use()¶
activateAttribute( attributeName : string )¶
enableVertexAttribArray( attributeName : string )¶
unuse()¶
disableVertexAttribArray( attributeName : string )¶
deactivateAttribute( attributeName : string )¶
dispose()¶
Releases references
Instance Properties¶
uniformLocations : Record<string, WebGLUniformLocation>¶
attributeLocations : Record<string, number>¶
activeAttributes : Record<string, boolean>¶
Type ShaderProgramOptions¶
- attributes?: string[]
(vertex) attribute names in the shader source - uniforms?: string[]
uniform names in the shader source
Source Code¶
See the source for ShaderProgram.ts in the scenery repository.