Home Reference Source
public class | source

FilmMaterial

Extends:

three~ShaderMaterial → FilmMaterial

A cinematic shader that provides the following effects:

  • Film Grain
  • Scanlines
  • Vignette
  • Greyscale
  • Sepia

Original scanlines algorithm by Pat "Hawthorne" Shearon. http://www.truevision3d.com/forums/showcase/staticnoise_colorblackwhite_scanline_shaders-t18698.0.html

Optimised scanlines and noise with intensity scaling by Georg "Leviathan" Steinrohder. This version was provided under a Creative Commons Attribution 3.0 License: http://creativecommons.org/licenses/by/3.0.

The sepia effect is based on: https://github.com/evanw/glfx.js

The vignette code is based on PaintEffect postprocess from ro.me: http://code.google.com/p/3-dreams-of-black/source/browse/deploy/js/effects/PaintEffect.js

Constructor Summary

Public Constructor
public

constructor(options: Object)

Constructs a new film material.

Member Summary

Public Members
public

Method Summary

Public Methods
public

Enables or disables the Eskil Vignette effect.

public

Enables or disables the greyscale effect.

public

Enables or disables the grid effect.

public

Enables or disables the noise effect.

public

Enables or disables the scanlines effect.

public

Enables or disables the Screen blend mode.

public

Enables or disables the sepia effect.

public

Enables or disables the Vignette effect.

Public Constructors

public constructor(options: Object) source

Constructs a new film material.

Params:

NameTypeAttributeDescription
options Object
  • optional

The options. Disabled effects will not be included in the final shader and have no negative impact on performance.

options.greyscale Boolean
  • optional
  • default: false

Enable greyscale effect. Greyscale and sepia are mutually exclusive.

options.sepia Boolean
  • optional
  • default: false

Enable sepia effect. Greyscale and sepia are mutually exclusive.

options.vignette Boolean
  • optional
  • default: false

Apply vignette effect.

options.eskil Boolean
  • optional
  • default: false

Use Eskil's vignette approach. The default looks dusty while Eskil looks burned out.

options.screenMode Boolean
  • optional
  • default: true

Whether the screen blend mode should be used for noise and scanlines. Both of these effects are computed independently.

options.noise Boolean
  • optional
  • default: true

Show noise-based film grain.

options.scanlines Boolean
  • optional
  • default: true

Show scanlines.

options.grid Boolean
  • optional
  • default: true

Show a grid.

options.noiseIntensity Number
  • optional
  • default: 0.5

The noise intensity.

options.scanlineIntensity Number
  • optional
  • default: 0.05

The scanline intensity.

options.gridIntensity Number
  • optional
  • default: 1.0

The grid strength. 0.0 to 1.0.

options.greyscaleIntensity Number
  • optional
  • default: 1.0

The intensity of the greyscale effect. 0.0 to 1.0.

options.sepiaIntensity Number
  • optional
  • default: 1.0

The intensity of the sepia effect. 0.0 to 1.0.

options.vignetteOffset Number
  • optional
  • default: 1.0

The offset of the vignette effect. 0.0 to 1.0.

options.vignetteDarkness Number
  • optional
  • default: 1.0

The darkness of the vignette effect. 0.0 to 1.0.

Public Members

public needsUpdate: boolean source

Public Methods

public setEskilEnabled(enabled: Boolean) source

Enables or disables the Eskil Vignette effect.

Has no effect if Vignette is disabled.

Params:

NameTypeAttributeDescription
enabled Boolean

Whether the Eskil Vignette effect should be enabled.

public setGreyscaleEnabled(enabled: Boolean) source

Enables or disables the greyscale effect.

Params:

NameTypeAttributeDescription
enabled Boolean

Whether the greyscale effect should be enabled.

public setGridEnabled(enabled: Boolean) source

Enables or disables the grid effect.

Params:

NameTypeAttributeDescription
enabled Boolean

Whether the grid effect should be enabled.

public setNoiseEnabled(enabled: Boolean) source

Enables or disables the noise effect.

Params:

NameTypeAttributeDescription
enabled Boolean

Whether the noise effect should be enabled.

public setScanlinesEnabled(enabled: Boolean) source

Enables or disables the scanlines effect.

Params:

NameTypeAttributeDescription
enabled Boolean

Whether the scanlines effect should be enabled.

public setScreenModeEnabled(enabled: Boolean) source

Enables or disables the Screen blend mode.

Params:

NameTypeAttributeDescription
enabled Boolean

Whether the Screen blend mode should be enabled.

public setSepiaEnabled(enabled: Boolean) source

Enables or disables the sepia effect.

Params:

NameTypeAttributeDescription
enabled Boolean

Whether the sepia effect should be enabled.

public setVignetteEnabled(enabled: Boolean) source

Enables or disables the Vignette effect.

Params:

NameTypeAttributeDescription
enabled Boolean

Whether the Vignette effect should be enabled.