@animech-public/playcanvas
Version:
PlayCanvas WebGL game engine
34 lines (33 loc) • 2.77 kB
TypeScript
/**
* Draws a screen-space quad using a specific shader.
*
* @param {import('../../platform/graphics/graphics-device.js').GraphicsDevice} device - The graphics device used to draw
* the quad.
* @param {import('../../platform/graphics/render-target.js').RenderTarget|null} target - The destination render
* target. If undefined, target is the frame buffer.
* @param {import('../../platform/graphics/shader.js').Shader} shader - The shader used for rendering the quad. Vertex
* shader should contain `attribute vec2 vertex_position`.
* @param {import('../../core/math/vec4.js').Vec4} [rect] - The viewport rectangle of the quad, in
* pixels. Defaults to fullscreen (`0, 0, target.width, target.height`).
* @param {import('../../core/math/vec4.js').Vec4} [scissorRect] - The scissor rectangle of the
* quad, in pixels. Defaults to fullscreen (`0, 0, target.width, target.height`).
* @category Graphics
*/
export function drawQuadWithShader(device: import("../../platform/graphics/graphics-device.js").GraphicsDevice, target: import("../../platform/graphics/render-target.js").RenderTarget | null, shader: import("../../platform/graphics/shader.js").Shader, rect?: import("../../core/math/vec4.js").Vec4, scissorRect?: import("../../core/math/vec4.js").Vec4, ...args: any[]): void;
/**
* Draws a texture in screen-space. Mostly used by post-effects.
*
* @param {import('../../platform/graphics/graphics-device.js').GraphicsDevice} device - The graphics device used to draw
* the texture.
* @param {import('../../platform/graphics/texture.js').Texture} texture - The source texture to be drawn. Accessible as
* `uniform sampler2D * source` in shader.
* @param {import('../../platform/graphics/render-target.js').RenderTarget} [target] - The destination render target.
* Defaults to the frame buffer.
* @param {import('../../platform/graphics/shader.js').Shader} [shader] - The optional custom shader used for rendering the texture.
* @param {import('../../core/math/vec4.js').Vec4} [rect] - The viewport rectangle to use for the
* texture, in pixels. Defaults to fullscreen (`0, 0, target.width, target.height`).
* @param {import('../../core/math/vec4.js').Vec4} [scissorRect] - The scissor rectangle to use for
* the texture, in pixels. Defaults to fullscreen (`0, 0, target.width, target.height`).
* @category Graphics
*/
export function drawTexture(device: import("../../platform/graphics/graphics-device.js").GraphicsDevice, texture: import("../../platform/graphics/texture.js").Texture, target?: import("../../platform/graphics/render-target.js").RenderTarget, shader?: import("../../platform/graphics/shader.js").Shader, rect?: import("../../core/math/vec4.js").Vec4, scissorRect?: import("../../core/math/vec4.js").Vec4, ...args: any[]): void;