Shader
Extends:
Constructor Summary
| Public Constructor | ||
| public |
|
|
Member Summary
| Public Members | ||
| public |
|
|
| public |
bindingCounter: number |
|
| public |
bindingsComp: undefined[] |
|
| public |
bindingsFrag: undefined[] |
|
| public |
bindingsVert: undefined[] |
|
| public |
compute: * |
|
| public |
|
|
| public |
|
|
| public |
|
|
| public |
|
|
| public get |
isValid: * |
|
| public |
needsPipelineUpdate: string |
|
| public |
|
|
| public |
|
|
| public |
|
|
| public |
|
|
| public |
|
|
| public get |
uniforms: * |
|
| Private Members | ||
| private |
_bindingIndexCount: number |
|
| private |
_cgp: * |
|
| private |
_compileReason: string |
|
| private |
_isValid: boolean |
|
| private |
_log: * |
|
| private |
_name: * |
|
| private |
_needsRecompile: boolean |
|
| private |
_src: string |
|
| private |
|
|
| private |
|
|
| private |
_uniforms: *[] |
|
Method Summary
| Public Methods | ||
| public |
addUniform(type: String, name: String, valueOrPort: any, p2: *, p3: *, p4: *): Uniform add a uniform to all shader programs |
|
| public |
addUniformFrag(type: String, name: String, valueOrPort: any, p2: *, p3: *, p4: *): Uniform add a uniform to the fragment shader |
|
| public |
addUniformVert(type: String, name: String, valueOrPort: any, p2: *, p3: *, p4: *): Uniform add a uniform to the vertex shader |
|
| public |
bind() |
|
| public |
compile() |
|
| public |
copy(): * copy current shader |
|
| public |
copyUniformValues(origShader: *) copy all uniform values from another shader |
|
| public |
error(e: *) |
|
| public |
getName(): * |
|
| public |
getNewBindingIndex(): * |
|
| public |
getProcessedSource(): * |
|
| public |
getUniform(name: *): * |
|
| public |
|
|
| public |
reInit() |
|
| public |
setSource(src: *) |
|
| public |
setWhyCompile(why: *) |
|
| Private Methods | ||
| private |
_addUniform(uni: *) |
|
| private |
_replaceMods(vs: *): * |
|
Inherited Summary
| From class CgShader | ||
| public |
id: * |
|
| private |
_defines: *[] |
|
| private |
_isValid: boolean |
|
| private |
_moduleNames: *[] |
|
| private |
_moduleNumId: number |
|
| private |
_modules: *[] |
|
| private |
_needsRecompile: boolean |
|
| public |
addModule(mod: shaderModule, sibling: shaderModule): * add a module |
|
| public |
define(name: String, value: Any) add a define to a shader, e.g. |
|
| public |
getAttributeSrc(mod: *, srcHeadVert: *, srcVert: *): {"srcHeadVert": *, "srcVert": *} |
|
| public |
getCurrentModules(): * |
|
| public |
getDefine(name: *): * |
|
| public |
getDefines(): * |
|
| public |
getNumModules(): * |
|
| public |
hasDefine(name: String): Boolean return true if shader has define |
|
| public |
hasModule(modId: *): boolean |
|
| public |
removeDefine(name: name) remove a define from a shader |
|
| public |
removeModule(mod: shaderModule) remove a module from shader |
|
| public |
|
|
| public |
setModules(names: *) |
|
| public |
toggleDefine(name: name, enabled: any) easily enable/disable a define without a value |
|
Public Constructors
Public Members
public bindCountlastFrame: * source
public bindingCounter: number source
public bindingsComp: undefined[] source
public bindingsFrag: undefined[] source
public bindingsVert: undefined[] source
public compute: * source
public defaultBindingComp: * source
public defaultBindingFrag: * source
public defaultBindingVert: * source
public gpuShaderModule: * source
public get isValid: * source
public needsPipelineUpdate: string source
public uniModelMatrix: * source
public uniModelViewMatrix: * source
public uniNormalMatrix: * source
public uniProjMatrix: * source
public uniViewMatrix: * source
public get uniforms: * source
Private Members
private _bindingIndexCount: number source
private _cgp: * source
private _compileReason: string source
private _log: * source
private _name: * source
private _src: string source
private _tempModelViewMatrix: * source
private _tempNormalMatrix: * source
private _uniforms: *[] source
Public Methods
public addUniform(type: String, name: String, valueOrPort: any, p2: *, p3: *, p4: *): Uniform source
add a uniform to all shader programs
Params:
| Name | Type | Attribute | Description |
| type | String | ['f','t', etc] |
|
| name | String | ||
| valueOrPort | any | value or port |
|
| p2 | * | ||
| p3 | * | ||
| p4 | * |
public addUniformFrag(type: String, name: String, valueOrPort: any, p2: *, p3: *, p4: *): Uniform source
add a uniform to the fragment shader
Params:
| Name | Type | Attribute | Description |
| type | String | ['f','t', etc] |
|
| name | String | ||
| valueOrPort | any | value or port |
|
| p2 | * | ||
| p3 | * | ||
| p4 | * |
public addUniformVert(type: String, name: String, valueOrPort: any, p2: *, p3: *, p4: *): Uniform source
add a uniform to the vertex shader
Params:
| Name | Type | Attribute | Description |
| type | String | ['f','t', etc] |
|
| name | String | ||
| valueOrPort | any | value or port |
|
| p2 | * | ||
| p3 | * | ||
| p4 | * |
public bind() source
public compile() source
public copyUniformValues(origShader: *) source
copy all uniform values from another shader
Params:
| Name | Type | Attribute | Description |
| origShader | * | uniform values will be copied from this shader |
public error(e: *) source
Params:
| Name | Type | Attribute | Description |
| e | * |
public incBindingCounter() source
public reInit() source
public setSource(src: *) source
Params:
| Name | Type | Attribute | Description |
| src | * |
public setWhyCompile(why: *) source
Params:
| Name | Type | Attribute | Description |
| why | * |
Private Methods
private _addUniform(uni: *) source
Params:
| Name | Type | Attribute | Description |
| uni | * |