# drawQuadWithShader

Function · category: Graphics

Source: https://github.com/playcanvas/engine/blob/f059dc005842f76e052cdf44d8370c8c7ec475ac/src/scene/graphics/quad-render-utils.js#L30

```ts
drawQuadWithShader(device: GraphicsDevice, target: RenderTarget | null, shader: Shader, rect?: Vec4, scissorRect?: Vec4, name?: string): void
```

Draws a screen-space quad using a specific shader.

**Parameters**

- `device` ([`GraphicsDevice`](https://api.playcanvas.com/engine/classes/GraphicsDevice.md)): The graphics device used to draw the quad.
- `target` ([`RenderTarget`](https://api.playcanvas.com/engine/classes/RenderTarget.md) `| null`): The destination render target. If undefined, target is the
  frame buffer.
- `shader` ([`Shader`](https://api.playcanvas.com/engine/classes/Shader.md)): The shader used for rendering the quad. Vertex shader should contain
  `attribute vec2 vertex_position`.
- `rect` ([`Vec4`](https://api.playcanvas.com/engine/classes/Vec4.md), optional): The viewport rectangle of the quad, in pixels. Defaults to fullscreen:
  `[0, 0, target.width, target.height]`.
- `scissorRect` ([`Vec4`](https://api.playcanvas.com/engine/classes/Vec4.md), optional): The scissor rectangle of the quad, in pixels. Defaults to fullscreen:
  `[0, 0, target.width, target.height]`.
- `name` (`string`, optional): The render pass name used for GPU profiling and debugging in debug
  builds. Defaults to 'RenderPassQuad'.
