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(); Copy
const shader = pc.createShaderFromCode(app.graphicsDevice, vertexShader, fragmentShader, `MyShader`);const quad = new QuadRender(shader);quad.render();quad.destroy();
Create a new QuadRender instance.
The shader to be used to render the quad.
Destroys the resources associated with this instance.
Renders the quad. If the viewport is provided, the original viewport and scissor is restored after the rendering.
Optional
The viewport rectangle of the quad, in pixels. The viewport is not changed if not provided.
The scissor rectangle of the quad, in pixels. Used only if the viewport is provided.
An object that renders a quad using a Shader.
Example: