Constructor
new L3D.ShaderManager()
Methods
compileShader(vsCode, fsCode) → GLShader
Compiles a shader, the vertex and fragment shader are cached indepently to speed up
compilations but a unique name must be provided. Shaders compiled with the ShaderManager
will be compiled as #version 300 es and if the float precision hasn't been set, default
to highp precision.
vsCode |
String | GLSL code for the vertex shader. |
fsCode |
String | GLSL code for the fragment shader. |
- GLShader
Shader object.
deviceShaderCode(gl, code) → String
Prepends device specific code to the shader.
gl |
GLContext | |
code |
String |
- String
getGlobalExtraShaderCode(gl) → String
Returns extra code to prepend to shaders to include initializing common extensions, etc.
gl |
GLContext | The WebGL context the shader will be compiled with. |
- String
getShaderBlock(id) → nullable ShaderBlock
Returns the shaderblock with the given id.
id |
String |
getShaderBlockMask(id)
Return the compilation mask for the given shader block.
id |
String |
registerShaderBlock(id, shaderBlock)
Register a shaderblock in the global container so it can be used by materials.
id |
String | Unique name for the shader block |
shaderBlock |
ShaderBlock | The shader block to register. |