ShaderCache

ShaderCache

new

DOC_TBA

See:
  • Context#getShaderCache
Source:

Methods

DOC_TBA

DOC_TBA

DOC_TBA

Returns:
ShaderProgram DOC_TBA.
See:

DOC_TBA

DOC_TBA

Returns a shader program from the cache, or creates and caches a new shader program, given the GLSL vertex and fragment shader source and attribute locations.

The difference between this and ShaderCache#getShaderProgram, is this is used to replace an existing reference to a shader program, which is passed as the first argument.

Parameters:
Name Type Description
shaderProgram ShaderProgram The shader program that is being reassigned. This can be undefined.
vertexShaderSource String The GLSL source for the vertex shader.
fragmentShaderSource String The GLSL source for the fragment shader.
attributeLocations Object Indices for the attribute inputs to the vertex shader.
Returns:
ShaderProgram The cached or newly created shader program.
Example
this._shaderProgram = context.shaderCache.replaceShaderProgram(
    this._shaderProgram, vs, fs, attributeLocations);
See: