An object that renders a quad using a Shader.

Example:

const shader = pc.createShaderFromCode(app.graphicsDevice, vertexShader, fragmentShader, `MyShader`);
const quad = new QuadRender(shader);
quad.render();
quad.destroy();

Constructors

Methods

Constructors

Methods

  • Renders the quad. If the viewport is provided, the original viewport and scissor is restored after the rendering.

    Parameters

    • Optionalviewport: Vec4

      The viewport rectangle of the quad, in pixels. The viewport is not changed if not provided.

    • Optionalscissor: Vec4

      The scissor rectangle of the quad, in pixels. Used only if the viewport is provided.

    Returns void