CommandBuffer
A self-contained sequence of graphics commands that can be executed by the renderer.
| Type | Name | Interface Description |
|---|---|---|
| Functions | constructor() | Parameters • |
| Functions | blit(src: Texture | number, dest: Texture | number): void | • Function: Adds a command to copy a texture to another. Parameters • • |
| Functions | blitWithMaterial(src: Texture | number, dest: Texture | number, material: Material, shaderPass: number, isCache: boolean, properties?: MaterialPropertyBlock): void | • Function: Adds a command to copy a texture to another using a material. Parameters • • • • • • |
| Functions | clearAll(): void | • Function: Clears all commands from the buffer. |
| Functions | clearRenderTexture(clearColor: boolean, clearDepth: boolean, backgroundColor: Color, depth: number): void | • Function: Adds a command to clear a render target. Parameters • • • • |
| Functions | drawMesh(mesh: Mesh, matrix: Matrix4x4f, material: Material, submeshIndex: number, shaderPass: number, properties?: MaterialPropertyBlock | undefined, isCache?: boolean): void | • Function: Adds a command to draw a mesh. Parameters • • • • • • • |
| Functions | setGlobalColor(name: string, color: Color): void | • Function: Adds a command to set a global shader color property. Parameters • • |
| Functions | setGlobalFloat(name: string, value: number): void | • Function: Adds a command to set a global shader float property. Parameters • • |
| Functions | setGlobalMatrix(name: string, value: Matrix4x4f): void | • Function: Adds a command to set a global shader matrix property. Parameters • • |
| Functions | setGlobalTexture(name: string, texture: number | Texture): void | • Function: Adds a command to set a global shader texture property. Parameters • • |
| Functions | setGlobalVector(name: string, value: Vector4f): void | • Function: Adds a command to set a global shader vector property. Parameters • • |
| Functions | setRenderTexture(target: Texture | number): void | • Function: Adds a command to set the active render target. Parameters • |
Examples
constructor()
let obj = new APJS.CommandBuffer();
Use Case
@component()
export class NewBehaviourScript extends APJS.BasicScriptComponent {
onStart() {
// TODO: instantiate / use CommandBuffer here
}
onUpdate(deltaTime: number) {
}
}