Post Processing with A-Frame

HTML

<script src="https://aframe.io/releases/1.0.4/aframe.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/postprocessing@latest/build/postprocessing.min.js"></script>
<body>
	<a-scene renderer="antialias: false">
		<a-box position="-1 0.5 -3" rotation="0 45 0" color="#4CC3D9"></a-box>
		<a-sphere position="0 1.25 -5" radius="1.25" color="#EF2D5E"></a-sphere>
		<a-cylinder position="1 0.75 -3" radius="0.5" height="1.5" color="#FFC65D"></a-cylinder>
		<a-plane position="0 0 -4" rotation="-90 0 0" width="4" height="4" color="#7BC8A4"></a-plane>
		<a-sky color="#ECECEC"></a-sky>
	</a-scene>
</body>

JavaScript

const { Clock, LoadingManager } = THREE;

const {
	EffectComposer,
	EffectPass,
	NoiseEffect,
	RenderPass,
  SepiaEffect,
	SMAAEffect,
	SMAAImageLoader,
	VignetteEffect
} = POSTPROCESSING;

/**
 * A postprocessing system.
 */

class PostProcessingSystem {

	/**
	 * Constructs a new postprocessing system.
	 *
	 * @param {System} system - A proxy system.
	 */

	constructor(assets) {

		/**
		 * Assets.
		 *
		 * @type {Map}
		 * @private
		 */

		this.assets = assets;

		/**
		 * An effect composer.
		 *
		 * @type {EffectComposer}
		 * @private
		 */

		this.composer = null;

		/**
		 * A render method.
		 *
		 * @type {Function}
		 * @private
		 */

		this.renderMethod = null;

		/**
		 * The original render method.
		 *
		 * @type {Function}
		 * @private
		 */

		this.originalRenderMethod = null;

		/**
		 * Controls whether this system is enabled.
		 *
		 * @type {Boolean}
		 */

		this.enabled = true;

	}

	/**
	 * Initializes this system.
	 *
	 * @param {System} system - A proxy system.
	 */

	init(system) {

		const sceneEl = system.sceneEl;

		const scene = sceneEl.object3D;
		const renderer = sceneEl.renderer;
		const render = renderer.render;
		const camera = sceneEl.camera;

		const assets = this.assets;
		const clock = new Clock();
		const composer = new EffectComposer(renderer);

		this.composer = composer;
		this.originalRenderMethod = render;

		const smaaEffect = new SMAAEffect(
			assets.get("smaa-search"),
			assets.get("smaa-area")
		);

		const noiseEffect = new NoiseEffect();
		const sepiaEffect = new SepiaEffect();
		const vignetteEffect = new VignetteEffect();

		noiseEffect.blendMode.opacity.value = 0.6;
		sepiaEffect.blendMode.opacity.value = 0.3;

		const renderPass = new RenderPass(scene, camera);
		const effectPass = new EffectPass(
			camera,
			smaaEffect,
			noiseEffect,
			sepiaEffect,
			vignetteEffect
		);

		composer.addPass(renderPass);
		composer.addPass(effectPass);

		// Hijack the render method.
		let calledByComposer =...