FilmMaterial
Extends:
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 |
setEskilEnabled(enabled: Boolean) Enables or disables the Eskil Vignette effect. |
|
public |
setGreyscaleEnabled(enabled: Boolean) Enables or disables the greyscale effect. |
|
public |
setGridEnabled(enabled: Boolean) Enables or disables the grid effect. |
|
public |
setNoiseEnabled(enabled: Boolean) Enables or disables the noise effect. |
|
public |
setScanlinesEnabled(enabled: Boolean) Enables or disables the scanlines effect. |
|
public |
setScreenModeEnabled(enabled: Boolean) Enables or disables the Screen blend mode. |
|
public |
setSepiaEnabled(enabled: Boolean) Enables or disables the sepia effect. |
|
public |
setVignetteEnabled(enabled: Boolean) Enables or disables the Vignette effect. |
Public Constructors
public constructor(options: Object) source
Constructs a new film material.
Params:
Name | Type | Attribute | Description |
options | Object |
|
The options. Disabled effects will not be included in the final shader and have no negative impact on performance. |
options.greyscale | Boolean |
|
Enable greyscale effect. Greyscale and sepia are mutually exclusive. |
options.sepia | Boolean |
|
Enable sepia effect. Greyscale and sepia are mutually exclusive. |
options.vignette | Boolean |
|
Apply vignette effect. |
options.eskil | Boolean |
|
Use Eskil's vignette approach. The default looks dusty while Eskil looks burned out. |
options.screenMode | Boolean |
|
Whether the screen blend mode should be used for noise and scanlines. Both of these effects are computed independently. |
options.noise | Boolean |
|
Show noise-based film grain. |
options.scanlines | Boolean |
|
Show scanlines. |
options.grid | Boolean |
|
Show a grid. |
options.noiseIntensity | Number |
|
The noise intensity. |
options.scanlineIntensity | Number |
|
The scanline intensity. |
options.gridIntensity | Number |
|
The grid strength. 0.0 to 1.0. |
options.greyscaleIntensity | Number |
|
The intensity of the greyscale effect. 0.0 to 1.0. |
options.sepiaIntensity | Number |
|
The intensity of the sepia effect. 0.0 to 1.0. |
options.vignetteOffset | Number |
|
The offset of the vignette effect. 0.0 to 1.0. |
options.vignetteDarkness | Number |
|
The darkness of the vignette effect. 0.0 to 1.0. |
Public Methods
public setEskilEnabled(enabled: Boolean) source
Enables or disables the Eskil Vignette effect.
Has no effect if Vignette is disabled.
Params:
Name | Type | Attribute | Description |
enabled | Boolean | Whether the Eskil Vignette effect should be enabled. |
public setGreyscaleEnabled(enabled: Boolean) source
Enables or disables the greyscale effect.
Params:
Name | Type | Attribute | Description |
enabled | Boolean | Whether the greyscale effect should be enabled. |
public setGridEnabled(enabled: Boolean) source
Enables or disables the grid effect.
Params:
Name | Type | Attribute | Description |
enabled | Boolean | Whether the grid effect should be enabled. |
public setNoiseEnabled(enabled: Boolean) source
Enables or disables the noise effect.
Params:
Name | Type | Attribute | Description |
enabled | Boolean | Whether the noise effect should be enabled. |
public setScanlinesEnabled(enabled: Boolean) source
Enables or disables the scanlines effect.
Params:
Name | Type | Attribute | Description |
enabled | Boolean | Whether the scanlines effect should be enabled. |
public setScreenModeEnabled(enabled: Boolean) source
Enables or disables the Screen blend mode.
Params:
Name | Type | Attribute | Description |
enabled | Boolean | Whether the Screen blend mode should be enabled. |