import {ShaderModifier} from './libs/cgl/shadermodifier/cgl_shadermodifier.js'
ShaderModifier
Constructor Summary
Public Constructor | ||
public |
|
Member Summary
Public Members | ||
public |
needsTexturePush: boolean |
|
public |
opId: * |
Private Members | ||
private |
_attributes: *[] |
|
private |
_boundShader: * |
|
private |
_cgl: * |
|
private |
_changedDefines: boolean |
|
private |
_changedUniforms: boolean |
|
private |
_defines: {} |
|
private |
_definesToggled: {} |
|
private |
_lastShader: * |
|
private |
_mods: *[] |
|
private |
_modulesChanged: boolean |
|
private |
_name: * |
|
private |
_origShaders: {} |
|
private |
_structUniforms: *[] |
|
private |
_textures: *[] |
|
private |
_uniforms: *[] |
Method Summary
Public Methods | ||
public |
addAttribute(attr: *) |
|
public |
addModule(mod: *) |
|
public |
addUniform(type: *, name: *, valOrPort: *, v2: *, v3: *, v4: *, structUniformName: *, structName: *, propertyName: *, shaderType: *) |
|
public |
addUniformBoth(type: *, name: *, valOrPort: *, v2: *, v3: *, v4: *) |
|
public |
addUniformFrag(type: *, name: *, valOrPort: *, v2: *, v3: *, v4: *) |
|
public |
addUniformStruct(structName: *, uniformName: *, members: *, shaderType: *) |
|
public |
addUniformStructBoth(structName: *, uniformName: *, members: *) |
|
public |
addUniformStructFrag(structName: *, uniformName: *, members: *) |
|
public |
addUniformStructVert(structName: *, uniformName: *, members: *) |
|
public |
addUniformVert(type: *, name: *, valOrPort: *, v2: *, v3: *, v4: *) |
|
public |
bind(curShader: *, pushShader: *): * |
|
public |
currentShader(): * |
|
public |
define(what: *, value: *) |
|
public |
dispose() |
|
public |
getPrefixedName(name: *): * |
|
public |
hasDefine(name: *): boolean |
|
public |
hasUniform(name: *): * |
|
public |
pushTexture(uniformName: *, tex: *, texType: *) |
|
public |
removeDefine(name: *) |
|
public |
removeModule(title: *) |
|
public |
removeUniform(name: *) |
|
public |
removeUniformStruct(uniformName: *) |
|
public |
setUniformValue(name: *, value: *) |
|
public |
toggleDefine(name: *, b: *) |
|
public |
unbind(popShader: *) |
Private Methods | ||
private |
_addModulesToShader(shader: *) |
|
private |
_getStructUniform(uniName: *): * |
|
private |
_getUniform(name: *): boolean |
|
private |
_isStructUniform(name: *): boolean |
|
private |
_removeModulesFromShader(mod: *) |
|
private |
_removeUniformFromShader(name: *, shader: *) |
|
private |
_setUniformValue(shader: *, uniformName: *, value: *) |
|
private |
|
|
private |
_updateDefinesShader(shader: *) |
|
private |
|
|
private |
_updateUniformsShader(shader: *) |
Public Constructors
public constructor() source
Public Members
public needsTexturePush: boolean source
public opId: * source
Private Members
private _attributes: *[] source
private _boundShader: * source
private _cgl: * source
private _changedDefines: boolean source
private _changedUniforms: boolean source
private _defines: {} source
private _definesToggled: {} source
private _lastShader: * source
private _mods: *[] source
private _modulesChanged: boolean source
private _name: * source
private _origShaders: {} source
private _structUniforms: *[] source
private _textures: *[] source
private _uniforms: *[] source
Public Methods
public addAttribute(attr: *) source
Params:
Name | Type | Attribute | Description |
attr | * |
public addModule(mod: *) source
Params:
Name | Type | Attribute | Description |
mod | * |
public addUniform(type: *, name: *, valOrPort: *, v2: *, v3: *, v4: *, structUniformName: *, structName: *, propertyName: *, shaderType: *) source
Params:
Name | Type | Attribute | Description |
type | * | ||
name | * | ||
valOrPort | * | ||
v2 | * | ||
v3 | * | ||
v4 | * | ||
structUniformName | * | ||
structName | * | ||
propertyName | * | ||
shaderType | * |
public addUniformBoth(type: *, name: *, valOrPort: *, v2: *, v3: *, v4: *) source
Params:
Name | Type | Attribute | Description |
type | * | ||
name | * | ||
valOrPort | * | ||
v2 | * | ||
v3 | * | ||
v4 | * |
public addUniformFrag(type: *, name: *, valOrPort: *, v2: *, v3: *, v4: *) source
Params:
Name | Type | Attribute | Description |
type | * | ||
name | * | ||
valOrPort | * | ||
v2 | * | ||
v3 | * | ||
v4 | * |
public addUniformStruct(structName: *, uniformName: *, members: *, shaderType: *) source
Params:
Name | Type | Attribute | Description |
structName | * | ||
uniformName | * | ||
members | * | ||
shaderType | * |
public addUniformStructBoth(structName: *, uniformName: *, members: *) source
Params:
Name | Type | Attribute | Description |
structName | * | ||
uniformName | * | ||
members | * |
public addUniformStructFrag(structName: *, uniformName: *, members: *) source
Params:
Name | Type | Attribute | Description |
structName | * | ||
uniformName | * | ||
members | * |
public addUniformStructVert(structName: *, uniformName: *, members: *) source
Params:
Name | Type | Attribute | Description |
structName | * | ||
uniformName | * | ||
members | * |
public addUniformVert(type: *, name: *, valOrPort: *, v2: *, v3: *, v4: *) source
Params:
Name | Type | Attribute | Description |
type | * | ||
name | * | ||
valOrPort | * | ||
v2 | * | ||
v3 | * | ||
v4 | * |
public bind(curShader: *, pushShader: *): * source
Params:
Name | Type | Attribute | Description |
curShader | * | ||
pushShader | * |
Return:
* |
public define(what: *, value: *) source
Params:
Name | Type | Attribute | Description |
what | * | ||
value | * |
public dispose() source
public hasDefine(name: *): boolean source
Params:
Name | Type | Attribute | Description |
name | * |
Return:
boolean |
public pushTexture(uniformName: *, tex: *, texType: *) source
Params:
Name | Type | Attribute | Description |
uniformName | * | ||
tex | * | ||
texType | * |
public removeDefine(name: *) source
Params:
Name | Type | Attribute | Description |
name | * |
public removeModule(title: *) source
Params:
Name | Type | Attribute | Description |
title | * |
public removeUniform(name: *) source
Params:
Name | Type | Attribute | Description |
name | * |
public removeUniformStruct(uniformName: *) source
Params:
Name | Type | Attribute | Description |
uniformName | * |
public setUniformValue(name: *, value: *) source
Params:
Name | Type | Attribute | Description |
name | * | ||
value | * |
public toggleDefine(name: *, b: *) source
Params:
Name | Type | Attribute | Description |
name | * | ||
b | * |
public unbind(popShader: *) source
Params:
Name | Type | Attribute | Description |
popShader | * |
Private Methods
private _addModulesToShader(shader: *) source
Params:
Name | Type | Attribute | Description |
shader | * |
private _getStructUniform(uniName: *): * source
Params:
Name | Type | Attribute | Description |
uniName | * |
Return:
* |
private _getUniform(name: *): boolean source
Params:
Name | Type | Attribute | Description |
name | * |
Return:
boolean |
private _isStructUniform(name: *): boolean source
Params:
Name | Type | Attribute | Description |
name | * |
Return:
boolean |
private _removeModulesFromShader(mod: *) source
Params:
Name | Type | Attribute | Description |
mod | * |
private _removeUniformFromShader(name: *, shader: *) source
Params:
Name | Type | Attribute | Description |
name | * | ||
shader | * |
private _setUniformValue(shader: *, uniformName: *, value: *) source
Params:
Name | Type | Attribute | Description |
shader | * | ||
uniformName | * | ||
value | * |
private _updateDefines() source
private _updateDefinesShader(shader: *) source
Params:
Name | Type | Attribute | Description |
shader | * |
private _updateUniforms() source
private _updateUniformsShader(shader: *) source
Params:
Name | Type | Attribute | Description |
shader | * |