Using ThreeJS `OutlineEffect` in Lume

How should I go about using postprocessing effects such as the OutlineEffect in ThreeJS within Lume? I’d imagine using the scene’s glRenderer in some way, but I’m not familiar with the API.

1 Like

What we can do is override the <lume-scene> element’s drawScene function so that we can call a custom Three.js effect composer:

	const scene = document.querySelector('lume-scene') // get the <lume-scene> element

	const renderPass = new RenderPass(scene.three, scene.threeCamera)

	const glitchPass = new GlitchPass()

	const outputPass = new OutputPass()

	scene.drawScene = () => {
		// If there are multiple cameras in the Lume scene, make sure to always
		// use the currently-active camera. = scene.threeCamera


Live demo: