How to use the postprocessing.EffectPass 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 moxuse / Kusabi / src / RenderView.ts View on Github external
this.port.postEffects.forEach(e => {
      console.log("append effect pass", e);
      const renderPass = new RenderPass(this.scene, this.camera);
      const pass = new EffectPass(this.camera, e.effect);
      pass.renderToScreen = e.renderToScreen;
      this.effectComposer.addPass(renderPass);
      this.effectComposer.addPass(pass);
    });
  }
github luan007 / libao / three-helper.js View on Github external
rings: 5,
            samples: 5,
            showFocus: false,
            manualDoF: false,
            pentagon: true
        });

        const bloomEffect = new post_pss.BloomEffect({
            blendFunction: post_pss.BlendFunction.ADD,
            resolutionScale: 0.5,
            distinction: 4.0
        });
        bloomEffect.blendMode.opacity.value = 2.1;


        var bokeh = new post_pss.EffectPass(options.camera, bokehEffect, bloomEffect);
        composer.bokeh = bokeh;
        composer.addPass(bokeh);
        bokeh.renderToScreen = true;
        window.bokeh = bokeh;
    }

    return composer;
}
github slammayjammay / hyper-postprocessing / examples / effects / retro / index.js View on Github external
function coordinateTransform(x, y) {
	x -= 0.5;
	y -= 0.5;

	let dist = screenCurvature * (x*x + y*y);
	dist *= 1.0 + dist;

	return [x * dist + x + 0.5, y * dist + y + 0.5];
};

return { 
	passes: [
		new POSTPROCESSING.EffectPass(null, burnInEffect),
		savePass,
		new POSTPROCESSING.EffectPass(null, retroEffect),
		new POSTPROCESSING.EffectPass(null, bloomEffect),
		new POSTPROCESSING.EffectPass(null, frameEffect),
	],
	coordinateTransform: coordinateTransform,
};


};
github slammayjammay / hyper-postprocessing / examples / effects / chalk / index.js View on Github external
module.exports = ({ hyperTerm, xTerm }) => {
	const effect = new Effect(
		'chalkEffect',
		readFileSync(resolve(__dirname, '../../glsl/chalk.glsl')).toString(),
		{
			uniforms: new Map([['noiseTexture', new Uniform(null)]])
		}
	);

	new TextureLoader().load(resolve(__dirname, '../../images/noise.png'), texture => {
		texture.minFilter = LinearFilter;
		effect.uniforms.get('noiseTexture').value = texture;
	});

	return { pass: new EffectPass(null, effect) };
};
github slammayjammay / hyper-postprocessing / examples / effects / ripple / index.js View on Github external
'scaleEffect',
		readFileSync(resolve(__dirname, '../../glsl/scale.glsl')).toString(),
		{
			defines: new Map([['scale', '0.9']])
		}
	));

	effects.push(new Effect(
		'sampling',
		readFileSync(resolve(__dirname, '../../glsl/sampling.glsl')).toString(),
		{
			blendFunction: 13
		}
	));

	return { pass: new EffectPass(null, ...effects) };
};
github slammayjammay / hyper-postprocessing / examples / effects / retro / index.js View on Github external
}
);

function coordinateTransform(x, y) {
	x -= 0.5;
	y -= 0.5;

	let dist = screenCurvature * (x*x + y*y);
	dist *= 1.0 + dist;

	return [x * dist + x + 0.5, y * dist + y + 0.5];
};

return { 
	passes: [
		new POSTPROCESSING.EffectPass(null, burnInEffect),
		savePass,
		new POSTPROCESSING.EffectPass(null, retroEffect),
		new POSTPROCESSING.EffectPass(null, bloomEffect),
		new POSTPROCESSING.EffectPass(null, frameEffect),
	],
	coordinateTransform: coordinateTransform,
};


};
github typpo / spacekit / src / Simulation.js View on Github external
});
    */
    //godRaysEffect.dithering = true;

    const bloomEffect = new BloomEffect(this._scene, camera, {
      width: 240,
      height: 240,
      luminanceThreshold: 0.2,
    });
    bloomEffect.inverted = true;
    bloomEffect.blendMode.opacity.value = 2.3;

    const renderPass = new RenderPass(this._scene, camera);
    renderPass.renderToScreen = false;

    const effectPass = new EffectPass(
      camera,
      /*smaaEffect, godRaysEffect*/ bloomEffect,
    );
    effectPass.renderToScreen = true;

    const composer = new EffectComposer(this._renderer);
    composer.addPass(renderPass);
    composer.addPass(effectPass);
    this._composer = composer;
  }