How to use the postprocessing.BlendFunction.MULTIPLY function in postprocessing

To help you get started, we’ve selected a few postprocessing examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github slammayjammay / hyper-postprocessing / examples / effects / fallout-boy / index.js View on Github external
// turn all colors that aren't black into white -- then we can multiply the
	// image against this to "shine" through only the text (setting the background
	// to black in the hyper config is required)
	const textEffect = new Effect(
		'textEffect',
		readFileSync(resolve(__dirname, '../../glsl/black-and-white.glsl')).toString()
	);

	// move background image left
	const backgroundEffect = new Effect(
		'backgroundEffect',
		readFileSync(resolve(__dirname, '../../glsl/background-image.glsl')).toString(),
		{
			uniforms: new Map([['backgroundImage', new Uniform(null)]]),
			defines: new Map([['motionX', '-0.1']]),
			blendFunction: BlendFunction.MULTIPLY
		}
	);

	new TextureLoader().load(resolve(__dirname, '../../images/fallout-boy.jpg'), texture => {
		texture.minFilter = LinearFilter;
		backgroundEffect.uniforms.get('backgroundImage').value = texture;
	});

	return { pass: new EffectPass(null, textEffect, backgroundEffect) };
};