QuadRender
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();
Summary
Methods
destroy | Destroys the resources associated with this instance. |
render | Renders the quad. |
Details
Constructor
QuadRender(shader)
Create a new QuadRender instance.
Parameters
shader | Shader | The shader to be used to render the quad. |
Methods
destroy()
Destroys the resources associated with this instance.
render([viewport], [scissor])
Renders the quad. If the viewport is provided, the original viewport and scissor is restored after the rendering.
Parameters
viewport | Vec4 | The viewport rectangle of the quad, in pixels. The viewport is not changed if not provided. |
scissor | Vec4 | The scissor rectangle of the quad, in pixels. Used only if the viewport is provided. |