WebGpuContext
Extends:
cables webgpu context/state manager
Constructor Summary
Public Constructor | ||
public |
|
Member Summary
Public Members | ||
public |
CULL_MODES: string[] |
|
public |
DEPTH_FUNCS: string[] |
|
public |
catchErrors: boolean |
|
public |
device: * |
|
public |
frame: number |
|
public |
gApi: * |
|
public |
lastErrorMsg: string |
|
public |
patch: * |
Private Members | ||
private |
_defaultBlend: {"color": *, "alpha": *} |
|
private |
|
|
private |
|
|
private |
|
|
private |
_log: * |
|
private |
_shaderStack: *[] |
|
private |
|
|
private |
_stackBlend: *[] |
|
private |
_stackCullFace: *[] |
|
private |
_stackCullFaceFacing: *[] |
|
private |
_stackDepthFunc: *[] |
|
private |
_stackDepthTest: *[] |
|
private |
_stackDepthWrite: *[] |
|
private |
_stackErrorScope: *[] |
|
private |
_stackErrorScopeLogs: *[] |
|
private |
_viewport: number[] |
Method Summary
Public Methods | ||
public |
createMesh(geom: *, glPrimitive: *): * |
|
public |
getDefaultTexture(): * |
|
public |
getEmptyTexture(): * |
|
public |
getErrorTexture(): * |
|
public |
getShader(): * |
|
public |
getViewPort(): Array |
|
public |
popBlend() |
|
public |
pop face culling enabled state |
|
public |
pop face culling face side |
|
public |
pop depth compare func |
|
public |
pop depth testing state |
|
public |
pop depth writing state |
|
public |
popErrorScope(cb: *) |
|
public |
pop current used shader from shader stack |
|
public |
pushBlend(b: *) |
|
public |
pushCullFace(b: Boolean) push face culling face enabled state |
|
public |
pushCullFaceFacing(b: *) push face culling face side |
|
public |
pushDepthFunc(f: string) |
|
public |
pushDepthTest(b: Boolean) push depth testing enabled state |
|
public |
pushDepthWrite(b: Boolean) push depth write enabled state |
|
public |
pushErrorScope(name: *, options: {}) |
|
public |
pushShader(shader: Object) push a shader to the shader stack |
|
public |
|
|
public |
renderStart(cgp: *, identTranslate: *, identTranslateView: *) |
|
public |
setDevice(device: *) |
|
public |
setViewPort(x: *, y: *, w: *, h: *) |
|
public |
stateBlend(): * |
|
public |
stateCullFace(): Boolean current state of face culling |
|
public |
stateCullFaceFacing(): Boolean current state of face culling side |
|
public |
stateDepthFunc(): string |
|
public |
stateDepthTest(): Boolean current state of depth testing |
|
public |
stateDepthWrite(): Boolean current state of depth writing |
Inherited Summary
From class CGState | ||
public get |
canvas: * |
|
public get |
canvasHeight: * |
|
public get |
canvasWidth: * |
|
public get |
pixelDensity: * |
|
public set |
|
|
public |
DEPTH_COMPARE_FUNC_ALWAYS: number |
|
public |
DEPTH_COMPARE_FUNC_EQUAL: number |
|
public |
DEPTH_COMPARE_FUNC_GREATER: number |
|
public |
DEPTH_COMPARE_FUNC_GREATEREQUAL: number |
|
public |
DEPTH_COMPARE_FUNC_LESS: number |
|
public |
DEPTH_COMPARE_FUNC_LESSEQUAL: number |
|
public |
DEPTH_COMPARE_FUNC_NEVER: number |
|
public |
DEPTH_COMPARE_FUNC_NOTEQUAL: number |
|
public |
aborted: boolean |
|
public |
autoReSize: boolean |
|
public |
canvasScale: number |
|
public |
cgCanvas: * |
|
public |
fpsCounter: * |
|
public |
frameStore: * |
|
public |
mMatrix: mat4 Current model matrix |
|
public |
pMatrix: mat4 Current projection matrix |
|
public |
patch: * |
|
public |
vMatrix: mat4 Current view matrix |
|
private |
_ident: * |
|
private |
_identView: * |
|
private |
|
|
private |
|
|
private |
_textureslots: *[] |
|
private |
|
|
public |
dispose() |
|
public |
getGApiName(): * |
|
public |
|
|
public |
|
|
public |
modelMatrix(): mat4 get model matrix |
|
public |
popModelMatrix(): mat4 pop model matrix stack |
|
public |
popPMatrix(): mat4 pop projection matrix stack |
|
public |
popViewMatrix(): mat4 pop view matrix stack |
|
public |
push a matrix to the model matrix stack |
|
public |
push a matrix to the projection matrix stack |
|
public |
push a matrix to the view matrix stack |
|
public |
setAutoResize(parent: *) |
|
public |
setCanvas(canvEle: *) |
|
public |
setSize(w: *, h: *, ignorestyle: *) |
|
public |
shouldDrawHelpers(): boolean |
|
public |
|
|
private |
|
|
private |
|
|
private |
|
|
private |
_startMatrixStacks(identTranslate: *, identTranslateView: *) |
Public Constructors
Public Members
public CULL_MODES: string[] source
public DEPTH_FUNCS: string[] source
public catchErrors: boolean source
public device: * source
public frame: number source
public gApi: * source
public lastErrorMsg: string source
Private Members
private _defaultBlend: {"color": *, "alpha": *} source
private _defaultTexture: * source
private _emptyTexture: * source
private _errorTexture: * source
private _log: * source
private _shaderStack: *[] source
private _simpleShader: * source
private _stackBlend: *[] source
private _stackCullFace: *[] source
private _stackCullFaceFacing: *[] source
private _stackDepthFunc: *[] source
private _stackDepthTest: *[] source
private _stackDepthWrite: *[] source
private _stackErrorScope: *[] source
private _stackErrorScopeLogs: *[] source
private _viewport: number[] source
Public Methods
public createMesh(geom: *, glPrimitive: *): * source
Params:
Name | Type | Attribute | Description |
geom | * | ||
glPrimitive | * |
Return:
* |
public popBlend() source
public popErrorScope(cb: *) source
Params:
Name | Type | Attribute | Description |
cb | * |
public pushBlend(b: *) source
Params:
Name | Type | Attribute | Description |
b | * |
public pushCullFace(b: Boolean) source
push face culling face enabled state
Params:
Name | Type | Attribute | Description |
b | Boolean | enabled |
public pushCullFaceFacing(b: *) source
push face culling face side
Params:
Name | Type | Attribute | Description |
b | * |
public pushDepthFunc(f: string) source
Params:
Name | Type | Attribute | Description |
f | string | depth compare func |
public pushDepthTest(b: Boolean) source
push depth testing enabled state
Params:
Name | Type | Attribute | Description |
b | Boolean | enabled |
public pushDepthWrite(b: Boolean) source
push depth write enabled state
Params:
Name | Type | Attribute | Description |
b | Boolean | enabled |
public pushErrorScope(name: *, options: {}) source
Params:
Name | Type | Attribute | Description |
name | * | ||
options | {} |
|
public pushShader(shader: Object) source
push a shader to the shader stack
Params:
Name | Type | Attribute | Description |
shader | Object |
public renderEnd() source
public renderStart(cgp: *, identTranslate: *, identTranslateView: *) source
Params:
Name | Type | Attribute | Description |
cgp | * | ||
identTranslate | * | ||
identTranslateView | * |
public setDevice(device: *) source
Params:
Name | Type | Attribute | Description |
device | * |
public setViewPort(x: *, y: *, w: *, h: *) source
Params:
Name | Type | Attribute | Description |
x | * | ||
y | * | ||
w | * | ||
h | * |
public stateCullFaceFacing(): Boolean source
current state of face culling side
Return:
Boolean | enabled |