videojs / videojs-vr

A plugin to add 360 and VR video support to video.js.
https://videojs-vr.netlify.com/
MIT License
543 stars 145 forks source link

Use with THREE.EffectComposer causes massive stutter #168

Open blurymind opened 5 years ago

blurymind commented 5 years ago

Trying to apply a vignette post effect causes stutter. I was wondering if perhaps there is some sort of a way to set it up properly

What I do:

rt.renderer = rt.video.vr().renderer
rt.composer = new THREE.EffectComposer(rt.renderer)
var mainPass = new THREE.RenderPass(rt.scene, rt.camera);
rt.composer.addPass(mainPass);
const copyPass = new THREE.ShaderPass(THREE.CopyShader);
copyPass.renderToScreen = true;
rt.effect = new THREE.ShaderPass(THREE.VignetteShader)
rt.effect.uniforms.darkness.value = 2.4
rt.composer.addPass(rt.effect)
rt.composer.addPass(copyPass);
rt.composer.setSize(window.innerWidth, window.innerHeight);

during update, i do rt.composer.render(0.05)