---
url: /api/passes/effectPass/functions/effectPass.md
---
# effectPass()

```ts
function effectPass<U extends EffectUniforms>(params: {
  target?: RenderTarget | null;
  targetParams?: RenderTargetParams;
  vertex?: string;
  gl?: WebGL2RenderingContext;
  fragment: string;
  attributes?: Record<string, Attribute>;
  blending?: "none" | "normal" | "additive";
  depthTest?: boolean;
  drawMode?:
    | "POINTS"
    | "LINES"
    | "LINE_STRIP"
    | "LINE_LOOP"
    | "TRIANGLES"
    | "TRIANGLE_STRIP"
    | "TRIANGLE_FAN";
  transformFeedbackVaryings?: string[];
  resolutionScale?: number;
  uniforms?: U;
}): EffectPass<U>;
```

Creates a post-processing effect pass that renders a full-screen quad.

Use with [compositor()](../../compositor/functions/compositor.md) or [glCanvas()](../../../global/glCanvas/functions/glCanvas.md).

[Example: Single pass](/examples/post-processing/single-pass/)

## Type Parameters

### U

`U` *extends* [`EffectUniforms`](../type-aliases/EffectUniforms.md)

## Parameters

### params

Configuration for the effect pass.

#### target?

| [`RenderTarget`](../../../core/renderTarget/type-aliases/RenderTarget.md)
| `null`

Caller-owned target, or `null` to render to the default framebuffer.

#### targetParams?

[`RenderTargetParams`](../../../core/renderTarget/type-aliases/RenderTargetParams.md)

Parameters for an effect-owned target, disposed with the effect.

**Default**

```ts
floatTargetConfig;
```

#### vertex?

`string`

Optional vertex shader. If omitted, the built-in full-screen triangle vertex
shader is used and its UV varying is adapted to the fragment shader.

#### gl?

`WebGL2RenderingContext`

Optional WebGL2 context used to initialize the pass immediately.

Passes without a context are initialized by calling `pass.initialize(gl)` or using the compositor.
Calling `initialize()` multiple times with the same context is a no-op.

#### fragment

`string`

Fragment shader source code.

#### attributes?

`Record`<`string`, [`Attribute`](../../../types/types/interfaces/Attribute.md)>

Mapping of attribute names to their data and configuration.

#### blending?

`"none"` | `"normal"` | `"additive"`

Blending mode to use for this pass.

**Default**

```ts
"none";
```

#### depthTest?

`boolean`

Whether to enable depth testing.

**Default**

```ts
false;
```

#### drawMode?

| `"POINTS"`
| `"LINES"`
| `"LINE_STRIP"`
| `"LINE_LOOP"`
| `"TRIANGLES"`
| `"TRIANGLE_STRIP"`
| `"TRIANGLE_FAN"`

WebGL draw mode.

**Default**

"POINTS" if `gl_PointSize` is found in the vertex shader, otherwise "TRIANGLES".

#### transformFeedbackVaryings?

`string`\[]

Array of varying names for Transform Feedback.

#### resolutionScale?

`number`

Scaling factor applied to the resolution when the pass is resized.

**Default**

```ts
1;
```

#### uniforms?

`U`

Uniform values, synchronous functions, promises, or media descriptors.

## Returns

[`EffectPass`](../type-aliases/EffectPass.md)<`U`>
