Capítulo 256 de 859

Chapter 256: HalftonePass

Core Idea

Pass for creating a RGB halftone effect.

Key Concepts

  • material : ShaderMaterial: The pass material.
  • uniforms : Object: The pass uniforms.

Code Examples

const params = {
	shape: 1,
	radius: 4,
	rotateR: Math.PI / 12,
	rotateB: Math.PI / 12 * 2,
	rotateG: Math.PI / 12 * 3,
	scatter: 0,
	blending: 1,
	blendingMode: 1,
	greyscale: false,
	disable: false
};
const halftonePass = new HalftonePass( params );
composer.addPass( halftonePass );
  • What it demonstrates: Typical usage of HalftonePass.

Reference Tables

Constructor

Signature
new HalftonePass( params : Object )

Properties

PropertyDescription
.material : ShaderMaterialThe pass material.
.uniforms : ObjectThe pass uniforms.

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 halftone pass.
.setSize( width : number, height : number )Sets the size of the pass.

Key Takeaways

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

Connects To