Home Reference Source
import {ScanlineEffect} from 'postprocessing/src/effects/ScanlineEffect.js'
public class | source

ScanlineEffect

Extends:

Effect → ScanlineEffect

Indirect Implements:

A scanline effect.

Constructor Summary

Public Constructor
public

constructor(options: Object)

Constructs a new scanline effect.

Member Summary

Private Members
private

The amount of scanlines, relative to the screen height.

private

resolution: Vector2

The original resolution.

Method Summary

Public Methods
public

Returns the current scanline density.

public

setDensity(density: Number)

Sets the scanline density.

public

setSize(width: Number, height: Number)

Updates the size of this pass.

Inherited Summary

From class Effect
public

[key]: *

public

The effect attributes.

public

The blend mode of this effect.

public

Preprocessor macro definitions.

public

The fragment shader.

public

The name of this effect.

public

uniforms: Map<String, Uniform>

Shader uniforms.

public

The vertex shader.

public

Performs a shallow search for properties that define a dispose method and deletes them.

public

initialize(renderer: WebGLRenderer, alpha: Boolean)

Performs initialization tasks.

public

setDepthTexture(depthTexture: Texture, depthPacking: Number)

Sets the depth texture.

public

setSize(width: Number, height: Number)

Updates the size of this effect.

public

update(renderer: WebGLRenderer, inputBuffer: WebGLRenderTarget, delta: Number)

Updates the effect by performing supporting operations.

Public Constructors

public constructor(options: Object) source

Constructs a new scanline effect.

Override:

Effect#constructor

Params:

NameTypeAttributeDescription
options Object
  • optional

The options.

options.blendFunction BlendFunction
  • optional
  • default: BlendFunction.OVERLAY

The blend function of this effect.

options.density Number
  • optional
  • default: 1.25

The scanline density.

Private Members

private density: Number source

The amount of scanlines, relative to the screen height.

private resolution: Vector2 source

The original resolution.

Public Methods

public getDensity(): Number source

Returns the current scanline density.

Return:

Number

The scanline density.

public setDensity(density: Number) source

Sets the scanline density.

Params:

NameTypeAttributeDescription
density Number

The new scanline density.

public setSize(width: Number, height: Number) source

Updates the size of this pass.

Override:

Effect#setSize

Params:

NameTypeAttributeDescription
width Number

The width.

height Number

The height.