How to use the postprocessing.BlendFunction.NORMAL 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 / vt220 / index.js View on Github external
module.exports = ({ hyperTerm, xTerm }) => {

	return { 
		pass: new EffectPass(null, new Effect(
			'vt220',
			readFileSync(resolve(__dirname, '../../glsl/vt220.glsl')).toString(),
			{ blendFunction: BlendFunction.NORMAL },
		)),
		coordinateTransform: function(x, y) {
			let r = 4;
			x = (x - 0.5) * 2;
			y = (y - 0.5) * 2;

			x = r * x / Math.sqrt(r * r - x * x - y * y) * (0.465 / 0.4);
			y = r * y / Math.sqrt(r * r - x * x - y * y) * (0.473 / 0.4);

			x = x / 2 + 0.5;
			y = y / 2 + 0.5;;

			return [x, y];
		},
	};
};
github slammayjammay / hyper-postprocessing / examples / effects / mattias-crt / index.js View on Github external
module.exports = ({ hyperTerm, xTerm }) => {

	return { 
		pass: new EffectPass(null, new Effect(
			'mattias-crt',
			readFileSync(resolve(__dirname, '../../glsl/mattias-crt.glsl')).toString(),
			{ blendFunction: BlendFunction.NORMAL },
		)),
		coordinateTransform: function(x, y) {
			x = (x - 0.5) * 2;
			y = (y - 0.5) * 2;

			x *= 1.1 + Math.pow(x / 6, 2);
			y *= 1.1 + Math.pow(y / 6, 2);

			x = x / 2 + 0.5;
			y = y / 2 + 0.5;

			x = x * 0.91 + 0.045;
			y = y * 0.91 + 0.045;

			return [x, y];
		},