Capítulo 251 de 859

Chapter 251: FilmPass

Core Idea

This pass can be used to create a film grain effect.

Key Concepts

  • material : ShaderMaterial: The pass material.
  • uniforms : Object: The pass uniforms. Use this object if you want to update the intensity or grayscale values at runtime.

Code Examples

const filmPass = new FilmPass();
composer.addPass( filmPass );
  • What it demonstrates: Typical usage of FilmPass.

Reference Tables

Constructor

Signature
new FilmPass( intensity : number, grayscale : boolean )

Properties

PropertyDescription
.material : ShaderMaterialThe pass material.
.uniforms : ObjectThe pass uniforms. Use this object if you want to update the intensity or grayscale values at runtime.

Methods

MethodDescription
.dispose()Frees the GPU-related resources allocated by this instance. Call this method whenever the pass is no longer used in your app.
.render( renderer : WebGLRenderer, writeBuffer : WebGLRenderTarget, readBuffer : WebGLRenderTarget, deltaTime : number, maskActive : boolean )Performs the film pass.

Key Takeaways

  1. FilmPass extends: Pass
  2. Most relevant properties: material, uniforms.
  3. Key methods: dispose, render.

Connects To