Classes
Members
-
code :string
-
Description
The shader built shader code.
Details
-
includedImports :Array.<string>
-
Description
The list of shader imports already included.
Details
-
includedClasses :Array.<string>
-
Description
The list of classes already included.
Details
-
includedConstants :Array.<string>
-
Description
List of names of constants already included
Details
-
includedUniforms :Array.<string>
-
Description
List of names of uniforms already included
Details
-
includedInstances :Array.<string>
-
Description
List of names of instances already included
Details
-
uniforms :Object
-
Description
An object with all the uniforms to pass to the shader.
Details
Methods
-
addChunk( code ) → {ShaderBuilder}
-
Description
Add the given chunk (without any prior test)
Parameters
Name Type Description code
string Returns
Details
-
addImport( imp ) → {ShaderBuilder}
-
Description
Incorporate the given import (if it does not already exists)
Parameters
Name Type Description imp
string the import to add
Returns
Details
-
addClass( name, code ) → {ShaderBuilder}
-
Description
Incorporate the given dependency (if it does not already exists)
Parameters
Name Type Description name
string the name of the class
code
string the code of the class
Returns
Details
-
addConstant( name, type, value ) → {ShaderBuilder}
-
Description
Add a constant to the shader code.
Parameters
Name Type Description name
string the name of the constant
type
string the GLSL type of the constant
value
* the JS value of the constant
Returns
Details
-
addUniform( name, type, value ) → {ShaderBuilder}
-
Description
Add a uniform variable to the shader code. Update the object listing all the uniforms
Parameters
Name Type Description name
string the name of the uniform
type
string the GLSL type of the uniform
value
* the JS value of the uniform
Returns
Details
-
updateUniform( name, value ) → {ShaderBuilder}
-
Description
Update the value of a previously defined uniform
Parameters
Name Type Description name
string the name of the uniform
value
* the value of the uniform
Returns
Details
-
addInstance( name, code ) → {ShaderBuilder}
-
Description
Add the given code (related to a specific instance of a class). Check before (using name) that the code has not been included before.
Parameters
Name Type Description name
string the name of the instance
code
string the code of the instance
Returns
Details