gpu-io / GPUProgram
• Readonly name: string
Name of GPUProgram, used for error logging.
• Protected _fragmentShaderSource: string
• Protected Readonly _samplerUniformsIndices: { name: string ; inputIndex: number ; shaderIndex: number }[] = []
• new GPUProgram(composer, params)
Create a GPUProgram.
| Name | Type | Description |
|---|---|---|
composer |
GPUComposer |
The current GPUComposer instance. |
params |
Object |
GPUProgram parameters. |
params.name |
string |
Name of GPUProgram, used for error logging. |
params.fragmentShader |
string | string[] |
Fragment shader source or array of sources to be joined. |
params.uniforms? |
UniformParams[] |
Array of uniforms to initialize with GPUProgram. More uniforms can be added later with GPUProgram.setUniform(). |
params.compileTimeConstants? |
CompileTimeConstants |
Compile time #define constants to include with fragment shader. |
▸ recompile(compileTimeConstants): void
Force compilation of GPUProgram with new compileTimeConstants.
| Name | Type | Description |
|---|---|---|
compileTimeConstants |
CompileTimeConstants |
Compile time #define constants to include with fragment shader. |
void
▸ setUniform(name, value, type?): void
Set fragment shader uniform for GPUProgram.
| Name | Type | Description |
|---|---|---|
name |
string |
Uniform name as it appears in fragment shader. |
value |
UniformValue |
Uniform value. |
type? |
UniformType |
Uniform type. |
void
▸ dispose(): void
Deallocate GPUProgram instance and associated WebGL properties.
void